Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Port workload changes from release/6.0
  • Loading branch information
joeloff authored and github-actions committed Aug 17, 2022
commit 6c805fd5c3c5de67e1fcb72d01a1d59cba4130e9
10 changes: 6 additions & 4 deletions src/installer/prepare-artifacts.proj
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
</ItemsToPush>

<ItemsToPush Include="@(WorkloadsVSInsertionFile)">
<RelativeBlobPath>$(InstallersRelativePath)workloads/$(SdkBandVersion)/%(Filename)%(Extension)</RelativeBlobPath>
<RelativeBlobPath>$(InstallersRelativePath)workloads/%(Filename)%(Extension)</RelativeBlobPath>
<PublishFlatContainer>true</PublishFlatContainer>
</ItemsToPush>

Expand Down Expand Up @@ -222,11 +222,13 @@
Include="$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />

<!-- Workloads VS insertion artifacts produced by src/workloads/workloads.csproj -->
<!--
Workloads VS insertion artifacts produced by src/workloads/workloads.csproj. Only grab
the zip artifacts as they're grouped by SDK feature band which correlates with specific VS versions.
-->
<WorkloadsVSInsertionFile
Include="
$(DownloadDirectory)*\workloads-vs\**\*.json;
$(DownloadDirectory)*\workloads-vs\**\*.msi" />
$(DownloadDirectory)*\workloads-vs\**\*.zip"/>

<!--
Runtime packages associated with some identity packages. Need to exclude "runtime.native.*"
Expand Down
88 changes: 30 additions & 58 deletions src/workloads/workloads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>

<WorkloadIntermediateOutputPath>$(ArtifactsObjDir)workloads/</WorkloadIntermediateOutputPath>
<VSTemp>$(WorkloadIntermediateOutputPath)VS/</VSTemp>
<WorkloadOutputPath>$(ArtifactsBinDir)workloads/</WorkloadOutputPath>
<WorkloadOutputPath Condition="'$(workloadArtifactsPath)' != ''">$(workloadArtifactsPath)/</WorkloadOutputPath>
<PackageSource>$(ArtifactsShippingPackagesDir)</PackageSource>
Expand All @@ -28,14 +29,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Workloads" Version="$(MicrosoftDotNetBuildTasksWorkloadsPackageVersion)" />
<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)" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" GeneratePathProperty="true" />
</ItemGroup>

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />

<ItemDefinitionGroup>
<!-- Visual Studio components must be versioned. Build tasks will fall back to cobbling a version number from
the manifest information unless it's overridden. -->
<ComponentResources Version="$(FileVersion)" />
</ItemDefinitionGroup>

<Target Name="Build" DependsOnTargets="GetAssemblyVersion;_GetVersionProps;_GenerateMsiVersionString">
<ItemGroup>
<!-- Overrides for Visual Studio setup generation. If the workload definition IDs change,
Expand All @@ -62,21 +69,6 @@
Description=".NET runtime components for Mac Catalyst execution."/>
<ComponentResources Include="runtimes-windows" Title=".NET Windows Runtimes"
Description=".NET runtime components for Windows 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)" />
<ComponentVersions Include="runtimes-windows" Version="$(FileVersion)" />
</ItemGroup>

<!-- BAR requires having version information in blobs -->
Expand All @@ -95,50 +87,38 @@
</ItemGroup>

<ItemGroup>
<ManifestPackages Include="$(PackageSource)Microsoft.NET.Workload.Mono.ToolChain.Manifest-*.nupkg" />
<ManifestPackages Include="$(PackageSource)Microsoft.NET.Workload.Mono.ToolChain.Manifest-*.nupkg" MsiVersion="$(MsiVersion)"/>
</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)">
<CreateVisualStudioWorkload BaseIntermediateOutputPath="$(WorkloadIntermediateOutputPath)"
BaseOutputPath="$(WorkloadOutputPath)"
ComponentResources="$(ComponentResources)"
PackageSource="$(PackageSource)"
ShortNames="@(ShortNames)"
WorkloadManifestPackageFiles="@(ManifestPackages)"
WixToolsetPath="$(WixToolsetPath)"
ManifestMsiVersion="$(MsiVersion)">
<Output TaskParameter="SwixProjects" ItemName="SwixProjects" />
<Output TaskParameter="Msis" ItemName="Msis" />
</GenerateVisualStudioWorkload>
</CreateVisualStudioWorkload>

<!-- 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)" />
<MSBuild Projects="@(SwixProjects)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VSTemp)%(SwixProjects.SdkFeatureBand)" />

<!-- Create payload package for VSDROP creation -->
<ItemGroup>
<SdkFeatureBand Include="%(SwixProjects.SdkFeatureBand)" />
</ItemGroup>

<MakeDir Directories="$(ArtifactsNonShippingPackagesDir)" />
<MakeDir Directories="$(VisualStudioSetupInsertionPath)" />
<ZipDirectory Overwrite="true" DestinationFile="$(VisualStudioSetupInsertionPath)Workloads.VSDrop.%(SdkFeatureBand.Identity).$(PackageVersion).zip" SourceDirectory="$(VSTemp)%(SdkFeatureBand.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=%(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. -->
<!-- This is currently a manual endeavor. Building it in CI brings .NET Framework dependencies that make machine servicing harder. -->
<!-- <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>

Expand Down Expand Up @@ -169,15 +149,7 @@
<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)" />
<MSBuild Projects="@(SwixProjects)" BuildInParallel="true" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VisualStudioSetupInsertionPath)" />
</Target>

<Target Name="_GetVersionProps">
Expand Down