Added script that dump changes in configs. Minior cleanup in build script.

This commit is contained in:
Richard Helgeby 2009-12-28 04:47:01 +01:00
parent 40463b718a
commit 7c5db80cc7
2 changed files with 42 additions and 24 deletions

View File

@ -3,6 +3,8 @@
VERSION="zombiereloaded-3.0-b2"
REVISION=$(hg id -n)
SYNTAX="Usage: $0 [--patch <base rev>]"
# Source paths
BUILDDIR=build
PLUGINFILE=zombiereloaded.smx
@ -21,22 +23,19 @@ ZIPFILE=$VERSION-r$REVISION.zip
MAKEPATCH=false
# Clean build and release directory.
make clean
rm -rf $RELEASEDIR
echo "Cleaned build and release directory."
# Exit if cleaning only.
if [ "$1" = "clean" ]
if [ "$1" = "--clean" ]
then
exit 0
fi
# Check if patch mode is enabled.
if [ "$1" = "patch" ]
if [ "$1" = "--patch" ]
then
if [ "$2" ]
then
@ -51,44 +50,27 @@ then
ZIPFILE=$VERSION-patch-r$PATCHREV-r$REVISION.zip
else
echo "Missing base revision number. Usage: build.sh patch <base rev>"
echo "Missing base revision number. $SYNTAX"
exit 1
fi
fi
# Make release directory.
mkdir -p $RELEASEDIR
# Compile plugin.
make
# Check if the plugin is built.
if [ ! -e $BUILDDIR/$PLUGINFILE ]
then
echo "Cannot build release package, plugin build failed. Missing file '$BUILDDIR/$PLUGINFILE'."
echo "Cannot build release package, plugin build failed. Missing file $BUILDDIR/$PLUGINFILE."
exit 1
fi
# Rebuild hgversion.h.inc for unofficial builds.
sh updateversion.sh --unofficial
# Copy files.
echo "Copying documentation..."
mkdir -p $DOCS_DEST
cp -r $DOCS $DOCS_DEST
echo "Copying plugin binary..."
mkdir -p $PLUGINDIR
cp -r $BUILDDIR/$PLUGINFILE $PLUGINDIR/$PLUGINFILE
echo "Copying plugin source code..."
mkdir -p $SOURCE_DEST
cp -r $SOURCEDIR $SOURCE_DEST
if [ $MAKEPATCH = "false" ]
then
# Copy all files.
@ -100,6 +82,9 @@ then
cp $ZRTOOLS_SOURCE/zrtools.ext.so $EXTENSIONDIR
cp $ZRTOOLS_SOURCE/zrtools.ext.dll $EXTENSIONDIR
else
# Make diff file with changes since base revision.
sh changes.sh $PATCHREV "tip"
# Copy only changed files.
CHANGEDFILES=$(hg status --rev $PATCHREV | grep "cstrike/" | cut -d ' ' -f2 | cut -d '/' -f2-)
@ -109,6 +94,18 @@ else
cd ..
fi
# Copy files.
echo "Copying plugin binary..."
mkdir -p $PLUGINDIR
cp -r $BUILDDIR/$PLUGINFILE $PLUGINDIR/$PLUGINFILE
echo "Copying plugin source code..."
mkdir -p $SOURCE_DEST
cp -r $SOURCEDIR $SOURCE_DEST
echo "Copying documentation..."
mkdir -p $DOCS_DEST
cp -r $DOCS $DOCS_DEST
# Make release package.
echo "Compressing files..."

21
changes.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/sh
SYNTAX="Usage: $0 <base rev> <target rev>"
if [ "$1" ]
then
BASEREV="$1"
if [ "$2" ]
then
TARGETREV="$2"
else
echo "Missing target revision. $SYNTAX"
exit 1
fi
else
echo "$SYNTAX"
exit 1
fi
hg diff -r $BASEREV -r $TARGETREV cstrike/cfg/* cstrike/addons/sourcemod/* > docs/changes.diff