Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit cfcfdf3

Browse files
authored
Merge pull request #128 from github-for-unity/features/cmd-scripts-from-shell-scripts
Build/Package Scripts for Windows
2 parents 9306619 + 55db2d7 commit cfcfdf3

File tree

2 files changed

+105
-2
lines changed

2 files changed

+105
-2
lines changed

build.cmd

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@echo off
2+
setlocal
3+
4+
set Configuration=dev
5+
if not %1.==. (
6+
set Configuration=%1
7+
)
8+
9+
set Target=Build
10+
if not %2.==. (
11+
set Target=%2
12+
)
13+
14+
if %Target%==Rebuild (
15+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.dll
16+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.mdb
17+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.pdb
18+
19+
if exist "..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub" (
20+
del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.dll
21+
del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.mdb
22+
del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.pdb
23+
)
24+
)
25+
26+
call common\nuget.exe restore GitHub.Unity.sln
27+
echo xbuild GitHub.Unity.sln /verbosity:normal /property:Configuration=%Configuration% /target:%Target%
28+
call xbuild GitHub.Unity.sln /verbosity:normal /property:Configuration=%Configuration% /target:%Target%
29+
30+
echo xcopy /C /H /R /S /Y /Q unity\PackageProject\Assets\Editor\GitHub ..\github-unity-test\GitHubExtensionProject\Assets\Editor
31+
call xcopy /C /H /R /S /Y /Q unity\PackageProject\Assets\Editor\GitHub ..\github-unity-test\GitHubExtensionProject\Assets\Editor
32+
33+
del /Q unity\PackageProject\Assets\Editor\GitHub\deleteme*
34+
del /Q unity\PackageProject\Assets\Editor\GitHub\deleteme*
35+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.xml
36+
37+
if exist ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub (
38+
del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\deleteme*
39+
del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\deleteme*
40+
del /Q ..\github-unity-test\GitHubExtensionProject\Assets\Editor\GitHub\*.xml
41+
)

package.cmd

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
1-
set GITHUB_UNITY_DISABLE=1
2-
%1\Unity.exe -batchmode -projectPath %~dp0unity\PackageProject -exportPackage Assets\Editor\GitHub github-for-unity-windows.unitypackage -force-free -quit
1+
@echo off
2+
setlocal
3+
4+
set Configuration=Release
5+
6+
if %1.==. (
7+
echo Need path to Unity
8+
exit /b 1
9+
)
10+
11+
set UnityPath=%1
12+
set UnityPath=%UnityPath:"=%
13+
14+
set ChangeConfigurationToDebug=0
15+
16+
if "%2"=="debug" (
17+
set ChangeConfigurationToDebug=1
18+
)
19+
20+
if "%2"=="Debug" (
21+
set ChangeConfigurationToDebug=1
22+
)
23+
24+
if %ChangeConfigurationToDebug%==1 (
25+
set Configuration=Debug
26+
)
27+
28+
set Unity=%UnityPath%\Editor\Unity.exe
29+
if not exist "%Unity%" (
30+
echo Cannot find Unity at %Unity%
31+
exit /b 1
32+
) else (
33+
cd unity\PackageProject\Assets
34+
call git clean -xdf
35+
cd ..\..\..
36+
37+
cd src
38+
call git clean -xdf
39+
cd ..
40+
41+
call common\nuget.exe restore GitHub.Unity.sln
42+
echo xbuild GitHub.Unity.sln /property:Configuration=%Configuration%
43+
call xbuild GitHub.Unity.sln /property:Configuration=%Configuration%
44+
45+
del /Q unity\PackageProject\Assets\Editor\GitHub\deleteme*
46+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.pdb
47+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.pdb.meta
48+
del /Q unity\PackageProject\Assets\Editor\GitHub\*.xml
49+
50+
for /f tokens^=^2^ usebackq^ delims^=^" %%G in (`find "const string Version" common\SolutionInfo.cs`) do call :Package %%G
51+
52+
goto End
53+
54+
:Package
55+
set Version=%1
56+
set GITHUB_UNITY_DISABLE=1
57+
echo "%Unity%" -batchmode -projectPath "%~dp0unity\PackageProject" -exportPackage Assets/Editor/GitHub github-for-unity-%Version%-alpha.unitypackage -force-free -quit
58+
call "%Unity%" -batchmode -projectPath "%~dp0unity\PackageProject" -exportPackage Assets/Editor/GitHub github-for-unity-%Version%-alpha.unitypackage -force-free -quit
59+
goto:eof
60+
61+
:End
62+
echo Completed
63+
)
64+
endlocal

0 commit comments

Comments
 (0)