Skip to content

Commit 698ffdb

Browse files
committed
build with Unity2018
1 parent 0f7483c commit 698ffdb

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

build_demo_apk_2018.cmd

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
rem global
2+
SET UnityBin="C:\Program Files\Unity2018.2.11f1\Editor\Unity.exe"
3+
4+
rem prepare build cmd
5+
SET ScriptPath=%~dp0
6+
SET ScriptPath=%ScriptPath:~0,-1%
7+
8+
SET ProjectPath=%ScriptPath%
9+
SET BuildCmd=%UnityBin% -quit -buildTarget android -batchmode -projectPath "%ProjectPath%"
10+
11+
rem ==========================================================================================
12+
rem build version1 patch
13+
rem ==========================================================================================
14+
@echo "start to build version1"
15+
16+
cd %ProjectPath%
17+
git checkout version1
18+
del %ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version1.zip
19+
%BuildCmd% -executeMethod AndroidBuilder.BuildPatch
20+
if not exist "%ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version1.zip" (
21+
echo "Build Version1 Failed!"
22+
pause
23+
exit -1
24+
)
25+
26+
rem ==========================================================================================
27+
rem build version2 patch
28+
rem ==========================================================================================
29+
@echo "start to build version2"
30+
31+
cd %ProjectPath%
32+
git checkout version2
33+
del %ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version2.zip
34+
%BuildCmd% -executeMethod AndroidBuilder.BuildPatch
35+
if not exist "%ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version2.zip" (
36+
echo "Build Version2 Failed!"
37+
pause
38+
exit -1
39+
)
40+
41+
rem ==========================================================================================
42+
rem build base apk
43+
rem ==========================================================================================
44+
@echo "start to build base version apk"
45+
46+
cd %ProjectPath%
47+
git checkout master
48+
%BuildCmd% -executeMethod AndroidBuilder.BuildWithoutPatch
49+
if not exist "%ProjectPath%\AndroidGradleProject\Test\src\main\bin\com.test.test.apk" (
50+
echo "Build Failed! Please Rerun %ProjectPath%\AndroidGradleProject\Test\src\main\build_apk.bat to check the error."
51+
exit -1
52+
)
53+
54+
copy /Y %ProjectPath%\AndroidGradleProject\Test\src\main\bin\com.test.test.apk %ScriptPath%\Il2cppDemo_com.test.test.apk
55+
echo "Done!"
56+
exit 0

0 commit comments

Comments
 (0)