-
Notifications
You must be signed in to change notification settings - Fork 150
/
build_demo_apk_2018.cmd
56 lines (47 loc) · 2.3 KB
/
build_demo_apk_2018.cmd
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
rem global
SET UnityBin="C:\Program Files\Unity\Hub\Editor\2018.4.29f1\Editor\Unity.exe"
rem prepare build cmd
SET ScriptPath=%~dp0
SET ScriptPath=%ScriptPath:~0,-1%
SET ProjectPath=%ScriptPath%
SET BuildCmd=%UnityBin% -quit -buildTarget android -batchmode -projectPath "%ProjectPath%"
rem ==========================================================================================
rem build version1 patch
rem ==========================================================================================
@echo "start to build version1"
cd %ProjectPath%
git checkout version1
del %ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version1.zip
%BuildCmd% -executeMethod AndroidBuilder.BuildPatch -logFile build_version1.log
if not exist "%ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version1.zip" (
echo "Build Version1 Failed!"
pause
exit -1
)
rem ==========================================================================================
rem build version2 patch
rem ==========================================================================================
@echo "start to build version2"
cd %ProjectPath%
git checkout version2
del %ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version2.zip
%BuildCmd% -executeMethod AndroidBuilder.BuildPatch -logFile build_version2.log
if not exist "%ProjectPath%\Assets\AndroidIl2cppPatchDemo\PrebuiltPatches\AllAndroidPatchFiles_Version2.zip" (
echo "Build Version2 Failed!"
pause
exit -1
)
rem ==========================================================================================
rem build base apk
rem ==========================================================================================
@echo "start to build base version apk"
cd %ProjectPath%
git checkout master
%BuildCmd% -executeMethod AndroidBuilder.BuildWithoutPatch -logFile build_version0.log
if not exist "%ProjectPath%\AndroidGradleProject_v1.0\Test\src\main\bin\com.test.test.apk" (
echo "Build Failed! Please Rerun %ProjectPath%\AndroidGradleProject_v1.0\Test\src\main\build_apk.bat to check the error."
exit -1
)
copy /Y %ProjectPath%\AndroidGradleProject_v1.0\Test\src\main\bin\com.test.test.apk %ScriptPath%\Il2cppDemo_com.test.test.apk
echo "Done!"
exit 0