forked from Unity-Technologies/Git-for-Unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-packages.sh
83 lines (71 loc) · 1.69 KB
/
create-packages.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh -eu
{ set +x; } 2>/dev/null
SOURCE="${BASH_SOURCE[0]}"
DIR="$( cd -P "$( dirname "$SOURCE" )"/.. >/dev/null 2>&1 && pwd )"
FLAGS=""
PARAMS=""
OUTDIR="$DIR/artifacts"
BUILDDIR="$DIR/build/packages"
SRCDIR="$DIR/src"
SCRIPTDIR="$DIR/packaging/create-unity-packages"
TMPDIR=""
VERSION=""
RM="rm -rf"
while (( "$#" )); do
case "$1" in
-v|--version)
VERSION="$2"
shift 2
;;
-t|--tmp)
TMPDIR="$2"
shift 2
;;
-u|--skipUnity)
FLAGS="$FLAGS $1"
shift
;;
-p|--skipPackman)
FLAGS="$FLAGS $1"
shift
;;
-m|--skipUpm)
FLAGS="$FLAGS $1"
shift
;;
--) # end argument parsing
shift
break
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done
if [[ x"$VERSION" == x"" ]]; then
echo "-v|--version argument missing"
exit -1
fi
if [[ x"$TMPDIR" == x"" ]]; then
TMPDIR="$DIR/obj"
fi
if [[ -e "$TMPDIR" ]]; then
$RM "$TMPDIR"
fi
# set positional arguments in their proper place
eval set -- "$PARAMS"
PKGNAME="com.unity.git.api"
PKGSRCDIR="$BUILDDIR/$PKGNAME"
IGNOREFILE="$DIR/src/$PKGNAME/.npmignore"
BASEINSTALL="Packages/$PKGNAME"
"$SCRIPTDIR/run.sh" -s "$PKGSRCDIR" -o "$OUTDIR" -n "$PKGNAME" -v "$VERSION" -i "$IGNOREFILE" -t "$BASEINSTALL" --tmp "$TMPDIR" "$FLAGS"
PKGNAME="com.unity.git.ui"
PKGSRCDIR="$BUILDDIR/$PKGNAME"
IGNOREFILE="$DIR/src/$PKGNAME/.npmignore"
BASEINSTALL="Packages/$PKGNAME"
"$SCRIPTDIR/run.sh" -s "$PKGSRCDIR" -o "$OUTDIR" -n "$PKGNAME" -v "$VERSION" -i "$IGNOREFILE" -t "$BASEINSTALL" --tmp "$TMPDIR" "$FLAGS"