Remove old publishing targets (#19244)

This commit is contained in:
Viktor Hofer 2024-04-02 10:29:22 +02:00 committed by GitHub
parent d45966eddd
commit 9bef43c6fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 98 deletions

View file

@ -24,8 +24,6 @@
<PackageReportDataFile>$(PackageReportDir)prebuilt-usage.xml</PackageReportDataFile> <PackageReportDataFile>$(PackageReportDir)prebuilt-usage.xml</PackageReportDataFile>
<ProjectAssetsJsonArchiveFile>$(PackageReportDir)all-project-assets-json-files.zip</ProjectAssetsJsonArchiveFile> <ProjectAssetsJsonArchiveFile>$(PackageReportDir)all-project-assets-json-files.zip</ProjectAssetsJsonArchiveFile>
<ProdConManifestFile>$(PackageReportDir)prodcon-build.xml</ProdConManifestFile> <ProdConManifestFile>$(PackageReportDir)prodcon-build.xml</ProdConManifestFile>
<RepoManifestFile>$([MSBuild]::NormalizePath('$(ProjectDirectory)', 'artifacts', 'RepoManifest.xml'))</RepoManifestFile>
<RepoAssetsSymbolsArchive>$(ArtifactsAssetsSymbolsDir)Symbols.$(RepositoryName)$(ArchiveExtension)</RepoAssetsSymbolsArchive>
<IntermediateSymbolsRepoDir>$(IntermediateSymbolsRootDir)$(RepositoryName)</IntermediateSymbolsRepoDir> <IntermediateSymbolsRepoDir>$(IntermediateSymbolsRootDir)$(RepositoryName)</IntermediateSymbolsRepoDir>
</PropertyGroup> </PropertyGroup>
@ -410,87 +408,23 @@
<Message Importance="High" Text="See '$(RepoConsoleLogFile)' for more information." Condition="Exists('$(RepoConsoleLogFile)') and '$(MinimalConsoleLogOutput)' == 'true'" /> <Message Importance="High" Text="See '$(RepoConsoleLogFile)' for more information." Condition="Exists('$(RepoConsoleLogFile)') and '$(MinimalConsoleLogOutput)' == 'true'" />
</Target> </Target>
<!-- <!-- Log the new repo artifacts -->
Remove this target after arcade changes for publishing have flown to installer repo. <Target Name="LogRepoArtifacts"
https://github.com/dotnet/source-build/issues/4207
-->
<Target Name="CopyRepoArtifacts"
DependsOnTargets="RepoBuild" DependsOnTargets="RepoBuild"
Condition="'$(IsUtilityProject)' != 'true' and Exists('$(RepoManifestFile)')" Condition="'$(IsUtilityProject)' != 'true'">
Inputs="$(RepoManifestFile)" <ItemGroup>
Outputs="$(BaseIntermediateOutputPath)CopyRepoArtifacts.complete"> <RepoAssetManifest Include="$(RepoAssetManifestsDir)*.xml" />
<Error Text="Repo manifest file doesn't exist." Condition="!Exists('$(RepoManifestFile)')" /> </ItemGroup>
<XmlPeek XmlInputPath="$(RepoManifestFile)" <Error Text="Repo manifest files don't exist." Condition="'@(RepoAssetManifest)' == ''" />
Query="Build/Artifact/@Path">
<XmlPeek XmlInputPath="%(RepoAssetManifest.Identity)"
Query="/Build/*[self::Package | self::Blob]/@Id">
<Output TaskParameter="Result" ItemName="RepoManifestArtifact" /> <Output TaskParameter="Result" ItemName="RepoManifestArtifact" />
</XmlPeek> </XmlPeek>
<!-- Error if a repository doesn't produce any shipping or non-shipping artifacts. -->
<ItemGroup Condition="'@(RepoManifestArtifact)' == ''">
<_ArtifactsNotCreatedReason Include="^ There may have been a silent failure in the repo build." />
<_ArtifactsNotCreatedReason Include="^ To confirm, check the build log file for undetected errors that may have prevented package creation: $(RepoConsoleLogFile)" Condition="'$(MinimalConsoleLogOutput)' == 'true'" />
<_ArtifactsNotCreatedReason Include="^ The packages may have been written to an unexpected directory. For example, some repos used bin/ and changed to artifacts/ to match Arcade. Check RepoManifestFile in $(MSBuildProjectFullPath) (currently '$(RepoManifestFile)')" />
</ItemGroup>
<Error Text="$(RepositoryName) produced no new source-built package identities. Known possible causes:%0A@(_ArtifactsNotCreatedReason, '%0A')"
Condition="'@(RepoManifestArtifact)' == ''" />
<!-- The repo symbol archive shouldn't be copied. -->
<ItemGroup>
<RepoSymbolsArchive Include="@(RepoManifestArtifact)"
Condition="$([System.String]::Copy('%(Identity)').EndsWith('Symbols.$(RepositoryName)$(ArchiveExtension)'))" />
<RepoManifestArtifact Remove="@(RepoSymbolsArchive)" />
</ItemGroup>
<!-- Log the new repo artifacts -->
<Message Importance="High" Text="New artifact(s) after building $(RepositoryName):" /> <Message Importance="High" Text="New artifact(s) after building $(RepositoryName):" />
<Message Importance="High" Text=" -> %(RepoManifestArtifact.Filename)%(RepoManifestArtifact.Extension)" /> <Message Importance="High" Text=" -> %(RepoManifestArtifact.Identity)" />
<ItemGroup>
<RepoManifestPackage Include="@(RepoManifestArtifact->WithMetadataValue('Extension', '.nupkg'))" />
<RepoManifestAsset Include="@(RepoManifestArtifact)" Exclude="@(RepoManifestPackage)" />
</ItemGroup>
<!-- Prepare the repo manifest packages and group them by shipping and non-shipping. -->
<ItemGroup>
<RepoManifestNonShippingPackage Include="@(RepoManifestPackage)"
Condition="$([System.String]::Copy('%(Identity)').Contains('$([System.IO.Path]::DirectorySeparatorChar)NonShipping$([System.IO.Path]::DirectorySeparatorChar)'))">
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(RepoArtifactsNonShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferencePackagesDir)</DestinationFolder>
</RepoManifestNonShippingPackage>
<RepoManifestShippingPackage Include="@(RepoManifestPackage)"
Exclude="@(RepoManifestNonShippingPackage)">
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(RepoArtifactsShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferencePackagesDir)</DestinationFolder>
</RepoManifestShippingPackage>
<RepoManifestAsset>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' != 'true'">$(ArtifactsAssetsDir)</DestinationFolder>
<DestinationFolder Condition="'$(ReferenceOnlyRepoArtifacts)' == 'true'">$(ReferenceAssetsDir)</DestinationFolder>
</RepoManifestAsset>
</ItemGroup>
<!-- Copy shipping packages -->
<Copy SourceFiles="@(RepoManifestShippingPackage)"
DestinationFolder="%(RepoManifestShippingPackage.DestinationFolder)"
Condition="'@(RepoManifestShippingPackage)' != ''" />
<!-- Copy non-shipping packages -->
<Copy SourceFiles="@(RepoManifestNonShippingPackage)"
DestinationFolder="%(RepoManifestNonShippingPackage.DestinationFolder)"
Condition="'@(RepoManifestNonShippingPackage)' != ''" />
<!-- Copy assets -->
<Copy SourceFiles="@(RepoManifestAsset)"
DestinationFolder="%(RepoManifestAsset.DestinationFolder)"
Condition="'@(RepoManifestAsset)' != ''" />
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)CopyRepoArtifacts.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
</Target> </Target>
<!-- Copy restored packages from inner build to ensure they're included in the <!-- Copy restored packages from inner build to ensure they're included in the
@ -566,7 +500,7 @@
</Target> </Target>
<Target Name="ExtractToolPackage" <Target Name="ExtractToolPackage"
DependsOnTargets="CopyRepoArtifacts" DependsOnTargets="RepoBuild"
Condition="'@(BuiltSdkPackageOverride)' != ''" Condition="'@(BuiltSdkPackageOverride)' != ''"
Inputs="$(MSBuildProjectFullPath)" Inputs="$(MSBuildProjectFullPath)"
Outputs="$(BaseIntermediateOutputPath)ExtractToolPackage.complete"> Outputs="$(BaseIntermediateOutputPath)ExtractToolPackage.complete">
@ -606,16 +540,18 @@
<Target Name="DiscoverSymbolsArchiveFile" <Target Name="DiscoverSymbolsArchiveFile"
Condition="'$(DotNetBuildSourceOnly)' == 'true' and Condition="'$(DotNetBuildSourceOnly)' == 'true' and
'$(IsUtilityProject)' != 'true' and '$(IsUtilityProject)' != 'true'">
Exists('$(RepoAssetsSymbolsArchive)')"> <PropertyGroup>
<RepoAssetsSymbolsArchive>$(ArtifactsAssetsSymbolsDir)Symbols.$(RepositoryName)$(ArchiveExtension)</RepoAssetsSymbolsArchive>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<RepoSymbolsArchive Include="$(RepoAssetsSymbolsArchive)" /> <RepoSymbolsArchive Include="$(RepoAssetsSymbolsArchive)" Condition="Exists('$(RepoAssetsSymbolsArchive)')" />
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="ExtractSymbolsArchiveFile" <Target Name="ExtractSymbolsArchiveFile"
DependsOnTargets="CopyRepoArtifacts;DiscoverSymbolsArchiveFile" DependsOnTargets="RepoBuild;DiscoverSymbolsArchiveFile"
Condition="'$(DotNetBuildSourceOnly)' == 'true' and Condition="'$(DotNetBuildSourceOnly)' == 'true' and
'$(IsUtilityProject)' != 'true' and '$(IsUtilityProject)' != 'true' and
'@(RepoSymbolsArchive)' != ''" '@(RepoSymbolsArchive)' != ''"
@ -634,7 +570,7 @@
DependsOnTargets=" DependsOnTargets="
BuildRepoReferences; BuildRepoReferences;
RepoBuild; RepoBuild;
CopyRepoArtifacts; LogRepoArtifacts;
CopyInnerBuildRestoredPackages; CopyInnerBuildRestoredPackages;
ExtractToolPackage; ExtractToolPackage;
DiscoverSymbolsArchiveFile; DiscoverSymbolsArchiveFile;

View file

@ -31,19 +31,4 @@
SourcePath="$(LocalNuGetPackageCacheDirectory)" /> SourcePath="$(LocalNuGetPackageCacheDirectory)" />
</Target> </Target>
<!--
Remove this target after VMR picks up new arcade publishing changes: https://github.com/dotnet/arcade/pull/14559
Tracking issue: https://github.com/dotnet/source-build/issues/4210
We only run this target if we're publishing using repo manifest.
-->
<Target Name="ClearPreviousSBRP"
Condition="Exists('$(RepoManifestFile)')"
BeforeTargets="CopyRepoArtifacts"
DependsOnTargets="RepoBuild">
<!-- Building SBRP: At this point the References directory contains the previously-source-built SBRPs,
clear it before copying the current SBRPs. This ensures n-1 SBRPs aren't required to build the product repos. -->
<RemoveDir Directories="$(ReferencePackagesDir)" />
</Target>
</Project> </Project>