forked from jsonfx/jsonfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.bat
101 lines (76 loc) · 4.34 KB
/
Build.bat
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
@ECHO off
PUSHD "%~dp0"
SET MSBuild=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
SET MSBuild35=%SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe
IF NOT EXIST "%MSBuild%" (
ECHO Installation of .NET Framework 4.0 is required to build this project, including .NET v2.0 and v3.5 releases
ECHO http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7
START /d "~\iexplore.exe" http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7
EXIT /b 1
GOTO END
)
REM Unit Tests ------------------------------------------------------
ECHO.
ECHO Building unit test pass...
ECHO.
"%MSBuild%" JsonFx.sln /target:rebuild /property:TargetFrameworkVersion=v4.0;Configuration=Release;RunTests=True
REM Standard CLR ----------------------------------------------------
IF NOT EXIST "keys\JsonFx_Key.pfx" (
SET Configuration=Release
) ELSE (
SET Configuration=Signed
)
SET FrameworkVer=v2.0 v3.5 v4.0
ECHO.
ECHO Building specific releases for .NET Framework (%FrameworkVer%)...
ECHO.
FOR %%i IN (%FrameworkVer%) DO "%MSBuild%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkVersion=%%i;Configuration=%Configuration%
REM .net 3.5 Compact Framework -----------------------------------------------------
IF EXIST "C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.CSharp.targets" (
"%MSBuild35%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkIdentifier=netcf;Configuration=%Configuration%
)
REM Silverlight -----------------------------------------------------
IF EXIST "%ProgramFiles%\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" (
SET SilverlightVer=%SilverlightVer% v3.5
)
IF EXIST "%ProgramFiles(x86)%\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" (
SET SilverlightVer=%SilverlightVer% v3.5
)
IF EXIST "%ProgramFiles%\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" (
SET SilverlightVer=%SilverlightVer% v4.0
)
IF EXIST "%ProgramFiles(x86)%\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" (
SET SilverlightVer=%SilverlightVer% v4.0
)
ECHO.
ECHO Building specific releases for Silverlight (%SilverlightVer%)...
ECHO.
FOR %%i IN (%SilverlightVer%) DO "%MSBuild%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkVersion=%%i;TargetFrameworkIdentifier=Silverlight;Configuration=%Configuration%
REM FOR %%i IN (%SilverlightVer%) DO "%MSBuild%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkVersion=%%i;TargetFrameworkIdentifier=Silverlight;Configuration=Debug
REM Windows Phone ---------------------------------------------------
IF EXIST "%ProgramFiles%\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.CSharp.targets" (
SET WindowsPhoneVer=%WindowsPhoneVer% v4.0
)
IF EXIST "%ProgramFiles(x86)%\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.CSharp.targets" (
SET WindowsPhoneVer=%WindowsPhoneVer% v4.0
)
ECHO.
ECHO Building specific releases for Windows Phone (%WindowsPhoneVer%)...
ECHO.
FOR %%i IN (%WindowsPhoneVer%) DO "%MSBuild%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkVersion=%%i;TargetFrameworkIdentifier=Silverlight;TargetFrameworkProfile=WindowsPhone;Configuration=%Configuration%
REM FOR %%i IN (%WindowsPhoneVer%) DO "%MSBuild%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkVersion=%%i;TargetFrameworkIdentifier=Silverlight;TargetFrameworkProfile=WindowsPhone;Configuration=Debug
REM http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Supporting_Multiple_.NET_Framework_Versions_and_Profiles
ECHO.
ECHO Copying files for packages...
xcopy build\%Configuration%_v4.0\*.* "packages\lib\net40\" /Y
xcopy build\%Configuration%_v3.5\*.* "packages\lib\net35\" /Y
xcopy build\%Configuration%_v2.0\*.* "packages\lib\net20\" /Y
xcopy build\%Configuration%_v3.5_netcf\*.* "packages\lib\netcf35\" /Y
xcopy build\%Configuration%_v3.5_Silverlight\*.* "packages\lib\sl35\" /Y
xcopy build\%Configuration%_v4.0_Silverlight\*.* "packages\lib\sl40\" /Y
xcopy build\%Configuration%_v4.0_WindowsPhone\*.* "packages\lib\sl40-wp\" /Y
ECHO.
ECHO Generating NuGet Package
NuGet.exe pack packages\Package.nuspec -o build\
:END
POPD