2019-05-29 18:07:28 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
I2P_SOURCE_DIR="$(realpath $SCRIPT_DIR/../..)"
|
|
|
|
|
|
|
|
if [[ -z "$1" ]]; then
|
|
|
|
echo "You must run the script with the build number as first argument. Example ./script 6"
|
2019-05-30 10:58:09 +00:00
|
|
|
exit 1
|
2019-05-29 18:07:28 +00:00
|
|
|
fi
|
|
|
|
BUILD_NUMBER="$1"
|
|
|
|
|
|
|
|
cd $I2P_SOURCE_DIR
|
2019-05-29 18:22:33 +00:00
|
|
|
ant mavenLocal || (echo "Build failed!!!" && exit 1)
|
2019-05-29 18:07:28 +00:00
|
|
|
|
|
|
|
# Append right build number to jar files (and everything else but we don't care)
|
2019-05-30 10:58:09 +00:00
|
|
|
cd $I2P_SOURCE_DIR/pkg-mavencentral || (echo "Build failed!!!" && exit 1)
|
2019-06-01 20:06:22 +00:00
|
|
|
for file in `ls -1 *.jar`; do
|
2019-05-29 18:07:28 +00:00
|
|
|
filename=$(basename -- "$file")
|
|
|
|
extension="${filename##*.}"
|
|
|
|
filename="${filename%.*}"
|
|
|
|
mv $file "${filename}-${BUILD_NUMBER}.${extension}"
|
|
|
|
done
|
|
|
|
|
|
|
|
filename=$(ls -1 i2p*jar)
|
|
|
|
tmp=${filename#*-}
|
|
|
|
version=${tmp%.*}
|
|
|
|
echo "I2P is ${version}"
|
|
|
|
|
|
|
|
# Finally, install to maven.
|
|
|
|
mvn install:install-file \
|
|
|
|
-Dpackaging=jar \
|
|
|
|
-DgroupId=net.i2p \
|
|
|
|
-DartifactId=i2p \
|
|
|
|
-Dversion=$version -Dfile="i2p-${version}.jar"
|
|
|
|
|
|
|
|
mvn install:install-file \
|
|
|
|
-Dpackaging=jar \
|
|
|
|
-DgroupId=net.i2p \
|
|
|
|
-DartifactId=router \
|
|
|
|
-Dversion=$version -Dfile="router-${version}.jar"
|
|
|
|
|
|
|
|
mvn install:install-file \
|
|
|
|
-Dpackaging=jar \
|
|
|
|
-DgroupId=net.i2p.client \
|
|
|
|
-DartifactId=mstreaming \
|
|
|
|
-Dversion=$version -Dfile="mstreaming-${version}.jar"
|
|
|
|
|
|
|
|
mvn install:install-file \
|
|
|
|
-Dpackaging=jar \
|
|
|
|
-DgroupId=net.i2p.client \
|
|
|
|
-DartifactId=streaming \
|
|
|
|
-Dversion=$version -Dfile="streaming-${version}.jar"
|
|
|
|
|
|
|
|
|