Made some fixes to the packaging to keep the data outside of the jar file.

This commit is contained in:
skydive 2004-10-04 09:15:57 +00:00
parent 1f204b1106
commit a2e02fb7a5
4 changed files with 158 additions and 7 deletions

View File

@ -65,13 +65,18 @@ In case the command could not be found, check your Java installation
and make sure that the java (*nix) or java.exe (Windows) file is in
your PATH.
Windows users may be able to just double click the file
'FreeCol.jar' from within Windows Explorer.
You may ignore the message:
"The music files could not be loaded by FreeCol. Disabling music."
because there is no music available yet for FreeCol.
IV. Troubleshooting
=================================
<Will be written when common problems are known>
Q: I get the following error:
The data file "data/images/units/Unit0.png" could not be found.
A: Use the command-line option --freecol-data to specify the location
of the 'data' directory.
For example: java -jar FreeCol.jar --freecol-data C:\Games\FreeCol\data
V. Help, Feedback & Bug Reports

View File

@ -0,0 +1,75 @@
#!/bin/bash
#######################################################################################################
#
# This script generates a .tar.gz file that is fit for distribution to the user.
#
# It will add the following files to the archive:
# - the source files
# - the data files (images, music & sounds)
# - the build.xml file
# - all files from the freecol/packaging/common directory
# (these files will be put in the archive under the freecol directory to make them easily
# accessible by the user)
#
# The only variables that may be configured are FREECOL_CVS_DIR and VERSION.
#
#######################################################################################################
# Location of the freecol CVS directory.
FREECOL_CVS_DIR=/home/`whoami`/freecol
# The current FreeCol version
VERSION="0.3.0"
#######################################################################################################
#
# Start of the script.
#
#
# Step 1: Set some variables and go to the correct directory.
#
OLD_PWD=`pwd`
cd $FREECOL_CVS_DIR/..
#
# Step 2: Copy the common files so that they can be easily added to the correct directory in the archive.
#
commonFiles=`find freecol/packaging/common ! -path '*CVS*' -type f -printf '%f '`
for i in $commonFiles; do
if [ -f freecol/$i ]; then
echo "File \"freecol/$i\" already exists. It will be overwritten when making the tar.gz file. Aborting."
exit 1
elif [ -d freecol/$i ]; then
echo "Directory \"freecol/$i\" already exists. It will be overwritten when making the tar.gz file. Aborting."
exit 1
fi
done
copyFiles=`find freecol/packaging/common ! -path '*CVS*' -type f -printf '%p '`
cp $copyFiles freecol
#
# Step 3: Find the files that should be added to the archive. These will be passed on to 'tar'.
#
filesToArchive=`\
find freecol/src ! -name '*.class' ! -path '*CVS*' ! -path '*classes*' -type f -printf '%p ';\
find freecol/data ! -path '*CVS*' -type f -printf '%p ';\
find freecol/build.xml -type f -printf '%p '`
for i in $commonFiles; do
filesToArchive="$filesToArchive freecol/$i"
done
#
# Step 4: Create the 'tar.gz' file.
#
tar -cvzf $OLD_PWD/freecol-$VERSION-src.tar.gz $filesToArchive
#
# Step 5: Remove the common files that were copied in Step 2.
#
for i in $commonFiles; do
rm -f freecol/$i
done

View File

@ -5,9 +5,8 @@
# This script generates a .tar.gz file that is fit for distribution to the user.
#
# It will add the following files to the archive:
# - the source files
# - the jar file
# - the data files (images, music & sounds)
# - the build.xml file
# - all files from the freecol/packaging/common directory
# (these files will be put in the archive under the freecol directory to make them easily
# accessible by the user)
@ -55,9 +54,8 @@ cp $copyFiles freecol
# Step 3: Find the files that should be added to the archive. These will be passed on to 'tar'.
#
filesToArchive=`\
find freecol/src ! -name '*.class' ! -path '*CVS*' ! -path '*classes*' -type f -printf '%p ';\
find freecol/data ! -path '*CVS*' -type f -printf '%p ';\
find freecol/build.xml -type f -printf '%p '`
find freecol/FreeCol.jar -type f -printf '%p '`
for i in $commonFiles; do
filesToArchive="$filesToArchive freecol/$i"
done

73
packaging/targz/create_zip.sh Executable file
View File

@ -0,0 +1,73 @@
#!/bin/bash
#######################################################################################################
#
# This script generates a .zip file that is fit for distribution to the user.
#
# It will add the following files to the archive:
# - the jar file
# - the data files (images, music & sounds)
# - all files from the freecol/packaging/common directory
# (these files will be put in the archive under the freecol directory to make them easily
# accessible by the user)
#
# The only variables that may be configured are FREECOL_CVS_DIR and VERSION.
#
#######################################################################################################
# Location of the freecol CVS directory.
FREECOL_CVS_DIR=/home/`whoami`/freecol
# The current FreeCol version
VERSION="0.3.0"
#######################################################################################################
#
# Start of the script.
#
#
# Step 1: Set some variables and go to the correct directory.
#
OLD_PWD=`pwd`
cd $FREECOL_CVS_DIR/..
#
# Step 2: Copy the common files so that they can be easily added to the correct directory in the archive.
#
commonFiles=`find freecol/packaging/common ! -path '*CVS*' -type f -printf '%f '`
for i in $commonFiles; do
if [ -f freecol/$i ]; then
echo "File \"freecol/$i\" already exists. It will be overwritten when making the tar.gz file. Aborting."
exit 1
elif [ -d freecol/$i ]; then
echo "Directory \"freecol/$i\" already exists. It will be overwritten when making the tar.gz file. Aborting."
exit 1
fi
done
copyFiles=`find freecol/packaging/common ! -path '*CVS*' -type f -printf '%p '`
cp $copyFiles freecol
#
# Step 3: Find the files that should be added to the archive. These will be passed on to 'zip'.
#
filesToArchive=`\
find freecol/data ! -path '*CVS*' -type f -printf '%p ';\
find freecol/FreeCol.jar -type f -printf '%p '`
for i in $commonFiles; do
filesToArchive="$filesToArchive freecol/$i"
done
#
# Step 4: Create the 'zip' file.
#
zip $OLD_PWD/freecol-$VERSION.zip $filesToArchive
#
# Step 5: Remove the common files that were copied in Step 2.
#
for i in $commonFiles; do
rm -f freecol/$i
done