Skip to content

Commit

Permalink
build with Unity2018
Browse files Browse the repository at this point in the history
  • Loading branch information
noodle1983 committed Nov 29, 2018
1 parent 0f7483c commit 698ffdb
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions build_demo_apk_2018.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
rem global
SET UnityBin="C:\Program Files\Unity2018.2.11f1\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
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
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
if not exist "%ProjectPath%\AndroidGradleProject\Test\src\main\bin\com.test.test.apk" (
echo "Build Failed! Please Rerun %ProjectPath%\AndroidGradleProject\Test\src\main\build_apk.bat to check the error."
exit -1
)

copy /Y %ProjectPath%\AndroidGradleProject\Test\src\main\bin\com.test.test.apk %ScriptPath%\Il2cppDemo_com.test.test.apk
echo "Done!"
exit 0

0 comments on commit 698ffdb

Please sign in to comment.