-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
workloads.csproj
224 lines (193 loc) · 13 KB
/
workloads.csproj
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
213
214
215
216
217
218
219
220
221
222
223
224
<Project DefaultTargets="Restore;Build">
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<MicrosoftDotNetBuildTasksInstallersTaskTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1</MicrosoftDotNetBuildTasksInstallersTaskTargetFramework>
<MicrosoftDotNetBuildTasksInstallersTaskTargetFramework Condition="'$(DotNetBuildFromSource)' == 'true'">net5.0</MicrosoftDotNetBuildTasksInstallersTaskTargetFramework>
<MicrosoftDotNetBuildTasksInstallersTaskTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">net472</MicrosoftDotNetBuildTasksInstallersTaskTargetFramework>
<MicrosoftDotNetBuildTasksInstallersTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersVersion)\tools\$(MicrosoftDotNetBuildTasksInstallersTaskTargetFramework)\Microsoft.DotNet.Build.Tasks.Installers.dll</MicrosoftDotNetBuildTasksInstallersTaskAssembly>
</PropertyGroup>
<UsingTask AssemblyFile="$(PkgMicrosoft_DotNet_Build_Tasks_Workloads)\tools\net472\Microsoft.DotNet.Build.Tasks.Workloads.dll" TaskName="GenerateManifestMsi" />
<UsingTask AssemblyFile="$(PkgMicrosoft_DotNet_Build_Tasks_Workloads)\tools\net472\Microsoft.DotNet.Build.Tasks.Workloads.dll" TaskName="GenerateVisualStudioWorkload" />
<UsingTask TaskName="GenerateMsiVersion" AssemblyFile="$(MicrosoftDotNetBuildTasksInstallersTaskAssembly)" />
<UsingTask TaskName="CreateLightCommandPackageDrop" AssemblyFile="$(MicrosoftDotNetBuildTasksInstallersTaskAssembly)" />
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IncludeBuildOutput>false</IncludeBuildOutput>
<WorkloadIntermediateOutputPath>$(ArtifactsObjDir)workloads/</WorkloadIntermediateOutputPath>
<WorkloadOutputPath>$(ArtifactsBinDir)workloads/</WorkloadOutputPath>
<WorkloadOutputPath Condition="'$(workloadArtifactsPath)' != ''">$(workloadArtifactsPath)/</WorkloadOutputPath>
<PackageSource>$(ArtifactsShippingPackagesDir)</PackageSource>
<PackageSource Condition="'$(workloadPackagesPath)' != ''">$(workloadPackagesPath)/</PackageSource>
</PropertyGroup>
<!-- Arcade -->
<PropertyGroup>
<!-- Temp directory for light command layouts -->
<LightCommandObjDir>$(ArtifactsObjDir)/LightCommandPackages</LightCommandObjDir>
<!-- Directory for the zipped up light command package -->
<LightCommandPackagesDir>$(ArtifactsNonShippingPackagesDir)</LightCommandPackagesDir>
</PropertyGroup>
<PropertyGroup>
<WixToolsetPath>$(PkgMicrosoft_Signed_Wix)\tools</WixToolsetPath>
<SwixPluginPath>$(PkgMicroBuild_Plugins_SwixBuild_Dotnet)</SwixPluginPath>
<SwixBuildTargets>$(SwixPluginPath)\build\MicroBuild.Plugins.SwixBuild.targets</SwixBuildTargets>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Workloads" Version="$(MicrosoftDotNetBuildTasksWorkloadsPackageVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Signed.WiX" Version="$(WixPackageVersion)" GeneratePathProperty="true" />
<PackageReference Include="MicroBuild.Plugins.SwixBuild.Dotnet" Version="$(SwixPackageVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" GeneratePathProperty="True" />
</ItemGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<Target Name="Build" DependsOnTargets="GetAssemblyVersion;_GetVersionProps;_GenerateMsiVersionString">
<ItemGroup>
<!-- Overrides for Visual Studio setup generation. If the workload definition IDs change,
these must be updated. -->
<ComponentResources Include="microsoft-net-runtime-mono-tooling" Title=".NET Shared Mobile Build Tools"
Description="Shared build tasks for mobile platform development."/>
<ComponentResources Include="wasm-tools" Title=".NET WebAssembly Build Tools"
Description="Build tools for WebAssembly ahead-of-time (AoT) compilation and native linking."/>
<ComponentResources Include="microsoft-net-runtime-android" Title=".NET Android Build Tools"
Description="Build tools for Android compilation and native linking."/>
<ComponentResources Include="microsoft-net-runtime-android-aot" Title=".NET Android Build Tools (AoT)"
Description="Build tools for Android ahead-of-time (AoT) compilation and native linking."/>
<ComponentResources Include="microsoft-net-runtime-ios" Title=".NET iOS Build Tools"
Description="Build tools for iOS compilation and native linking."/>
<ComponentResources Include="microsoft-net-runtime-tvos" Title=".NET tvOS Build Tools"
Description="Build tools for tvOS compilation and native linking."/>
<ComponentResources Include="microsoft-net-runtime-maccatalyst" Title=".NET Mac Catalyst Build Tools"
Description="Build tools for Mac Catalyst compilation and native linking."/>
<ComponentResources Include="runtimes-ios" Title=".NET iOS Runtimes"
Description=".NET runtime components for iOS execution."/>
<ComponentResources Include="runtimes-tvos" Title=".NET tvOS Build Tools"
Description=".NET runtime components for tvOS execution."/>
<ComponentResources Include="runtimes-maccatalyst" Title=".NET Mac Catalyst Build Tools"
Description=".NET runtime components for Mac Catalyst execution."/>
<!-- Visual Studio components must be versioned. Build tasks will fall back to cobbling a version number from
the manifest information unless it's overridden. -->
<ComponentVersions Include="microsoft-net-runtime-mono-tooling" Version="$(FileVersion)" />
<ComponentVersions Include="wasm-tools" Version="$(FileVersion)" />
<ComponentVersions Include="microsoft-net-runtime-android" Version="$(FileVersion)" />
<ComponentVersions Include="microsoft-net-runtime-android-aot" Version="$(FileVersion)" />
<ComponentVersions Include="microsoft-net-runtime-ios" Version="$(FileVersion)" />
<ComponentVersions Include="microsoft-net-runtime-tvos" Version="$(FileVersion)" />
<ComponentVersions Include="microsoft-net-runtime-maccatalyst" Version="$(FileVersion)" />
<ComponentVersions Include="runtimes-ios" Version="$(FileVersion)" />
<ComponentVersions Include="runtimes-tvos" Version="$(FileVersion)" />
<ComponentVersions Include="runtimes-maccatalyst" Version="$(FileVersion)" />
</ItemGroup>
<!-- BAR requires having version information in blobs -->
<PropertyGroup>
<VersionedVisualStudioSetupInsertionPath>$(VisualStudioSetupInsertionPath)$(SDKBundleVersion)\</VersionedVisualStudioSetupInsertionPath>
</PropertyGroup>
<!-- Shorten package names to avoid long path issues in Visual Studio -->
<ItemGroup>
<ShortNames Include="microsoft.netcore.app.runtime;Microsoft.NETCore.App.Runtime;microsoft.net.runtime;Microsoft.NET.Runtime">
<Replacement>Microsoft</Replacement>
</ShortNames>
<ShortNames Include="Microsoft.NET.Workload;microsoft.net.workload">
<Replacement>Microsoft</Replacement>
</ShortNames>
</ItemGroup>
<ItemGroup>
<ManifestPackages Include="$(PackageSource)Microsoft.NET.Workload.Mono.ToolChain.Manifest-*.nupkg" />
</ItemGroup>
<GenerateManifestMsi
IntermediateBaseOutputPath="$(IntermediateOutputPath)"
OutputPath="$(OutputPath)"
MsiVersion="$(MsiVersion)"
WixToolsetPath="$(WixToolsetPath)"
WorkloadManifestPackage="%(ManifestPackages.Identity)"
ShortNames="@(ShortNames)" >
<Output TaskParameter="Msis" ItemName="ManifestMsis" />
</GenerateManifestMsi>
<GenerateVisualStudioWorkload IntermediateBaseOutputPath="$(WorkloadIntermediateOutputPath)"
WixToolsetPath="$(WixToolsetPath)"
GenerateMsis="true"
ComponentVersions="@(ComponentVersions)"
OutputPath="$(WorkloadOutputPath)"
PackagesPath="$(PackageSource)"
ShortNames="@(ShortNames)"
WorkloadPackages="@(ManifestPackages)">
<Output TaskParameter="SwixProjects" ItemName="SwixProjects" />
<Output TaskParameter="Msis" ItemName="Msis" />
</GenerateVisualStudioWorkload>
<!-- Build all the SWIX projects. This requires full framework MSBuild-->
<MSBuild Projects="%(ManifestMsis.SwixProject)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath)" />
<MSBuild Projects="@(SwixProjects)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath)" />
<!-- Gather .wixobj files for post-build signing. We'll have to batch since we generated multiple MSIs in the previous step. -->
<MSBuild Projects="$(MSBuildProjectFile)" Properties="_WixObjDir=%(ManifestMsis.WixObj);_Msi=%(ManifestMsis.Identity)" Targets="CreateWixPack" />
<MSBuild Projects="$(MSBuildProjectFile)" Properties="_WixObjDir=%(Msis.WixObj);_Msi=%(Msis.Identity)" Targets="CreateWixPack" />
<!-- Build the Visual Studio manifest project. -->
<ItemGroup>
<VisualStudioManifestProjects Include="mono_wasm_mobile.vsmanproj" />
</ItemGroup>
<MSBuild Projects="@(VisualStudioManifestProjects)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath);OutputPath=$(VersionedVisualStudioSetupInsertionPath)" />
<!-- Build all the MSI payload packages for NuGet. -->
<ItemGroup>
<MsiPackageProjects Include="%(ManifestMsis.PackageProject)" />
<MsiPackageProjects Include="%(Msis.PackageProject)" />
</ItemGroup>
<MSBuild Projects="@(MsiPackageProjects)" Properties="OutputPath=$(ArtifactsShippingPackagesDir)" Targets="restore;pack" />
</Target>
<!-- Target to create a single wixpack for signing -->
<Target Name="CreateWixPack">
<ItemGroup>
<_WixObj Include="$(_WixObjDir)\**\*.wixobj" />
</ItemGroup>
<CreateLightCommandPackageDrop
LightCommandWorkingDir="$(LightCommandObjDir)"
OutputFolder="$(LightCommandPackagesDir)"
NoLogo="true"
Cultures="en-us"
InstallerFile="$(_Msi)"
WixExtensions="WixUIExtension;WixDependencyExtension;WixUtilExtension"
WixSrcFiles="@(_WixObj)">
<Output TaskParameter="OutputFile" PropertyName="_LightCommandPackageNameOutput" />
</CreateLightCommandPackageDrop>
</Target>
<!-- These are just individual targets for testing local builds. -->
<Target Name="BuildSwixProjects">
<ItemGroup>
<SwixProjects Include="$(WorkloadIntermediateOutputPath)**\*.swixproj" />
</ItemGroup>
<MSBuild Projects="@(SwixProjects)" BuildInParallel="true" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath)" />
</Target>
<Target Name="BuildVisualStudioManifest">
<ItemGroup>
<VisualStudioManifestProjects Include="Microsoft.NET.vsmanproj" />
</ItemGroup>
<MSBuild Projects="@(VisualStudioManifestProjects)" BuildInParallel="true" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath);OutputPath=$(VersionedVisualStudioSetupInsertionPath)" />
</Target>
<Target Name="_GetVersionProps">
<PropertyGroup>
<_MajorVersion>$([System.Version]::Parse('$(AssemblyVersion)').Major)</_MajorVersion>
<_MinorVersion>$([System.Version]::Parse('$(AssemblyVersion)').Minor)</_MinorVersion>
<_PatchVersion>$([System.Version]::Parse('$(AssemblyVersion)').Build)</_PatchVersion>
<_BuildNumber>$([System.Version]::Parse('$(AssemblyVersion)').Revision)</_BuildNumber>
</PropertyGroup>
</Target>
<Target Name="_GenerateMsiVersionString">
<PropertyGroup>
<VersionPadding Condition="'$(VersionPadding)'==''">5</VersionPadding>
<!-- Using the following default comparison date will produce versions that align with our internal build system. -->
<VersionComparisonDate Condition="'$(VersionComparisonDate)'==''">1996-04-01</VersionComparisonDate>
</PropertyGroup>
<GenerateCurrentVersion
SeedDate="$([System.DateTime]::Now.ToString(yyyy-MM-dd))"
OfficialBuildId="$(OfficialBuildId)"
ComparisonDate="$(VersionComparisonDate)"
Padding="$(VersionPadding)">
<Output PropertyName="BuildNumberMajor" TaskParameter="GeneratedVersion" />
<Output PropertyName="BuildNumberMinor" TaskParameter="GeneratedRevision" />
</GenerateCurrentVersion>
<GenerateMsiVersion
Major="$(_MajorVersion)"
Minor="$(_MinorVersion)"
Patch="$(_PatchVersion)"
BuildNumberMajor="$(BuildNumberMajor)"
BuildNumberMinor="$(BuildNumberMinor)">
<Output TaskParameter="MsiVersion" PropertyName="MsiVersion" />
</GenerateMsiVersion>
</Target>
</Project>