dotnet-installer/src/SourceBuild/tarball/content/repos/package-source-build.proj
Michael Simons 3454f6cd99
Source-build tweaks to aid release process (#13101)
* Source-build tweaks to aid release process

* Edit per code review
2022-01-24 21:49:05 -06:00

58 lines
2.9 KiB
XML

<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<RepoApiImplemented>false</RepoApiImplemented>
<ProjectDirectory>$(SubmoduleDirectory)$(RepositoryName)/</ProjectDirectory>
<SkipEnsurePackagesCreated>true</SkipEnsurePackagesCreated>
<IncludedPackageVersionPropsFile>$(CurrentSourceBuiltPackageVersionPropsPath)</IncludedPackageVersionPropsFile>
</PropertyGroup>
<ItemGroup>
<RepositoryReference Include="arcade" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Target Name="RepoBuild">
<!-- Copy PVP to packages dir in order to package them together -->
<Copy SourceFiles="$(IncludedPackageVersionPropsFile)" DestinationFiles="$(SourceBuiltPackagesPath)PackageVersions.props" />
<!-- Expand SBRP intermediate package into separate folder and remove intermediate package -->
<PropertyGroup>
<SourceBuildReferencePackagesDestination>$(SourceBuiltPackagesPath)SourceBuildReferencePackages/</SourceBuildReferencePackagesDestination>
<SBRPIntermediateWildcard>Microsoft.SourceBuild.Intermediate.source-build-reference-packages*.nupkg</SBRPIntermediateWildcard>
</PropertyGroup>
<ItemGroup>
<SourceBuildReferencePackagesIntermediatePackage Include="$(SourceBuiltPackagesPath)$(SBRPIntermediateWildcard)"/>
</ItemGroup>
<MakeDir Directories="$(SourceBuildReferencePackagesDestination)" />
<ZipFileExtractToDirectory Condition="'@(SourceBuildReferencePackagesIntermediatePackage)' != ''"
SourceArchive="%(SourceBuildReferencePackagesIntermediatePackage.Identity)"
DestinationDirectory="$(SourceBuildReferencePackagesDestination)extractArtifacts/"
OverwriteDestination="true" />
<ItemGroup>
<SourceBuildReferencePackagesNupkgFiles Include="$(SourceBuildReferencePackagesDestination)extractArtifacts/**/*.nupkg" />
</ItemGroup>
<Copy
Condition="'@(SourceBuildReferencePackagesNupkgFiles)' != ''"
SourceFiles="@(SourceBuildReferencePackagesNupkgFiles)"
DestinationFiles="@(SourceBuildReferencePackagesNupkgFiles -> '$(SourceBuildReferencePackagesDestination)%(Filename)%(Extension)')" />
<RemoveDir
Condition="Exists('$(SourceBuildReferencePackagesDestination)extractArtifacts/')"
Directories="$(SourceBuildReferencePackagesDestination)extractArtifacts/" />
<PropertyGroup>
<SourceBuiltTarballName>$(OutputPath)$(SourceBuiltArtifactsTarballName).$(installerOutputPackageVersion).tar.gz</SourceBuiltTarballName>
</PropertyGroup>
<Exec Command="tar --numeric-owner --exclude='$(SBRPIntermediateWildcard)' -czf $(SourceBuiltTarballName) *.nupkg *.props SourceBuildReferencePackages/" WorkingDirectory="$(SourceBuiltPackagesPath)" />
<Message Importance="High" Text="Packaged source-built artifacts to $(SourceBuiltTarballName)" />
</Target>
</Project>