/
workloads.csproj
234 lines (205 loc) · 13.9 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
225
226
227
228
229
230
231
232
233
234
<Project DefaultTargets="Restore;Build">
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IncludeBuildOutput>false</IncludeBuildOutput>
<WorkloadIntermediateOutputPath>$(ArtifactsObjDir)workloads/</WorkloadIntermediateOutputPath>
<VSTemp>$(WorkloadIntermediateOutputPath)VS/</VSTemp>
<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."/>
<_ComponentResources Include="runtimes-windows" Title=".NET Windows Runtimes"
Description=".NET runtime components for Windows execution."/>
<_ComponentResources Include="microsoft-net-runtime-mono-tooling-net6" Title=".NET 6.0 Shared Mobile Build Tools"
Description="Shared build tasks for mobile platform development."/>
<_ComponentResources Include="wasm-tools-net6" Title=".NET 6.0 WebAssembly Build Tools"
Description="Build tools for net6.0 WebAssembly ahead-of-time (AoT) compilation and native linking."/>
<_ComponentResources Include="microsoft-net-runtime-android-net6" Title=".NET 6.0 Android Build Tools"
Description="Build tools for net6.0 Android compilation and native linking."/>
<_ComponentResources Include="microsoft-net-runtime-android-aot-net6" Title=".NET 6.0 Android Build Tools (AoT)"
Description="Build tools for net6.0 Android ahead-of-time (AoT) compilation and native linking."/>
<_ComponentResources Include="microsoft-net-runtime-ios-net6" Title=".NET 6.0 iOS Build Tools"
Description="Build tools for net6.0 iOS compilation and native linking."/>
<_ComponentResources Include="microsoft-net-runtime-tvos-net" Title=".NET 6.0 tvOS Build Tools"
Description="Build tools for net6.0 tvOS compilation and native linking."/>
<_ComponentResources Include="microsoft-net-runtime-maccatalyst-net6" Title=".NET 6.0 Mac Catalyst Build Tools"
Description="Build tools for net6.0 Mac Catalyst compilation and native linking."/>
<_ComponentResources Include="runtimes-ios-net6" Title=".NET 6.0 iOS Runtimes"
Description=".NET 6.0 runtime components for iOS execution."/>
<_ComponentResources Include="runtimes-tvos-net6" Title=".NET 6.0 tvOS Build Tools"
Description=".NET 6.0 runtime components for tvOS execution."/>
<_ComponentResources Include="runtimes-maccatalyst-net6" Title=".NET 6.0 Mac Catalyst Build Tools"
Description=".NET 6.0 runtime components for Mac Catalyst execution."/>
<_ComponentResources Include="runtimes-windows-net6" Title=".NET 6.0 Windows Runtimes"
Description=".NET 6.0 runtime components for Windows execution."/>
<ComponentResources Include="@(_ComponentResources)" 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>
<!-- These need to be in order - matching rules will try in order. -->
<ShortNames Include="Microsoft.NET.Workload.Mono.ToolChain.net">
<Replacement>Mono.</Replacement>
</ShortNames>
<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>
<!-- Set SupportsMachineArch metadata to true if a specific manifest needs to support arm64 for Visual Studio. DO NOT set if for all feature bands as
it changes the SWIX authoring and older versions of Visual Studio will fail to install. -->
<ManifestPackages Include="$(PackageSource)Microsoft.NET.Workload.Mono.ToolChain.*Manifest-%(WorkloadSdkBandVersions.Identity).*.nupkg"
MsiVersion="$(MsiVersion)"
SupportsMachineArch="%(SupportsMachineArch)" />
</ItemGroup>
<CreateVisualStudioWorkload BaseIntermediateOutputPath="$(WorkloadIntermediateOutputPath)"
AllowMissingPacks="True"
BaseOutputPath="$(WorkloadOutputPath)"
ComponentResources="@(ComponentResources)"
PackageSource="$(PackageSource)"
ShortNames="@(ShortNames)"
WorkloadManifestPackageFiles="@(ManifestPackages)"
WixToolsetPath="$(WixToolsetPath)"
ManifestMsiVersion="$(MsiVersion)">
<Output TaskParameter="SwixProjects" ItemName="SwixProjects" />
<Output TaskParameter="Msis" ItemName="Msis" />
</CreateVisualStudioWorkload>
<!-- Split SWIX projects for packs and components/manifests and build them into separate folders. This allows us to consume pack-only drops
across multiple VS builds to support multi-targeting. -->
<ItemGroup>
<SwixWorkloadPackProjects Include="@(SwixProjects)" Condition="'%(PackageType)' == 'msi-pack'"
ManifestOutputPath="$(VStemp)\p\%(SwixProjects.SdkFeatureBand)"
ZipFile="Workload.VSDrop.mono.net.$(MajorVersion).$(MinorVersion)-%(SwixProjects.SdkFeatureBand).packs.zip"/>
<SwixComponentsAndManifests Include="@(SwixProjects)" Condition="'%(PackageType)' == 'msi-manifest' Or '%(PackageType)' == 'component'"
ManifestOutputPath="$(VStemp)\c\%(SwixProjects.SdkFeatureBand)"
ZipFile="Workload.VSDrop.mono.net.$(MajorVersion).$(MinorVersion)-%(SwixProjects.SdkFeatureBand).components.zip"/>
<PartitionedSwixProjects Include="@(SwixWorkloadPackProjects);@(SwixComponentsAndManifests)" />
</ItemGroup>
<!-- Can't build in parallel to the same output folder because of a shared file from the SWIX compiler. -->
<MSBuild Projects="@(PartitionedSwixProjects)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=%(ManifestOutputPath)"/>
<!-- Create the zip files used for VSDROP creation. -->
<ItemGroup>
<SdkFeatureBand Include="%(SwixProjects.SdkFeatureBand)" />
</ItemGroup>
<ItemGroup>
<VSDrop Include="%(PartitionedSwixProjects.ZipFile)" SourceDirectory="%(ManifestOutputPath)" />
</ItemGroup>
<MakeDir Directories="$(ArtifactsNonShippingPackagesDir)" />
<MakeDir Directories="$(VisualStudioSetupInsertionPath)" />
<ZipDirectory Overwrite="true" SourceDirectory="%(SourceDirectory)"
DestinationFile="$(VisualStudioSetupInsertionPath)%(VSDrop.Identity)" />
<!-- 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=%(Msis.WixObj);_Msi=%(Msis.Identity)" Targets="CreateWixPack" />
<!-- Build all the MSI payload packages for NuGet. -->
<ItemGroup>
<MsiPackageProjects Include="%(Msis.PackageProject)" />
</ItemGroup>
<MSBuild Projects="@(MsiPackageProjects)" Properties="OutputPath=$(ArtifactsShippingPackagesDir);IncludeSymbols=false" 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=$(VisualStudioSetupInsertionPath)" />
</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>