未验证 提交 875c0d90 编写于 作者: V Viktor Hofer 提交者: GitHub

Minor msbuild code cleanup in installer partition (#48603)

* Minor code clean-up in installer partition

* Move prepare-artifacts.proj into installer root
上级 a99e6bc3
......@@ -306,7 +306,7 @@
</ItemGroup>
<ItemGroup Condition="$(_subset.Contains('+publish+'))">
<ProjectToBuild Include="$(InstallerProjectRoot)publish\prepare-artifacts.proj" Pack="true" BuildInParallel="false" Category="publish" />
<ProjectToBuild Include="$(InstallerProjectRoot)prepare-artifacts.proj" Pack="true" BuildInParallel="false" Category="publish" />
</ItemGroup>
<!-- Utility -->
......
<Project>
<Import Project="..\..\Directory.Build.props" />
<!--
Before Microsoft.Common.targets, set the extensions path to match the restore dir as Arcade
sets it, so MSBuild packages with targets files will be found and imported.
-->
<PropertyGroup>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
</PropertyGroup>
<PropertyGroup>
<!-- Clear AssemblyVersion as we need to align with the NuGet conventions, when empty arcade will do that for us. -->
<AssemblyVersion />
</PropertyGroup>
<PropertyGroup>
<SigningToolsDir>$(InstallerProjectRoot)signing\</SigningToolsDir>
</PropertyGroup>
<!-- Platform detection -->
<PropertyGroup>
<RunningOnUnix Condition="'$(OS)' != 'Windows_NT'">true</RunningOnUnix>
<!-- Don't set platform too early as test app paths are currently hardcoded. -->
<Platform Condition="'$(Platform)' == ''">$(TargetArchitecture)</Platform>
</PropertyGroup>
<!-- Set up Default symbol and optimization for Configuration -->
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants),DEBUG,TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineConstants>$(DefineConstants),TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == '' and '$(EnsureRuntimeIdentifierSet)' == 'true'">
<RuntimeIdentifier>$(OutputRid)</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants),DEBUG,TRACE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Release'">$(DefineConstants),TRACE</DefineConstants>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' and '$(EnsureRuntimeIdentifierSet)' == 'true'">$(OutputRid)</RuntimeIdentifier>
<TestTargetRid Condition="'$(TestTargetRid)' == ''">$(OutputRid)</TestTargetRid>
</PropertyGroup>
<!-- Produce assets into the specified blob feed. -->
<PropertyGroup Condition="'$(DotNetOutputBlobFeedDir)' != ''">
<AssetOutputPath>$(DotNetOutputBlobFeedDir)assets/</AssetOutputPath>
<!-- Never use the NuGet fallback folder that comes with the SDK we use to build.
The NuGet fallback folder can/will contain packages we are building in this repo, and we
want to ensure we use the correct packages. -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<!-- Set up the default output and intermediate paths -->
<PropertyGroup>
<OSPlatformConfig>$(OutputRid).$(Configuration)</OSPlatformConfig>
<BaseOutputRootPath>$(ArtifactsBinDir)$(OSPlatformConfig)\</BaseOutputRootPath>
<CrossGenRootPath>$(BaseOutputRootPath)crossgen\</CrossGenRootPath>
<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(ArtifactsObjDir)$(OSPlatformConfig)\</IntermediateOutputRootPath>
<PackagesBasePath Condition="'$(PackagesBasePath)'==''">$(ArtifactsBinDir)$(OSPlatformConfig)/</PackagesBasePath>
<PackageSymbolsBinDir Condition="'$(PackageSymbolsBinDir)' == ''">$(PackagesBasePath)symbols/</PackageSymbolsBinDir>
<IntermediateOutputRootPath>$(ArtifactsObjDir)$(OSPlatformConfig)\</IntermediateOutputRootPath>
<!-- Produce assets into the specified blob feed. -->
<AssetOutputPath Condition="'$(DotNetOutputBlobFeedDir)' != ''">$(DotNetOutputBlobFeedDir)assets/</AssetOutputPath>
<AssetOutputPath Condition="'$(AssetOutputPath)'==''">$(ArtifactsShippingPackagesDir)</AssetOutputPath>
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(ArtifactsShippingPackagesDir)</SymbolPackageOutputPath>
</PropertyGroup>
<PropertyGroup>
<DisableCrossgen>false</DisableCrossgen>
<DisableCrossgen Condition="'$(RuntimeFlavor)' == 'Mono'">true</DisableCrossgen>
<!-- Disable cross-gen on FreeBSD, NetBSD, illumos and Solaris for now. This can be revisited when we have full support. -->
<DisableCrossgen Condition="'$(TargetOS)'=='FreeBSD' Or '$(TargetOS)'=='NetBSD' Or '$(TargetOS)'=='illumos' Or '$(TargetOS)'=='Solaris'">true</DisableCrossgen>
<OutputVersionBadge>$(AssetOutputPath)sharedfx_$(OutputRid)_$(Configuration)_version_badge.svg</OutputVersionBadge>
</PropertyGroup>
<PropertyGroup>
<!-- Never use the NuGet fallback folder that comes with the SDK we use to build.
The NuGet fallback folder can/will contain packages we are building in this repo, and we
want to ensure we use the correct packages.
-->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(ArtifactsShippingPackagesDir)</SymbolPackageOutputPath>
</PropertyGroup>
</Project>
<Project>
<PropertyGroup>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<AssemblyFileVersion>$(VersionPrefix)</AssemblyFileVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IncludeSymbols>true</IncludeSymbols>
<Serviceable>true</Serviceable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Managed API isn't completely documented yet. TODO: https://github.com/dotnet/core-setup/issues/5108 -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<!-- Historically, the key for the managed projects is the AspNetCore key Arcade carries. -->
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
</Project>
......@@ -4,18 +4,21 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Abstractions for modifying .NET host binaries</Description>
<IsShipping>false</IsShipping>
</PropertyGroup>
<PropertyGroup>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<Serviceable>true</Serviceable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Managed API isn't completely documented yet. TODO: https://github.com/dotnet/core-setup/issues/5108 -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- Historically, the key for the managed projects is the AspNetCore key Arcade carries. -->
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(CommonManaged.props))" />
<ItemGroup>
<PackageReference Include="System.Reflection.Metadata">
<Version>1.8.0</Version>
</PackageReference>
<PackageReference Include="System.Reflection.Metadata" Version="1.8.0" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafeVersion)" />
</ItemGroup>
......
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
<Import Project="..\Directory.Build.targets" />
<!--
Add hook for depproj build to respect OrderProjectReferences like pkgproj does. "BeforeTargets"
......@@ -16,118 +16,4 @@
<MSBuild Projects="@(OrderProjectReference)" Targets="Build" />
</Target>
<!--
Get branding names for the installers.
-->
<Target Name="GetInstallerBrandingNames"
DependsOnTargets="GetProductVersions">
<PropertyGroup
Condition="
'$(ReleaseBrandSuffix)' == '' and
'$(PreReleaseVersionLabel)' != '' and
'$(PreReleaseVersionIteration)' != ''">
<!-- Convert 'preview.7' to 'Preview 7'.
'preview' will come from the pre-release version iteration and the numeric value
will be the PreReleaseVersionIteration. -->
<ReleaseBrandSuffix>$(PreReleaseVersionLabel.Substring(0,1).ToUpperInvariant())</ReleaseBrandSuffix>
<ReleaseBrandSuffix>$(ReleaseBrandSuffix)$(PreReleaseVersionLabel.Substring(1))</ReleaseBrandSuffix>
<ReleaseBrandSuffix>$(ReleaseBrandSuffix) $(PreReleaseVersionIteration)</ReleaseBrandSuffix>
</PropertyGroup>
<PropertyGroup>
<ProductBrandPrefix Condition="'$(ProductBrandPrefix)' == ''">Microsoft .NET</ProductBrandPrefix>
<ProductBrandSuffix>$(ProductionVersion)</ProductBrandSuffix>
<ProductBrandSuffix Condition="'$(ReleaseBrandSuffix)'!=''">$(ProductionVersion) $(ReleaseBrandSuffix)</ProductBrandSuffix>
<SharedHostBrandName>$(ProductBrandPrefix) Host - $(ProductBrandSuffix)</SharedHostBrandName>
<HostFxrBrandName>$(ProductBrandPrefix) Host FX Resolver - $(ProductBrandSuffix)</HostFxrBrandName>
<TargetingPackBrandName>$(ProductBrandPrefix) Targeting Pack - $(ProductBrandSuffix)</TargetingPackBrandName>
<AppHostPackBrandName>$(ProductBrandPrefix) AppHost Pack - $(ProductBrandSuffix)</AppHostPackBrandName>
<Crossgen2PackBrandName>$(ProductBrandPrefix) Crossgen2 Pack - $(ProductBrandSuffix)</Crossgen2PackBrandName>
<SharedFrameworkBrandName>$(ProductBrandPrefix) Runtime - $(ProductBrandSuffix)</SharedFrameworkBrandName>
<SharedHostComponentId>com.microsoft.dotnet.sharedhost.component.osx.$(TargetArchitecture)</SharedHostComponentId>
<HostFxrComponentId>com.microsoft.dotnet.hostfxr.$(HostResolverVersion).component.osx.$(TargetArchitecture)</HostFxrComponentId>
<SharedFxComponentId>com.microsoft.dotnet.sharedframework.$(SharedFrameworkName).$(SharedFrameworkNugetVersion).component.osx.$(TargetArchitecture)</SharedFxComponentId>
<SharedPackageId>com.microsoft.dotnet.$(SharedFrameworkName).$(SharedFrameworkNugetVersion).osx.$(TargetArchitecture)</SharedPackageId>
</PropertyGroup>
</Target>
<!--
Check if the deb package build tool prereq is available.
This issue tracks adding a way to raise this as a build error: https://github.com/dotnet/core-setup/issues/5396
-->
<Target Name="TestDebuild">
<!-- run Debuild -->
<Exec
Command="/usr/bin/env debuild -h > /dev/null 2>&amp;1"
ContinueOnError="true"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true">
<Output TaskParameter="ExitCode" PropertyName="DebuildExitCode" />
</Exec>
<!-- Check if it successfully showed us a help message. -->
<PropertyGroup>
<DebuildPresent>false</DebuildPresent>
<DebuildPresent Condition=" '$(DebuildExitCode)' == '0' ">true</DebuildPresent>
</PropertyGroup>
<Message Condition=" '$(DebuildPresent)' != 'true' "
Text="Debuild Not found, Debian packages will not be built."
Importance="High" />
</Target>
<!--
Check if the RPM package build tool prereq is available.
This issue tracks adding a way to raise this as a build error: https://github.com/dotnet/core-setup/issues/5396
-->
<Target Name="TestFPMTool">
<!-- run FPM -->
<Exec
Command="/usr/bin/env fpm -h > /dev/null 2>&amp;1"
ContinueOnError="true"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true">
<Output TaskParameter="ExitCode" PropertyName="FPMExitCode" />
</Exec>
<!-- Check if it successfully showed us a help message. -->
<PropertyGroup>
<FPMPresent>false</FPMPresent>
<FPMPresent Condition=" '$(FPMExitCode)' == '0' ">true</FPMPresent>
</PropertyGroup>
<Message Condition=" '$(FPMPresent)' != 'true' "
Text="FPM tool Not found, RPM packages will not be built."
Importance="High" />
</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="$(BuildNumberMajor)">
<Output TaskParameter="MsiVersion" PropertyName="MsiVersionString" />
</GenerateMsiVersion>
</Target>
</Project>
<Project DefaultTargets="Build">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<!-- Set IsStableBuild to mimic https://github.com/dotnet/arcade/blob/694d59f090b743f894779d04a7ffe11cbaf352e7/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L30-L31 -->
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild>
<ChecksumExtension>.sha512</ChecksumExtension>
<DownloadDirectory>$(ArtifactsDir)PackageDownload/</DownloadDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
<PackageReference Include="Microsoft.DotNet.VersionTools.Tasks" Version="$(MicrosoftDotNetVersionToolsTasksVersion)" />
</ItemGroup>
<!-- When doing post build sign, pull in the arcade sign.props file, which will
create some initial sign groups and then pulls in the repo's custom Signing.props overrides.
......@@ -44,22 +58,13 @@
<ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
</ItemGroup>
<Target Name="CreateChecksums">
<ItemGroup>
<ArtifactsForGeneratingChecksums
Include="@(UploadToBlobStorageFile)"
DestinationPath="%(FullPath)$(ChecksumExtension)" />
<GeneratedChecksumFile Include="@(ArtifactsForGeneratingChecksums -> '%(DestinationPath)')" />
</ItemGroup>
<GenerateChecksums Items="@(ArtifactsForGeneratingChecksums)" />
</Target>
<!--
Take assets from the build jobs, prepare them for publishing (signing, arrangement) then upload
them to the pipeline for Arcade and custom steps to publish.
-->
<Target Name="PreparePublishToAzureBlobFeed"
DependsOnTargets="GetProductVersions;FindDownloadedArtifacts">
<Error Condition="'$(PackagesUrl)'==''" Text="Missing property PackagesUrl" />
AfterTargets="Build"
DependsOnTargets="GetProductVersions;FindDownloadedArtifacts;CreateChecksums">
<PropertyGroup>
<AssetManifestFilename>Manifest.xml</AssetManifestFilename>
<AssetManifestFile>$(ArtifactsLogDir)AssetManifest/$(AssetManifestFilename)</AssetManifestFile>
......@@ -144,20 +149,140 @@
<Message
Text="##vso[artifact.upload containerfolder=AssetManifests;artifactname=AssetManifests]$(TempWorkingDir)$(AssetManifestFilename)"
Importance="High" />
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Message Importance="High" Text="Complete!" />
</Target>
<!--
Take assets from the build jobs, prepare them for publishing (signing, arrangement) then upload
them to the pipeline for Arcade and custom steps to publish.
Look through the downloaded artifacts to figure out how to ship them. Creates item groups for
other types of publishing to use.
DownloadDirectory is expected to have some directory inside, which then contains a dir for each
build job name. For example, this nupkg would be found:
$(DownloadDirectory)IntermediateUnsignedArtifacts\Windows_x64\Shipping\a.nupkg
-->
<Target Name="Build"
DependsOnTargets="
FindDownloadedArtifacts;
CreateChecksums;
PreparePublishToAzureBlobFeed">
<Message Importance="High" Text="Complete!" />
<Target Name="FindDownloadedArtifacts">
<ItemGroup>
<DownloadedArtifactFile Include="$(DownloadDirectory)**" />
<Error
Condition="'@(DownloadedArtifactFile)' == ''"
Text="No downloaded artifacts found." />
<DownloadedSymbolNupkgFile Include="$(DownloadDirectory)**\*.symbols.nupkg" />
<DownloadedWixPdbFile Include="$(DownloadDirectory)**\*.wixpdb" />
<DownloadedNupkgFile
Include="$(DownloadDirectory)**\*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!-- Add files that are not affected by filtering. -->
<UploadToBlobStorageFile
Include="@(DownloadedArtifactFile)"
Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile);@(DownloadedWixPdbFile)" />
<!--
Filter out the RID-specific (Runtime) nupkgs and RID-agnostic nupkgs. RID-specific packages
are published from every job. RID-agnostic nupkgs are built with the same ID/version by
every job, so one specific job's outputs must be picked to sign and publish.
-->
<!-- RID-specific framework packs. -->
<RuntimeNupkgFile
Include="
$(DownloadDirectory)**\Microsoft.*.Runtime.*.nupkg;
$(DownloadDirectory)**\Microsoft.*.App.Host.*.nupkg;
$(DownloadDirectory)**\Microsoft.*.App.Crossgen2.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!-- VS insertion packages, carrying RID-specific installers. -->
<RuntimeNupkgFile
Include="$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!--
Runtime packages associated with some identity packages. Need to exclude "runtime.native.*"
because Libraries produces some "runtime.native.Foo" packages with
"runtime.<rid>.runtime.native.Foo" identity packages.
-->
<RuntimeNupkgFile
Include="$(DownloadDirectory)**\runtime.*.nupkg"
Exclude="
$(DownloadDirectory)**\runtime.native.*.nupkg;
@(DownloadedSymbolNupkgFile)" />
<!--
Packages that aren't matched above as RID-specific are considered RID-agnostic. Also include
the AllConfigurations packages from the Libraries build.
-->
<RidAgnosticNupkgToPublishFile
Include="
$(DownloadDirectory)*\$(PublishRidAgnosticPackagesFromPlatform)\**\*.nupkg;
$(DownloadDirectory)*\*AllConfigurations\**\*.nupkg"
Exclude="@(RuntimeNupkgFile);@(DownloadedSymbolNupkgFile)" />
<TransportPackagesToPublishFile
Include="$(DownloadDirectory)**\*Transport*.nupkg"
Exclude="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile);@(DownloadedSymbolNupkgFile)" />
<NupkgToPublishFile Include="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile);@(TransportPackagesToPublishFile)" />
<!--
Assuming all symbol packages ship and can be found by turning .nupkg => .symbols.nupkg, find
them. Don't check for missing symbol packages here: some nupkgs don't have them for valid
reasons, such as the VS insertion packages that transport MSIs. Symbol package validation
will check for symbol completeness with file-by-file granularity rather than looking for
missing symbols.nupkg files: https://github.com/dotnet/arcade/issues/2499.
Handles several conventions:
* NonShipping packages have symbol nupkgs that are Shipping.
* Shipping packages have symbol packages in a "symbols" subdirectory.
-->
<PotentialSymbolNupkgToPublishFile
Include="
@(NupkgToPublishFile->Replace('\NonShipping\', '\Shipping\')->Replace('.nupkg', '.symbols.nupkg'));
@(NupkgToPublishFile->Replace('\NonShipping\', '\NonShipping\symbols\')->Replace('.nupkg', '.symbols.nupkg'));
@(NupkgToPublishFile->Replace('\Shipping\', '\Shipping\symbols\')->Replace('.nupkg', '.symbols.nupkg'))" />
<SymbolNupkgToPublishFile
Include="@(PotentialSymbolNupkgToPublishFile -> Distinct())"
Condition="Exists('%(Identity)')" />
<!-- Split nupkgs into shipping/nonshipping for BAR categorization. -->
<ShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Condition="$([System.String]::new('%(Identity)').Contains('\Shipping\'))" />
<NonShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Exclude="@(ShippingNupkgToPublishFile)" />
</ItemGroup>
<Error
Condition="'@(SymbolNupkgToPublishFile)' == ''"
Text="No symbol packages found." />
<!--
Duplicate RuntimeNupkgFile items mean artifact upload will fail, but only after another hour
of signing. Detect this early. It's possible to automatically "fix" this with Distinct(),
however the patterns should be fairly specific: this is likely a build infra mistake that
should be corrected.
-->
<Error
Text="Duplicate RuntimeNupkgFile entries for: %(RuntimeNupkgFile.Identity)"
Condition="@(RuntimeNupkgFile->Count()) &gt; 1" />
</Target>
<Target Name="CreateChecksums">
<ItemGroup>
<ArtifactsForGeneratingChecksums Include="@(UploadToBlobStorageFile)"
DestinationPath="%(FullPath)$(ChecksumExtension)" />
<GeneratedChecksumFile Include="@(ArtifactsForGeneratingChecksums -> '%(DestinationPath)')" />
</ItemGroup>
<GenerateChecksums Items="@(ArtifactsForGeneratingChecksums)" />
</Target>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<!-- Set IsStableBuild to mimic https://github.com/dotnet/arcade/blob/694d59f090b743f894779d04a7ffe11cbaf352e7/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L30-L31 -->
<PropertyGroup>
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild>
</PropertyGroup>
<PropertyGroup>
<!-- Blob storage container that has the "Latest" channel to publish to. -->
<ContainerName>dotnet</ContainerName>
<ChecksumContainerName>$(ContainerName)</ChecksumContainerName>
<BaseUrl Condition="'$(BaseUrl)' == ''">https://dotnetcli.blob.core.windows.net/</BaseUrl>
<ChecksumExtension>.sha512</ChecksumExtension>
<DownloadDirectory>$(ArtifactsDir)PackageDownload/</DownloadDirectory>
<!-- Allow dev builds to set a custom blob feed, or default to dotnet-core. -->
<PackagesUrl Condition="'$(PackagesUrl)' == ''">$(PublishBlobFeedUrl)</PackagesUrl>
<PackagesUrl Condition="'$(PackagesUrl)' == ''">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</PackagesUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
<PackageReference Include="Microsoft.DotNet.VersionTools.Tasks" Version="$(MicrosoftDotNetVersionToolsTasksVersion)" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Required by Common.Targets but not used by publishing projects. -->
<Target Name="CreateManifestResourceNames" />
<Target Name="CoreCompile" />
<!--
Look through the downloaded artifacts to figure out how to ship them. Creates item groups for
other types of publishing to use.
DownloadDirectory is expected to have some directory inside, which then contains a dir for each
build job name. For example, this nupkg would be found:
$(DownloadDirectory)IntermediateUnsignedArtifacts\Windows_x64\Shipping\a.nupkg
-->
<Target Name="FindDownloadedArtifacts">
<ItemGroup>
<DownloadedArtifactFile Include="$(DownloadDirectory)**" />
<Error
Condition="'@(DownloadedArtifactFile)' == ''"
Text="No downloaded artifacts found." />
<DownloadedSymbolNupkgFile Include="$(DownloadDirectory)**\*.symbols.nupkg" />
<DownloadedWixPdbFile Include="$(DownloadDirectory)**\*.wixpdb" />
<DownloadedNupkgFile
Include="$(DownloadDirectory)**\*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!-- Add files that are not affected by filtering. -->
<UploadToBlobStorageFile
Include="@(DownloadedArtifactFile)"
Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile);@(DownloadedWixPdbFile)" />
<!--
Filter out the RID-specific (Runtime) nupkgs and RID-agnostic nupkgs. RID-specific packages
are published from every job. RID-agnostic nupkgs are built with the same ID/version by
every job, so one specific job's outputs must be picked to sign and publish.
-->
<!-- RID-specific framework packs. -->
<RuntimeNupkgFile
Include="
$(DownloadDirectory)**\Microsoft.*.Runtime.*.nupkg;
$(DownloadDirectory)**\Microsoft.*.App.Host.*.nupkg;
$(DownloadDirectory)**\Microsoft.*.App.Crossgen2.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!-- VS insertion packages, carrying RID-specific installers. -->
<RuntimeNupkgFile
Include="$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />
<!--
Runtime packages associated with some identity packages. Need to exclude "runtime.native.*"
because Libraries produces some "runtime.native.Foo" packages with
"runtime.<rid>.runtime.native.Foo" identity packages.
-->
<RuntimeNupkgFile
Include="$(DownloadDirectory)**\runtime.*.nupkg"
Exclude="
$(DownloadDirectory)**\runtime.native.*.nupkg;
@(DownloadedSymbolNupkgFile)" />
<!--
Packages that aren't matched above as RID-specific are considered RID-agnostic. Also include
the AllConfigurations packages from the Libraries build.
-->
<RidAgnosticNupkgToPublishFile
Include="
$(DownloadDirectory)*\$(PublishRidAgnosticPackagesFromPlatform)\**\*.nupkg;
$(DownloadDirectory)*\*AllConfigurations\**\*.nupkg"
Exclude="@(RuntimeNupkgFile);@(DownloadedSymbolNupkgFile)" />
<TransportPackagesToPublishFile
Include="$(DownloadDirectory)**\*Transport*.nupkg"
Exclude="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile);@(DownloadedSymbolNupkgFile)" />
<NupkgToPublishFile Include="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile);@(TransportPackagesToPublishFile)" />
<!--
Assuming all symbol packages ship and can be found by turning .nupkg => .symbols.nupkg, find
them. Don't check for missing symbol packages here: some nupkgs don't have them for valid
reasons, such as the VS insertion packages that transport MSIs. Symbol package validation
will check for symbol completeness with file-by-file granularity rather than looking for
missing symbols.nupkg files: https://github.com/dotnet/arcade/issues/2499.
Handles several conventions:
* NonShipping packages have symbol nupkgs that are Shipping.
* Shipping packages have symbol packages in a "symbols" subdirectory.
-->
<PotentialSymbolNupkgToPublishFile
Include="
@(NupkgToPublishFile->Replace('\NonShipping\', '\Shipping\')->Replace('.nupkg', '.symbols.nupkg'));
@(NupkgToPublishFile->Replace('\NonShipping\', '\NonShipping\symbols\')->Replace('.nupkg', '.symbols.nupkg'));
@(NupkgToPublishFile->Replace('\Shipping\', '\Shipping\symbols\')->Replace('.nupkg', '.symbols.nupkg'))" />
<SymbolNupkgToPublishFile
Include="@(PotentialSymbolNupkgToPublishFile -> Distinct())"
Condition="Exists('%(Identity)')" />
<!-- Split nupkgs into shipping/nonshipping for BAR categorization. -->
<ShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Condition="$([System.String]::new('%(Identity)').Contains('\Shipping\'))" />
<NonShippingNupkgToPublishFile
Include="@(NupkgToPublishFile)"
Exclude="@(ShippingNupkgToPublishFile)" />
</ItemGroup>
<Error
Condition="'@(SymbolNupkgToPublishFile)' == ''"
Text="No symbol packages found." />
<!--
Duplicate RuntimeNupkgFile items mean artifact upload will fail, but only after another hour
of signing. Detect this early. It's possible to automatically "fix" this with Distinct(),
however the patterns should be fairly specific: this is likely a build infra mistake that
should be corrected.
-->
<Error
Text="Duplicate RuntimeNupkgFile entries for: %(RuntimeNupkgFile.Identity)"
Condition="@(RuntimeNupkgFile->Count()) &gt; 1" />
</Target>
<Import Project="..\Directory.Build.targets" />
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册