[ArPow] Add text-only packages to tarball (#11967)
* add text-only packages to tarball * add BuildTextOnlyPackages target to tarball build targets * fix typo * add content to text only package nuspec files * Change reference to single nuspec file * Update based on PR review * prevent inner buildlog from being overwritten * condition SourceBuildIntermediate.proj copy and build on the file not existing * condition entire copy target on SourceBuildIntermediateProjTarget file existing * Revert "condition entire copy target on SourceBuildIntermediateProjTarget file existing" This reverts commit 995e106c81751b7d9597abf0c120963c2ab5374b. * Revert "condition SourceBuildIntermediate.proj copy and build on the file not existing" This reverts commit 3fbaa11bdb34cf9bb8f006f4c27bbd16783cac09. * Revert "prevent inner buildlog from being overwritten" This reverts commit f994e885fd7e0938dcc80150f3a0a8aad215f014. Co-authored-by: dseefeld <dseefeld@microsoft.com>
This commit is contained in:
parent
cc7a6b7571
commit
3d8501fba2
3 changed files with 133 additions and 3 deletions
|
@ -13,7 +13,8 @@
|
|||
<UsingTask TaskName="Microsoft.DotNet.SourceBuild.Tasks.Tarball_WriteSourceRepoProperties" AssemblyFile="$(SourceBuildTasksAssembly)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TarballDir>$(RepoRoot)artifacts/tarball/</TarballDir>
|
||||
<ArtifactsDir>$(RepoRoot)artifacts/</ArtifactsDir>
|
||||
<TarballDir>$(ArtifactsDir)tarball/</TarballDir>
|
||||
<TarballRootDir>$([MSBuild]::EnsureTrailingSlash('$(TarballDir)'))</TarballRootDir>
|
||||
<TarballSourceDir>$(TarballRootDir)src/</TarballSourceDir>
|
||||
<TarballGitInfoDir>$(TarballRootDir)git-info/</TarballGitInfoDir>
|
||||
|
@ -28,6 +29,8 @@
|
|||
SetupSelfGithubInfo;
|
||||
CloneRepoAndDependentsRecursive;
|
||||
CleanClonedSource;
|
||||
RestoreTextOnlyPackages;
|
||||
CopyTextOnlyPackages;
|
||||
CopyTarballContent;
|
||||
">
|
||||
|
||||
|
@ -227,6 +230,19 @@
|
|||
<Delete Files="@(TarballSrcBinaryToRemove)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreTextOnlyPackages">
|
||||
<PropertyGroup>
|
||||
<TextOnlyPackageRestoreDir>$(ArtifactsDir)text-only-packages/</TextOnlyPackageRestoreDir>
|
||||
<TextOnlyPackageTarballDir>$(TarballRootDir)packages/text-only/</TextOnlyPackageTarballDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<Message Text="Restoring text only packages..." Importance="High" />
|
||||
|
||||
<MSBuild Projects="../Arcade/tools/TextOnlyPackages.csproj"
|
||||
Properties="TargetPackagesPath=$(TextOnlyPackageRestoreDir)"
|
||||
Targets="Restore" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CopyTarballContent">
|
||||
<ItemGroup>
|
||||
<TarballContent Include="$(RepoRoot)src/SourceBuild/tarball/content/**/*" />
|
||||
|
@ -269,4 +285,42 @@
|
|||
<MakeDir Directories="$(TarballRootDir)packages/prebuilt" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
Read directories in which text-only packages have been downloaded and copy content to tarball.
|
||||
-->
|
||||
<Target Name="CopyTextOnlyPackages" DependsOnTargets="RestoreTextOnlyPackages" >
|
||||
|
||||
<ReadLinesFromFile File="$(TextOnlyPackageRestoreDir)/TextOnlyPackageDirectories.txt" Condition="Exists('$(TextOnlyPackageRestoreDir)/TextOnlyPackageDirectories.txt')">
|
||||
<Output TaskParameter="Lines" ItemName="TextOnlyPackageDirectories" />
|
||||
</ReadLinesFromFile>
|
||||
|
||||
<MSBuild Projects="$(MSBuildProjectFile)"
|
||||
Targets="CopySingleTextOnlyDirectory"
|
||||
Properties="TextOnlyDirectory=%(TextOnlyPackageDirectories.Identity);TextOnlyPackageTarballDir=$(TextOnlyPackageTarballDir)" />
|
||||
|
||||
</Target>
|
||||
|
||||
<Target Name="CopySingleTextOnlyDirectory">
|
||||
|
||||
<PropertyGroup>
|
||||
<DirectoryName>$([System.IO.Path]::GetFileName('$(TextOnlyDirectory)'))</DirectoryName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TextOnlyPackageContent
|
||||
Include="$(TextOnlyDirectory)/**/*"
|
||||
Exclude="
|
||||
$(TextOnlyDirectory)/**/.nupkg.metadata;
|
||||
$(TextOnlyDirectory)/**/.signature.p7s;
|
||||
$(TextOnlyDirectory)/**/*.nupkg;
|
||||
$(TextOnlyDirectory)/**/*.nupkg.sha512;
|
||||
" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy
|
||||
SourceFiles="@(TextOnlyPackageContent)"
|
||||
DestinationFiles="@(TextOnlyPackageContent->'$(TextOnlyPackageTarballDir)$(DirectoryName)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
68
src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj
Normal file
68
src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj
Normal file
|
@ -0,0 +1,68 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||
<RestorePackagesPath>$(TargetPackagesPath)</RestorePackagesPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
The following text-only packages are ones that are consumed by the installer repo, whose
|
||||
versions are dynamic. These are maintained here so the dynamic version numbers can
|
||||
come from the source (eng/Versions.props). All other more static text-only packages
|
||||
should be added to source-build-reference-packages.
|
||||
-->
|
||||
<ItemGroup>
|
||||
<PackageDownload Include="Microsoft.DotNet.Common.ItemTemplates"
|
||||
Version="[$(MicrosoftDotNetCommonItemTemplates21PackageVersion)];
|
||||
[$(MicrosoftDotNetCommonItemTemplates30PackageVersion)];
|
||||
[$(MicrosoftDotNetCommonItemTemplates31PackageVersion)];
|
||||
[$(MicrosoftDotNetCommonItemTemplates50PackageVersion)];
|
||||
[$(MicrosoftDotNetCommonItemTemplates60PackageVersion)]" />
|
||||
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ItemTemplates"
|
||||
Version="[$(AspNetCorePackageVersionFor21Templates)];
|
||||
[$(AspNetCorePackageVersionFor30Templates)];
|
||||
[$(AspNetCorePackageVersionFor31Templates)];
|
||||
[$(AspNetCorePackageVersionFor50Templates)]" />
|
||||
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ItemTemplates.6.0" Version="[$(AspNetCorePackageVersionFor60Templates)]" />
|
||||
|
||||
<PackageDownload Include="Microsoft.DotNet.Common.ProjectTemplates.2.1" Version="[$(MicrosoftDotNetCommonProjectTemplates21PackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Common.ProjectTemplates.3.0" Version="[$(MicrosoftDotNetCommonProjectTemplates30PackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Common.ProjectTemplates.3.1" Version="[$(MicrosoftDotNetCommonProjectTemplates31PackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Common.ProjectTemplates.5.0" Version="[$(MicrosoftDotNetCommonProjectTemplates50PackageVersion)]" />
|
||||
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ProjectTemplates.2.1" Version="[$(AspNetCorePackageVersionFor21Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ProjectTemplates.3.0" Version="[$(AspNetCorePackageVersionFor30Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ProjectTemplates.3.1" Version="[$(AspNetCorePackageVersionFor31Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ProjectTemplates.5.0" Version="[$(AspNetCorePackageVersionFor50Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.ProjectTemplates.6.0" Version="[$(AspNetCorePackageVersionFor60Templates)]" />
|
||||
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.2.1" Version="[$(AspNetCorePackageVersionFor21Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0" Version="[$(AspNetCorePackageVersionFor30Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.3.1" Version="[$(AspNetCorePackageVersionFor31Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.5.0" Version="[$(AspNetCorePackageVersionFor50Templates)]" />
|
||||
<PackageDownload Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0" Version="[$(AspNetCorePackageVersionFor60Templates)]" />
|
||||
|
||||
<PackageDownload Include="Microsoft.NET.Workload.Emscripten.Manifest-6.0.100" Version="[$(EmscriptenWorkloadManifestVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Workload.Mono.ToolChain.Manifest-6.0.100" Version="[$(MonoWorkloadManifestVersion)]" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Write out directories in which text-only packages are downloaded to be consumed by the "CopyTextOnlyPackages"
|
||||
target.
|
||||
-->
|
||||
<Target Name="WriteTextOnlyDirectoryFile" BeforeTargets="Restore">
|
||||
<ItemGroup>
|
||||
<TextOnlyPackagesDirectories Include="$(TargetPackagesPath)$([System.String]::copy('%(PackageDownload.Identity)').ToLower())" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TextOnlyPackageDirectoriesContent>@(TextOnlyPackagesDirectories)</TextOnlyPackageDirectoriesContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile
|
||||
Lines="$(TextOnlyPackageDirectoriesContent)"
|
||||
File="$(TargetPackagesPath)/TextOnlyPackageDirectories.txt"
|
||||
Overwrite="true" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -24,6 +24,7 @@
|
|||
BuildXPlatTasks;
|
||||
ExtractToolPackage;
|
||||
GenerateRootFs;
|
||||
BuildTextOnlyPackages;
|
||||
ApplyPatches;
|
||||
PoisonPrebuiltPackages" />
|
||||
</Target>
|
||||
|
@ -58,7 +59,7 @@
|
|||
<Move SourceFiles="@(UnpackedSourceBuildReferencePackages)" DestinationFiles="$(ReferencePackagesDir)%(Filename)%(Extension)" />
|
||||
|
||||
<!-- remove some reference packages that are generated incorrectly and instead use the prebuilt checked-in version instead -->
|
||||
<!-- relevant issues: https://github.com/dotnet/runtime/issues/44646, https://github.com/dotnet/runtime/issues/45183,
|
||||
<!-- relevant issues: https://github.com/dotnet/runtime/issues/44646, https://github.com/dotnet/runtime/issues/45183,
|
||||
https://github.com/dotnet/runtime/issues/45417. this should be fixed for the 6.0 release. -->
|
||||
<ItemGroup>
|
||||
<PrebuiltPackagesToUse Include="$(PrebuiltPackagesPath)/*.nupkg" />
|
||||
|
@ -133,6 +134,13 @@
|
|||
<TextOnlyPackageNuspecFile Include="$(TextOnlyPackageBaseDir)/**/*.nuspec" />
|
||||
</ItemGroup>
|
||||
|
||||
<Message Importance="High" Text="Found text only package nuspec file: %(TextOnlyPackageNuspecFile.Identity)" />
|
||||
|
||||
<ReplaceTextInFile
|
||||
InputFile="%(TextOnlyPackageNuspecFile.Identity)"
|
||||
OldText="</package>"
|
||||
NewText="<files><file src=".\**\*"/></files></package>" />
|
||||
|
||||
<NugetPack
|
||||
Nuspecs="%(TextOnlyPackageNuspecFile.Identity)"
|
||||
OutputDirectory="$(SourceBuiltPackagesPath)"
|
||||
|
@ -160,7 +168,7 @@
|
|||
OldText="%3CReadSourceBuildIntermediateNupkgDependencies"
|
||||
NewText="%3CReadSourceBuildIntermediateNupkgDependencies Condition="'%24%28DotNetBuildOffline%29' != 'true'"" />
|
||||
|
||||
<!-- Allow overriding of Arcade targets for SourceBuild to enable quicker
|
||||
<!-- Allow overriding of Arcade targets for SourceBuild to enable quicker
|
||||
dev turnaround for Preview 6 -->
|
||||
<ItemGroup>
|
||||
<OverrideArcadeFiles Include="$(ProjectDir)ArcadeOverrides/**/*" />
|
||||
|
|
Loading…
Add table
Reference in a new issue