Add archive and install-binary script

This commit is contained in:
toshi0383
2018-02-25 17:28:36 +09:00
parent 98c0514c43
commit b939c60877
3 changed files with 41 additions and 0 deletions
+6
View File
@@ -41,3 +41,9 @@ release: format_code
git add .
git commit -m "Update to $(VERSION)"
git tag $(VERSION)
install-binary:
./scripts/install.sh
archive: build
./scripts/archive.sh
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
TOOL_NAME=XcodeGen
TOOL_NAME_LOWER=xcodegen
TMP=$(mktemp -d)/$TOOL_NAME
BINDIR=$TMP/bin
SHAREDIR=$TMP/share
ZIPFILE=$TMP/$TOOL_NAME_LOWER.zip
INSTALLSH=scripts/install-binary.sh
mkdir -p $BINDIR
cp -f .build/release/$TOOL_NAME_LOWER $BINDIR
mkdir -p $SHAREDIR
cp -R SettingPresets $SHAREDIR/SettingPresets
sed -e 's/^BASE_DIR=.*/BASE_DIR=$(cd `dirname $0`; pwd)/' -e '/.*[zZ][iI][pP].*/d' $INSTALLSH \
> $TMP/install.sh
chmod +x $TMP/install.sh
(cd $TMP/..; zip -r $ZIPFILE $TOOL_NAME)
mv $ZIPFILE .
rm -rf $TMP
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
PREFIX=${1:-/usr/local}
### NOTE: Stripped or replaced by archive.sh from this line
ZIPFILE=xcodegen.zip
if [ ! -f $ZIPFILE ];then echo $ZIPFILE not found; exit 1; fi
unzip -o xcodegen.zip
BASE_DIR=XcodeGen
### to this line.
cp -r $BASE_DIR/share "${PREFIX}"
cp -r $BASE_DIR/bin "${PREFIX}"