Cleaned up JDK references, now easier to change JDK version and download URLs

Don't re-download JDKs/i2p/Ant if dirs already exist in import dir
pull/2/head
knaccc 5 years ago
parent cffc9db627
commit 8100534089

@ -25,7 +25,7 @@ Then, retrieve this project from git:
`git clone https://github.com/knaccc/i2p-zero.git`
Note that the current version of this script uses jdk-11.0.2. If this version of Java becomes no longer available for
download, then update the references to jdk-11.0.2 in this folder structure to the later version. To locate a recent
download, then update the references to jdk-11.0.2 in java-config.sh to the later version. To locate a recent
JDK download URL, see https://jdk.java.net/11/
Also note that JDKs for Linux, MacOS and Windows will be downloaded, which will total several hundred megabytes.

@ -2,13 +2,6 @@
basedir=$(dirname $(dirname $(readlink -fm $0)))
OS=`uname -s`
if [ $OS = "Darwin" ]; then
export JAVA_HOME=`realpath $basedir/import/jdks/mac/jdk-11.0.2.jdk/Contents/Home`
else
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-11.0.2`
fi
# convert the jar files from an existing I2P build into modules suitable for use with jlink
$basedir/bin/convert-jars-to-modules.sh
@ -24,13 +17,13 @@ mkdir -p $basedir/dist/linux $basedir/dist/mac $basedir/dist/win
# create OS specific launchers which will bundle together the code and a minimal JVM
echo "*** Performing jlink (Linux)"
$JAVA_HOME/bin/jlink --module-path $JAVA_HOME/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output dist/linux/router --strip-debug --compress 2 --no-header-files --no-man-pages
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/linux/jdk-${JDK_VERSION}/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --output dist/linux/router --strip-debug --compress 2 --no-header-files --no-man-pages
echo "*** Performing jlink (Mac)"
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/mac/jdk-11.0.2.jdk/Contents/Home/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output dist/mac/router --strip-debug --compress 2 --no-header-files --no-man-pages
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/mac/jdk-${JDK_VERSION}.jdk/Contents/Home/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --output dist/mac/router --strip-debug --compress 2 --no-header-files --no-man-pages
echo "*** Performing jlink (Windows)"
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/win/jdk-11.0.2/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --launcher router=org.getmonero.i2p.embedded --output dist/win/router --strip-debug --compress 2 --no-header-files --no-man-pages
$JAVA_HOME/bin/jlink --module-path $basedir/import/jdks/win/jdk-${JDK_VERSION}/jmods:target/modules:target/org.getmonero.i2p.embedded.jar --add-modules org.getmonero.i2p.embedded --output dist/win/router --strip-debug --compress 2 --no-header-files --no-man-pages
cp $basedir/resources/launch.sh $basedir/dist/linux/router/bin/
@ -52,5 +45,7 @@ zip -d $basedir/dist/win/router/i2p.base/jbigi.jar *-osx-*
zip -d $basedir/dist/win/router/i2p.base/jbigi.jar *-linux-*
zip -d $basedir/dist/win/router/i2p.base/jbigi.jar *-freebsd-*
du -sh $basedir/dist/*
echo "*** Done ***"
echo "To run, type: dist/linux/router/bin/launch.sh"

@ -4,13 +4,7 @@ basedir=$(dirname $(dirname $(readlink -fm $0)))
cd $basedir/import
OS=`uname -s`
if [ $OS = "Darwin" ]; then
export JAVA_HOME=`realpath $basedir/import/jdks/mac/jdk-11.0.2.jdk/Contents/Home`
else
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-11.0.2`
fi
source $basedir/bin/java-config.sh
# build the jars we're going to modularize
cd $basedir/import/i2p.i2p

