forked from github-for-unity/Unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.cmd
64 lines (49 loc) · 1.59 KB
/
package.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
61
62
63
64
@echo off
setlocal
set Configuration=Release
if %1.==. (
echo Need path to Unity
exit /b 1
)
set UnityPath=%1
set UnityPath=%UnityPath:"=%
set ChangeConfigurationToDebug=0
if "%2"=="debug" (
set ChangeConfigurationToDebug=1
)
if "%2"=="Debug" (
set ChangeConfigurationToDebug=1
)
if %ChangeConfigurationToDebug%==1 (
set Configuration=Debug
)
set Unity=%UnityPath%\Editor\Unity.exe
if not exist "%Unity%" (
echo Cannot find Unity at %Unity%
exit /b 1
) else (
cd unity\PackageProject\Assets
call git clean -xdf
cd ..\..\..
cd src
call git clean -xdf
cd ..
call common\nuget.exe restore GitHub.Unity.sln
echo xbuild GitHub.Unity.sln /property:Configuration=%Configuration%
call xbuild GitHub.Unity.sln /property:Configuration=%Configuration%
del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\deleteme*
del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.pdb
del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.pdb.meta
del /Q unity\PackageProject\Assets\Plugins\GitHub\Editor\*.xml
for /f tokens^=^2^ usebackq^ delims^=^" %%G in (`find "const string GitHubForUnityVersion" common\SolutionInfo.cs`) do call :Package %%G
goto End
:Package
set Version=%1
set GITHUB_UNITY_DISABLE=1
echo "%Unity%" -batchmode -projectPath "%~dp0unity\PackageProject" -exportPackage Assets/Editor/GitHub github-for-unity-%Version%-alpha.unitypackage -force-free -quit
call "%Unity%" -batchmode -projectPath "%~dp0unity\PackageProject" -exportPackage Assets/Editor/GitHub github-for-unity-%Version%-alpha.unitypackage -force-free -quit
goto:eof
:End
echo Completed
)
endlocal