dotnet-installer/src/SourceBuild/tarball/content/scripts/bootstrap/buildBootstrapPreviouslySB.csproj

62 lines
3.7 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(MSBuildProjectDirectory)/PackageVersions.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<BaseOutputPath>$(MSBuildProjectDirectory)/artifacts/</BaseOutputPath>
<RestorePackagesPath>$(MSBuildProjectDirectory)/artifacts/restoredPkgs/</RestorePackagesPath>
<UnpackedTarPath>$(MSBuildProjectDirectory)/artifacts/unpacked/</UnpackedTarPath>
<NewTarballName>$(ArchiveDir)Private.SourceBuilt.Artifacts.Bootstrap.tar.gz</NewTarballName>
</PropertyGroup>
<ItemGroup>
<!-- These packages will be replaced with ms-built packages downloaded from official package feeds-->
<PackageReference Include="Microsoft.NET.HostModel" Version="$(MicrosoftNETHostModelVersion)" />
<PackageReference Include="Microsoft.ILVerification" Version="$(MicrosoftILVerificationVersion)" />
<PackageReference Include="Microsoft.NET.Sdk.IL" Version="$(MicrosoftNETSdkILVersion)" />
<PackageReference Include="Microsoft.NETCore.ILAsm" Version="$(MicrosoftNETCoreILAsmVersion)" />
<PackageReference Include="Microsoft.NETCore.ILDAsm" Version="$(MicrosoftNETCoreILDAsmVersion)" />
<PackageReference Include="Microsoft.NETCore.TestHost" Version="$(MicrosoftNETCoreTestHostVersion)" />
<PackageReference Include="runtime.linux-x64.Microsoft.NETCore.ILAsm" Version="$(RuntimeLinuxX64MicrosoftNETCoreILAsmVersion)" />
<PackageReference Include="runtime.linux-x64.Microsoft.NETCore.ILDAsm" Version="$(RuntimeLinuxX64MicrosoftNETCoreILDAsmVersion)" />
<PackageReference Include="runtime.linux-x64.Microsoft.NETCore.TestHost" Version="$(RuntimeLinuxX64MicrosoftNETCoreTestHostVersion)" />
<PackageReference Include="runtime.linux-x64.runtime.native.System.IO.Ports" Version="$(RuntimeLinuxX64RuntimeNativeSystemIOPortsVersion)" />
</ItemGroup>
<Target Name="BuildBoostrapPreviouslySourceBuilt" AfterTargets="Restore">
<ItemGroup>
<RestoredNupkgs Include="$(RestorePackagesPath)**/*.nupkg" />
<PrevSBArchive Include="$(ArchiveDir)Private.SourceBuilt.Artifacts.*.tar.gz" />
</ItemGroup>
<!-- Copy restored nupkg files to root of restored packages dir so they're all in one place-->
<Copy SourceFiles="@(RestoredNupkgs)" DestinationFolder="$(RestorePackagesPath)" />
<!-- Check to ensure there is only one previously source-built archive -->
<Error Text="Multiple Private.SourceBuilt.Artifacts.*.tar.gz tarballs exists at $(ArchiveDir). Expecting only one."
Condition="'@(PrevSBArchive->Count())' != '1'" />
<!-- Unpack existing archive -->
<Message Text=" Unpacking existing tarball from %(PrevSBArchive.Identity)" Importance="High" />
<MakeDir Directories="$(UnpackedTarPath)" />
<Exec Command="tar -xzf %(PrevSBArchive.Identity) -C $(UnpackedTarPath)" />
<!-- Delete existing archive -->
<Message Text=" Deleting existing tarball: %(PrevSBArchive.Identity)" Importance="High" />
<Delete Files="%(PrevSBArchive.Identity)" />
<!-- Copy files specified in package references above from restored package dir to unpacked archive dir -->
<Message Text=" Replacing restored files in $(UnpackedTarPath)" Importance="High" />
<Copy
SourceFiles="$(RestorePackagesPath)$([System.String]::copy('%(PackageReference.Identity)').ToLower()).%(PackageReference.Version).nupkg"
DestinationFiles="$(UnpackedTarPath)%(PackageReference.Identity).%(PackageReference.Version).nupkg" />
<!-- Repack tarball with new bootstrap name -->
<Message Text=" Repacking tarball to $(NewTarballName)" Importance="High" />
<Exec Command="tar --numeric-owner -czf $(NewTarballName) *.nupkg *.props SourceBuildReferencePackages/" WorkingDirectory="$(UnpackedTarPath)" />
</Target>
</Project>