@ -2,12 +2,7 @@
basedir=$(dirname $(dirname $(readlink -fm $0)))
OS=`uname -s`
if [ $OS = "Darwin" ]; then
export JAVA_HOME=`realpath $basedir/import/jdks/mac/jdk-11.0.2.jdk/Contents/Home`
else
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-11.0.2`
fi
source $basedir/bin/java-config.sh
jarPaths=`find $basedir/import/lib -name '*.jar'`

@ -2,21 +2,32 @@
basedir=$(dirname $(dirname $(readlink -fm $0)))
mkdir $basedir/import
source $basedir/bin/java-config.sh
mkdir -p $basedir/import
cd $basedir/import
git clone https://github.com/i2p/i2p.i2p.git
if [ ! -d ""$basedir/i2p.i2p" ]; then
git clone https://github.com/i2p/i2p.i2p.git
fi
git checkout tags/i2p-0.9.37
if [ ! -d ""$basedir/jdks" ]; then
mkdir -p jdks
mkdir -p jdks/linux jdks/mac jdks/win
wget --directory-prefix=jdks/linux $JDK_DOWNLOAD_URL_LINUX
wget --directory-prefix=jdks/mac $JDK_DOWNLOAD_URL_MAC
wget --directory-prefix=jdks/win $JDK_DOWNLOAD_URL_WIN
mkdir jdks
mkdir jdks/linux jdks/mac jdks/win
wget --directory-prefix=jdks/linux https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
wget --directory-prefix=jdks/mac https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
wget --directory-prefix=jdks/win https://download.java.net/java/GA/jdk11/7/GPL/openjdk-11.0.2_windows-x64_bin.zip
tar zxvf jdks/linux/$JDK_DOWNLOAD_FILENAME_LINUX -C jdks/linux/
tar zxvf jdks/mac/$JDK_DOWNLOAD_FILENAME_MAC -C jdks/mac/
unzip jdks/win/$JDK_DOWNLOAD_FILENAME_WIN -d jdks/win/
fi
wget https://www-us.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz
if [ ! -d ""$basedir/apache-ant-1.10.5" ]; then
wget https://www-us.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz
tar zxvf apache-ant-1.10.5-bin.tar.gz
fi
tar zxvf jdks/linux/openjdk-11.0.2_linux-x64_bin.tar.gz -C jdks/linux/
tar zxvf jdks/mac/openjdk-11.0.2_osx-x64_bin.tar.gz -C jdks/mac/
unzip jdks/win/openjdk-11.0.2_windows-x64_bin.zip -d jdks/win/
tar zxvf apache-ant-1.10.5-bin.tar.gz

@ -0,0 +1,20 @@
#!/bin/bash
basedir=$(dirname $(dirname $(readlink -fm $0)))
JDK_VERSION=11.0.2
JDK_DOWNLOAD_FILENAME_LINUX=openjdk-${JDK_VERSION}_linux-x64_bin.tar.gz
JDK_DOWNLOAD_FILENAME_MAC=openjdk-${JDK_VERSION}_osx-x64_bin.tar.gz
JDK_DOWNLOAD_FILENAME_WIN=openjdk-${JDK_VERSION}_windows-x64_bin.zip
JDK_DOWNLOAD_URL_LINUX=https://download.java.net/java/GA/jdk11/7/GPL/$JDK_DOWNLOAD_FILENAME_LINUX
JDK_DOWNLOAD_URL_MAC=https://download.java.net/java/GA/jdk11/7/GPL/$JDK_DOWNLOAD_FILENAME_MAC
JDK_DOWNLOAD_URL_WIN=https://download.java.net/java/GA/jdk11/7/GPL/$JDK_DOWNLOAD_FILENAME_WIN
OS=`uname -s`
if [ $OS = "Darwin" ]; then
export JAVA_HOME=`realpath $basedir/import/jdks/mac/jdk-${JDK_VERSION}.jdk/Contents/Home`
else
export JAVA_HOME=`realpath $basedir/import/jdks/linux/jdk-${JDK_VERSION}`
fi
Loading…
Cancel
Save