Skip to content

Commit 9ac651f

Browse files
author
Andrew Longhorn
committed
add unity packaging
1 parent e4aae74 commit 9ac651f

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

Allow2.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ EndProject
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF0C5566-7FFC-4BDE-A78C-55694F732A0F}"
77
ProjectSection(SolutionItems) = preProject
88
LICENSE = LICENSE
9+
package.json = package.json
10+
package.sh = package.sh
911
EndProjectSection
1012
EndProject
1113
Global
File renamed without changes.

package.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh -eu
2+
3+
Configuration="Release"
4+
if [ $# -lt 1 ]; then
5+
echo "Need path to Unity"
6+
exit 1
7+
fi
8+
9+
if [ $# -gt 1 ]; then
10+
case x"$2" in
11+
xdebug | xDebug)
12+
Configuration="Debug"
13+
;;
14+
esac
15+
fi
16+
17+
pushd unity/PackageProject/Assets
18+
git clean -xdf
19+
popd
20+
21+
pushd src
22+
git clean -xdf
23+
popd
24+
25+
OS="Mac"
26+
if [ -e "c:\\" ]; then
27+
OS="Windows"
28+
fi
29+
30+
if [ x"$OS" == x"Windows" ]; then
31+
if [ -f "$1/Editor/Unity.exe" ]; then
32+
Unity="$1/Editor/Unity.exe"
33+
else
34+
echo "Can't find Unity in $1"
35+
exit 1
36+
fi
37+
else
38+
if [ -f "$1/Unity.app/Contents/MacOS/Unity" ]; then
39+
Unity="$1/Unity.app/Contents/MacOS/Unity"
40+
elif [ -f "$1/Unity" ]; then
41+
Unity="$1/Unity"
42+
else
43+
echo "Can't find Unity in $1"
44+
exit 1
45+
fi
46+
fi
47+
48+
if [ x"$OS" == x"Windows" ]; then
49+
common/nuget restore Allow2.sln
50+
else
51+
nuget restore Allow2.sln
52+
fi
53+
54+
xbuild Allow2.sln /property:Configuration=$Configuration
55+
56+
Version=`sed -En 's,.*Version = "(.*)".*,\1,p' common/SolutionInfo.cs`
57+
commitcount=`git rev-list --count HEAD`
58+
commit=`git log -n1 --pretty=format:%h`
59+
Version="${Version}.${commitcount}-${commit}"
60+
Version=$Version
61+
export ALLOW22_DISABLE=1
62+
"$Unity" -batchmode -projectPath "`pwd`/unity/PackageProject" -exportPackage Assets/Plugins/Allow2 allow2-for-unity-$Version.unitypackage -force-free -quit

0 commit comments

Comments
 (0)