Added script that dump changes in configs. Minior cleanup in build script.
This commit is contained in:
parent
40463b718a
commit
7c5db80cc7
45
build.sh
45
build.sh
@ -3,6 +3,8 @@
|
|||||||
VERSION="zombiereloaded-3.0-b2"
|
VERSION="zombiereloaded-3.0-b2"
|
||||||
REVISION=$(hg id -n)
|
REVISION=$(hg id -n)
|
||||||
|
|
||||||
|
SYNTAX="Usage: $0 [--patch <base rev>]"
|
||||||
|
|
||||||
# Source paths
|
# Source paths
|
||||||
BUILDDIR=build
|
BUILDDIR=build
|
||||||
PLUGINFILE=zombiereloaded.smx
|
PLUGINFILE=zombiereloaded.smx
|
||||||
@ -21,22 +23,19 @@ ZIPFILE=$VERSION-r$REVISION.zip
|
|||||||
|
|
||||||
MAKEPATCH=false
|
MAKEPATCH=false
|
||||||
|
|
||||||
|
|
||||||
# Clean build and release directory.
|
# Clean build and release directory.
|
||||||
make clean
|
make clean
|
||||||
rm -rf $RELEASEDIR
|
rm -rf $RELEASEDIR
|
||||||
echo "Cleaned build and release directory."
|
echo "Cleaned build and release directory."
|
||||||
|
|
||||||
|
|
||||||
# Exit if cleaning only.
|
# Exit if cleaning only.
|
||||||
if [ "$1" = "clean" ]
|
if [ "$1" = "--clean" ]
|
||||||
then
|
then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check if patch mode is enabled.
|
# Check if patch mode is enabled.
|
||||||
if [ "$1" = "patch" ]
|
if [ "$1" = "--patch" ]
|
||||||
then
|
then
|
||||||
if [ "$2" ]
|
if [ "$2" ]
|
||||||
then
|
then
|
||||||
@ -51,44 +50,27 @@ then
|
|||||||
|
|
||||||
ZIPFILE=$VERSION-patch-r$PATCHREV-r$REVISION.zip
|
ZIPFILE=$VERSION-patch-r$PATCHREV-r$REVISION.zip
|
||||||
else
|
else
|
||||||
echo "Missing base revision number. Usage: build.sh patch <base rev>"
|
echo "Missing base revision number. $SYNTAX"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Make release directory.
|
# Make release directory.
|
||||||
mkdir -p $RELEASEDIR
|
mkdir -p $RELEASEDIR
|
||||||
|
|
||||||
|
|
||||||
# Compile plugin.
|
# Compile plugin.
|
||||||
make
|
make
|
||||||
|
|
||||||
|
|
||||||
# Check if the plugin is built.
|
# Check if the plugin is built.
|
||||||
if [ ! -e $BUILDDIR/$PLUGINFILE ]
|
if [ ! -e $BUILDDIR/$PLUGINFILE ]
|
||||||
then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Rebuild hgversion.h.inc for unofficial builds.
|
# Rebuild hgversion.h.inc for unofficial builds.
|
||||||
sh updateversion.sh --unofficial
|
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" ]
|
if [ $MAKEPATCH = "false" ]
|
||||||
then
|
then
|
||||||
# Copy all files.
|
# Copy all files.
|
||||||
@ -100,6 +82,9 @@ then
|
|||||||
cp $ZRTOOLS_SOURCE/zrtools.ext.so $EXTENSIONDIR
|
cp $ZRTOOLS_SOURCE/zrtools.ext.so $EXTENSIONDIR
|
||||||
cp $ZRTOOLS_SOURCE/zrtools.ext.dll $EXTENSIONDIR
|
cp $ZRTOOLS_SOURCE/zrtools.ext.dll $EXTENSIONDIR
|
||||||
else
|
else
|
||||||
|
# Make diff file with changes since base revision.
|
||||||
|
sh changes.sh $PATCHREV "tip"
|
||||||
|
|
||||||
# Copy only changed files.
|
# Copy only changed files.
|
||||||
CHANGEDFILES=$(hg status --rev $PATCHREV | grep "cstrike/" | cut -d ' ' -f2 | cut -d '/' -f2-)
|
CHANGEDFILES=$(hg status --rev $PATCHREV | grep "cstrike/" | cut -d ' ' -f2 | cut -d '/' -f2-)
|
||||||
|
|
||||||
@ -109,6 +94,18 @@ else
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
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.
|
# Make release package.
|
||||||
echo "Compressing files..."
|
echo "Compressing files..."
|
||||||
|
21
changes.sh
Normal file
21
changes.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user