mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
Allow it to be ran on windows
(via Git-Bash)
This commit is contained in:
1
packaging/package-windows.sh
Normal file
1
packaging/package-windows.sh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
sh ./package.sh -windows
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
|
#windows or linux
|
||||||
|
if [ "$1" = "-windows" ] ; then
|
||||||
|
echo "Got '-windows' flag. Running Windows version"
|
||||||
|
LINUX=false
|
||||||
|
else
|
||||||
|
echo "No '-windows' flag. Running linux version"
|
||||||
|
LINUX=true
|
||||||
|
fi
|
||||||
|
|
||||||
#read the folder this script should be in (should be the packaging folder inside the ATCS source)
|
#read the folder this script should be in (should be the packaging folder inside the ATCS source)
|
||||||
PACKAGING_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
|
PACKAGING_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
|
||||||
ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
|
ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
|
||||||
@@ -25,13 +34,18 @@ MANIFEST_LOCATION=${TEMP_DIR}/Manifest.txt
|
|||||||
|
|
||||||
#copy lib files to packaged folder?
|
#copy lib files to packaged folder?
|
||||||
echo 'copying lib files'
|
echo 'copying lib files'
|
||||||
mkdir ${PACKAGING_DIR}/common/lib/
|
mkdir -p ${PACKAGING_DIR}/common/lib/
|
||||||
cp ${ATCS_SOURCE_DIR}/lib/* ${PACKAGING_DIR}/common/lib/
|
cp ${ATCS_SOURCE_DIR}/lib/* ${PACKAGING_DIR}/common/lib/
|
||||||
|
|
||||||
cd $ATCS_SOURCE_DIR
|
cd $ATCS_SOURCE_DIR
|
||||||
#set ClassPath variable to use in the building etc.
|
#set ClassPath variable to use in the building etc.
|
||||||
echo 'setting class path'
|
echo 'setting class path'
|
||||||
CP="lib/*:src:hacked-libtiled:siphash-zackehh/src/main/java"
|
#linux needs a : as seperator while windows needs ;
|
||||||
|
if [ "$LINUX" = true ] ; then
|
||||||
|
CP="lib/*:src:hacked-libtiled:siphash-zackehh/src/main/java"
|
||||||
|
else
|
||||||
|
CP="lib/*;src;hacked-libtiled;siphash-zackehh/src/main/java"
|
||||||
|
fi
|
||||||
echo "ClassPath: "
|
echo "ClassPath: "
|
||||||
echo ${CP}
|
echo ${CP}
|
||||||
echo ""
|
echo ""
|
||||||
@@ -40,6 +54,7 @@ echo ""
|
|||||||
echo 'building java classes'
|
echo 'building java classes'
|
||||||
#javac -cp $CP *.java
|
#javac -cp $CP *.java
|
||||||
javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
|
javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
|
||||||
|
echo javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
|
||||||
echo ""
|
echo ""
|
||||||
LIB_PATHS=$(find lib -name '*.jar' | paste -sd' ')
|
LIB_PATHS=$(find lib -name '*.jar' | paste -sd' ')
|
||||||
echo "LIB_PATHS: ${LIB_PATHS}"
|
echo "LIB_PATHS: ${LIB_PATHS}"
|
||||||
@@ -55,11 +70,15 @@ echo "creating jar at location: ${JAR_LOCATION}"
|
|||||||
# the things to add always use the whole relative path from the current dir,
|
# the things to add always use the whole relative path from the current dir,
|
||||||
# so when that is not wanted, the -C <location> thing will change to that dir
|
# so when that is not wanted, the -C <location> thing will change to that dir
|
||||||
jar mfc ${MANIFEST_LOCATION} ${JAR_LOCATION} -C ${PACKAGING_DIR}/tmp/ com/gpl/rpg/atcontentstudio/ -C res . -C ${ATCS_SOURCE_DIR}/src .
|
jar mfc ${MANIFEST_LOCATION} ${JAR_LOCATION} -C ${PACKAGING_DIR}/tmp/ com/gpl/rpg/atcontentstudio/ -C res . -C ${ATCS_SOURCE_DIR}/src .
|
||||||
#-C ${ATCS_SOURCE_DIR} lib -
|
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
echo "Done creating jar"
|
echo "Done creating jar"
|
||||||
cd ${PACKAGING_DIR}
|
|
||||||
echo "Creating zip"
|
if [ "$LINUX" = true ] ; then
|
||||||
tar caf "ATCS_${VERSION}.zip" "common"
|
cd ${PACKAGING_DIR}
|
||||||
echo "Created zip at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
|
echo "Creating archive"
|
||||||
|
tar caf "ATCS_${VERSION}.tar.gz" "common"
|
||||||
|
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.tar.gz"
|
||||||
|
else
|
||||||
|
echo "Can't create zip files on windows yet. Please pack the content of the '${PACKAGING_DIR}/common/' folder yourself
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user