-
Notifications
You must be signed in to change notification settings - Fork 150
/
build_demo_apk_2020.3.cmd
60 lines (51 loc) · 2.44 KB
/
build_demo_apk_2020.3.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
57
58
59
60
rem global
SET UnityBin="C:\Program Files\Unity\Hub\Editor\2020.3.30f1c1\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 2020_3_version1 patch
rem ==========================================================================================
@echo "start to build 2020_3_version1"
cd %ProjectPath%
git stash
git reset HEAD --hard
git checkout 2020_3_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 2020_3_version1 Failed!"
pause
exit -1
)
rem ==========================================================================================
rem build 2020_3_version2 patch
rem ==========================================================================================
@echo "start to build 2020_3_version2"
cd %ProjectPath%
git reset HEAD --hard
git checkout 2020_3_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 2020_3_version2 Failed!"
pause
exit -1
)
rem ==========================================================================================
rem build base apk
rem ==========================================================================================
@echo "start to build base version apk"
cd %ProjectPath%
git reset HEAD --hard
git checkout 2020_3_base
%BuildCmd% -executeMethod AndroidBuilder.BuildWithoutPatch -logFile build_version0.log
if not exist "%ProjectPath%\AndroidGradleProject_v1.0\cn.noodle1983.unitypatchdemo.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\cn.noodle1983.unitypatchdemo.apk %ScriptPath%\Il2cppDemo_com.test.test.apk
echo "Done!"
exit 0