forked from nkast/MonoGame
-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
default.build
212 lines (146 loc) · 13.1 KB
/
default.build
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?xml version="1.0"?>
<project name="KNI Build Script" default="build" basedir=".">
<description>The KNI automated build script.</description>
<property name="os" value="${operating-system::get-platform(environment::get-operating-system())}" />
<property name="msbuild17" value="C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\msbuild.exe" />
<property name="nugetPath" value="C:\Program Files (x86)\NuGet3\nuget.exe" />
<property name="nugetPackageVersion" value="3.14.9001" />
<!-- Helper default target. -->
<target name="build"
description="Build, run tests, generate docs, and create installers."
depends="_clean,build_code,build_nuget,run_tests,build_docs,build_installer" />
<!-- Clean the build output directories. -->
<target name="_clean">
<delete dir="${project::get-base-directory()}\Artifacts" />
<delete dir="${project::get-base-directory()}\Platforms\obj" />
<exec program="dotnet" commandline="build src\Xna.Framework\Xna.Framework.csproj /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Content\Xna.Framework.Content.csproj /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Graphics\Xna.Framework.Graphics.csproj /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Audio\Xna.Framework.Audio.csproj /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Media\Xna.Framework.Media.csproj /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Design\Xna.Framework.Design.csproj /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build XNA.Framework.Blazor.sln /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build XNA.Framework.WindowsDX11.sln /t:Clean /p:Configuration=Release" />
<exec program="${msbuild17}" commandline='XNA.Framework.UAP.sln /t:Clean /p:Configuration=Release /p:Platform="Any CPU"' />
<exec program="dotnet" commandline="build XNA.Framework.DesktopGL.sln /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build XNA.Framework.Android.sln /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build XNA.Framework.Cardboard.sln /t:Clean /p:Configuration=Release" />
<exec program="dotnet" commandline="build XNA.Framework.iOS.sln /t:Clean /p:Configuration=Release" />
<exec program="${msbuild17}" commandline="XNA.Framework.Android.Xamarin.sln /t:Clean /p:Configuration=Release" />
<exec program="${msbuild17}" commandline="XNA.Framework.iOS.Xamarin.sln /t:Clean /p:Configuration=Release" />
</target>
<!-- Shortcut for building all valid target platforms -->
<target name="build_code" description="Build all the projects.">
<call target="build_framework"/>
<call target="build_ref"/>
<call target="build_blazorGL" />
<call target="build_windows"/>
<call target="build_windowsUAP10" />
<call target="build_desktopGL"/>
<call target="build_android" />
<call target="build_cardboard" />
<call target="build_ios" />
</target>
<target name="build_nuget" description="Build nuget packages.">
<!-- <exec program="BuildNuget.bat" commandline="" /> -->
<exec program="dotnet" commandline="pack src\Xna.Framework\Xna.Framework.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack src\Xna.Framework.Design\Xna.Framework.Design.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack Platforms\Xna.Framework.Ref.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack src\Xna.Framework.Content.Pipeline\Xna.Framework.Content.Pipeline.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack src\Xna.Framework.Content.Pipeline.Audio\Xna.Framework.Content.Pipeline.Audio.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack src\Xna.Framework.Content.Pipeline.Graphics\Xna.Framework.Content.Pipeline.Graphics.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack src\Xna.Framework.Content.Pipeline.Media\Xna.Framework.Content.Pipeline.Media.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="${nugetPath}" commandline="pack NuGetPackages/Content.Pipeline.Builder.nuspec -OutputDirectory ${project::get-base-directory()}\Artifacts\Packages\ -BasePath . -Version ${nugetPackageVersion} -Properties Configuration=Release" />
<exec program="${nugetPath}" commandline="pack NuGetPackages/Content.Pipeline.Builder.Windows.nuspec -OutputDirectory ${project::get-base-directory()}\Artifacts\Packages\ -BasePath . -Version ${nugetPackageVersion} -Properties Configuration=Release" />
<exec program="${nugetPath}" commandline="pack NuGetPackages/MonoGame.Framework.WindowsUniversal.nuspec -OutputDirectory ${project::get-base-directory()}\Artifacts\Packages\ -BasePath . -Version ${nugetPackageVersion} -Properties Configuration=Release" />
<exec program="${nugetPath}" commandline="pack NuGetPackages/MonoGame.Framework.Android.nuspec -OutputDirectory ${project::get-base-directory()}\Artifacts\Packages\ -BasePath . -Version ${nugetPackageVersion} -Properties Configuration=Release" />
<exec program="${nugetPath}" commandline="pack NuGetPackages/MonoGame.Framework.iOS.nuspec -OutputDirectory ${project::get-base-directory()}\Artifacts\Packages\ -BasePath . -Version ${nugetPackageVersion} -Properties Configuration=Release" />
<exec program="dotnet" commandline="pack Platforms\Xna.Framework.WindowsDX11.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack Platforms\Xna.Framework.DesktopGL.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack XNA.Framework.Blazor.sln --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack Platforms\XNA.Framework.Oculus.OvrDX11.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="pack Platforms\Xna.Framework.Cardboard.csproj --output ${project::get-base-directory()}\Artifacts\Packages\ /t:Build /p:Configuration=Release" />
</target>
<!-- Build targets for the various platforms. -->
<target name="build_framework" description="Build framework">
<exec program="dotnet" commandline="build src\Xna.Framework\Xna.Framework.csproj /t:restore" />
<exec program="dotnet" commandline="build src\Xna.Framework.Content\Xna.Framework.Content.csproj /t:restore" />
<exec program="dotnet" commandline="build src\Xna.Framework.Graphics\Xna.Framework.Graphics.csproj /t:restore" />
<exec program="dotnet" commandline="build src\Xna.Framework.Audio\Xna.Framework.Audio.csproj /t:restore" />
<exec program="dotnet" commandline="build src\Xna.Framework.Media\Xna.Framework.Media.csproj /t:restore" />
<exec program="dotnet" commandline="build src\Xna.Framework\Xna.Framework.csproj /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Content\Xna.Framework.Content.csproj /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Graphics\Xna.Framework.Graphics.csproj /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Audio\Xna.Framework.Audio.csproj /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline="build src\Xna.Framework.Media\Xna.Framework.Media.csproj /t:Build /p:Configuration=Release" />
</target>
<target name="build_ref" description="Build reference">
<exec program="dotnet" commandline="build Platforms\Xna.Framework.Ref.csproj /t:restore" />
<exec program="dotnet" commandline="build Platforms\Xna.Framework.Ref.csproj /t:Build /p:Configuration=Release" />
</target>
<target name="build_blazorGL" description="Build BlazorGL">
<exec program="dotnet" commandline="build XNA.Framework.Blazor.sln /t:restore" />
<exec program="dotnet" commandline="build XNA.Framework.Blazor.sln /t:Build /p:Configuration=Release" />
</target>
<target name="build_windows" description="Build Windows">
<exec program="dotnet" commandline="build XNA.Framework.WindowsDX11.sln /t:restore" />
<exec program="dotnet" commandline="build XNA.Framework.WindowsDX11.sln /t:Build /p:Configuration=Release /m" />
</target>
<target name="build_desktopGL" description="Build DesktopGL">
<exec program="dotnet" commandline="build Platforms\XNA.Framework.DesktopGL.csproj /t:restore" />
<exec program="dotnet" commandline="build Platforms\XNA.Framework.DesktopGL.csproj /t:Build /p:Configuration=Release" />
</target>
<target name="build_ios" description="Build iOS">
<!--
<if test="${os == 'MacOS'}">
<if test="${file::exists('/Developer/MonoTouch/MSBuild/Xamarin.ObjcBinding.CSharp.targets')
or file::exists('/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.CSharp.targets')}">
<exec program="msbuild" commandline="XNA.Framework.Xamarin.iOS.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild" commandline="XNA.Framework.Xamarin.iOS.sln /t:Build /p:Configuration=Release" />
</if>
</if>
-->
<exec program="${msbuild17}" commandline="XNA.Framework.iOS.Xamarin.sln /t:restore" />
<exec program="${msbuild17}" commandline="XNA.Framework.iOS.Xamarin.sln /t:Build /p:Configuration=Release" />
<exec program="dotnet" commandline='build XNA.Framework.iOS.sln /t:Restore /p:Configuration=Release' />
<exec program="dotnet" commandline='build XNA.Framework.iOS.sln /t:Build /p:Configuration=Release' />
</target>
<target name="build_android" description="Build Android">
<if test="${file::exists('C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Novell\Novell.MonoDroid.CSharp.targets')}">
<exec program="${msbuild17}" commandline="XNA.Framework.Android.Xamarin.sln /t:Build /p:Configuration=Release" />
</if>
<exec program="dotnet" commandline='build XNA.Framework.Android.sln /t:Restore /p:Configuration=Release' />
<exec program="dotnet" commandline='build XNA.Framework.Android.sln /t:Build /p:Configuration=Release' />
</target>
<target name="build_cardboard" description="Build Cardboard">
<exec program="dotnet" commandline='build XNA.Framework.Cardboard.sln /t:Restore /p:Configuration=Release' />
<exec program="dotnet" commandline='build XNA.Framework.Cardboard.sln /t:Build /p:Configuration=Release' />
</target>
<target name="build_windowsUAP10" description="Build Windows 10 UAP">
<!--
<exec program="${msbuild17}" commandline='Platforms\XNA.Framework.UAP.csproj /t:Restore /p:Configuration=Release' />
<exec program="${msbuild17}" commandline='Platforms\XNA.Framework.UAP.csproj /p:Configuration=Release' />
-->
<exec program="${msbuild17}" commandline='XNA.Framework.UAP.sln /t:Restore /p:Configuration=Release' />
<exec program="${msbuild17}" commandline='XNA.Framework.UAP.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU"' />
</target>
<!-- Run the unit tests... will fail if the code hasn't been built. -->
<target name="run_tests" description="Run all the tests" >
<if test="${os == 'Win32NT' and '$rununittests'=='true' }">
<exec program="Kni.Tests.exe" workingdir="Tests/bin/WindowsDX11/AnyCPU/Release/net472/" basedir="Tests/bin/WindowsDX11/AnyCPU/Release/net472/"/>
</if>
</target>
<!-- Generate the docs... will fail if the code hasn't been built. -->
<target name="build_docs" description="Build the documentation." >
<if test="${os == 'Win32NT' and '$runbuilddocs'=='true' }">
<delete dir="${project::get-base-directory()}\Documentation\Output" />
<exec program="SharpDoc.exe" basedir="ThirdParty\Dependencies\SharpDoc" commandline="-config Documentation\config.xml" />
</if>
</target>
<!-- Create the installers... will fail if the code hasn't been built. -->
<target name="build_installer" description="Build the installers." >
<nant buildfile="Templates/VisualStudio2022/default.build" target="build" />
<nant buildfile="Templates/default.build" target="build" />
<nant buildfile="Installers/default.build" target="build" />
</target>
</project>