bundle webapp resources and application configs

This commit is contained in:
idk
2021-03-18 23:12:52 -04:00
parent 981f8e0646
commit 2c36fdcb90
3 changed files with 33 additions and 5 deletions

View File

@ -12,19 +12,32 @@ rm -f *.exe
rm -f *.dmg
RES_DIR=../i2p.i2p/installer/resources
I2P_JARS=../i2p.i2p/pkg-temp/lib
HERE=$PWD
RES_DIR=$HERE/../i2p.i2p/installer/resources
I2P_JARS=$HERE/../i2p.i2p/pkg-temp/lib
I2P_PKG=$HERE/../i2p.i2p/pkg-temp
echo "preparing resources.csv"
mkdir build
cd $RES_DIR
find certificates -name *.crt -exec echo '{},{}' >> $HERE/build/resources.csv \;
cd small
find . -name '*.config' -exec echo 'small/{},{}' >> $HERE/build/resources.csv \;
echo "preparing webapps"
cd $I2P_PKG
find webapps -name '*.war' -exec echo '{},{}' >> $HERE/build/resources.csv \;
cd $HERE
echo "geoip/GeoLite2-Country.mmdb,geoip/GeoLite2-Country.mmdb" >> build/resources.csv
sed -i 's|\./||g' build/resources.csv
echo "copying certificates"
cp -R $RES_DIR/certificates build/
echo "copying config"
cp -R $RES_DIR/small build/
cp -R $I2P_PKG/webapps build/
echo "copying GeoIP"
mkdir build/geoip
@ -39,7 +52,7 @@ cd ..
echo "building launcher.jar"
cd build
$JAVA_HOME/bin/jar -cf launcher.jar net certificates geoip resources.csv
$JAVA_HOME/bin/jar -cf launcher.jar net certificates geoip small webapps resources.csv
cd ..
echo "preparing to invoke jpackage"

15
clean.sh Executable file
View File

@ -0,0 +1,15 @@
#! /usr/bin/env sh
rm -rfv \
build \
eventlog.txt \
hostsdb.blockfile \
I2P \
i2p_1.0-1_amd64.deb \
libjbigi.so \
libjcpuid.so \
logs \
peerProfiles \
prngseed.rnd \
router.config \
wrapper.log

View File

@ -55,7 +55,7 @@ public class PackageLauncher {
} else {
// All other platforms
// TODO: Maybe. Determine if it's a service and return a different home.
i2p = new File(home, "i2p");
i2p = new File(home, "I2P");
}
return i2p.getAbsoluteFile();
}
@ -77,7 +77,7 @@ public class PackageLauncher {
targetDir.mkdirs();
else if (!targetDir.isDirectory())
throw new Exception(targetDir + " exists but not a directory. Please get it out of the way");
System.out.println(targetFile.toPath());
Files.copy(resource, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
}