|
| 1 | +<Project Sdk="Microsoft.Build.NoTargets"> |
| 2 | + <PropertyGroup> |
| 3 | + <SkipBuild Condition="'$(RuntimeFlavor)' != '$(PrimaryRuntimeFlavor)' or '$(TargetsMobile)' == 'true'">true</SkipBuild> |
| 4 | + <GenerateInstallers Condition="'$(BuildRpmPackage)' != 'true'">false</GenerateInstallers> |
| 5 | + <InstallerName>netstandard-targeting-pack-2.1</InstallerName> |
| 6 | + <PackageBrandNameSuffix>NETStandard.Library.Ref</PackageBrandNameSuffix> |
| 7 | + <ProductBrandName>NETStandard.Library.Ref 2.1.0</ProductBrandName> |
| 8 | + <VersionInstallerName>false</VersionInstallerName> |
| 9 | + <PlatformPackageType>ToolPack</PlatformPackageType> |
| 10 | + <UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription> |
| 11 | + <OriginalNETStandard21PkgFilename>netstandard-targeting-pack-2.1.0-x64.rpm</OriginalNETStandard21PkgFilename> |
| 12 | + <NETStandard21PkgDownloadUrl>https://dotnetcli.blob.core.windows.net/dotnet/Runtime/3.1.0/$(OriginalNETStandard21PkgFilename)</NETStandard21PkgDownloadUrl> |
| 13 | + <NETStandard21TempDir>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', 'download'))</NETStandard21TempDir> |
| 14 | + <NETStandard21PkgDestinationPath>$(NETStandard21TempDir)$(OriginalNETStandard21PkgFilename)</NETStandard21PkgDestinationPath> |
| 15 | + <NETStandard21PkgDownloadSemaphore>$(NETStandard21TempDir)netstandard21.semaphore</NETStandard21PkgDownloadSemaphore> |
| 16 | + </PropertyGroup> |
| 17 | + |
| 18 | + <UsingTask TaskName="DownloadFile" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" /> |
| 19 | + |
| 20 | + <Target Name="AcquireNETStandard21PackageContents" |
| 21 | + Inputs="$(NETStandard21PkgDestinationPath)" |
| 22 | + Outputs="$(NETStandard21PkgDownloadSemaphore)"> |
| 23 | + |
| 24 | + <RemoveDir Directories="$(NETStandard21TempDir)" /> |
| 25 | + |
| 26 | + <DownloadFile |
| 27 | + Uri="$(NETStandard21PkgDownloadUrl)" |
| 28 | + DestinationPath="$(NETStandard21PkgDestinationPath)" |
| 29 | + Overwrite="true" |
| 30 | + TimeoutInSeconds="9999" /> |
| 31 | + |
| 32 | + <Exec Command="rpm2cpio $(NETStandard21PkgDestinationPath) | cpio -idmv" |
| 33 | + WorkingDirectory="$(NETStandard21TempDir)" /> |
| 34 | + |
| 35 | + <WriteLinesToFile |
| 36 | + File="$(NETStandard21PkgDownloadSemaphore)" |
| 37 | + Lines="$(NETStandard21PkgDownloadUrl)" |
| 38 | + Overwrite="true" |
| 39 | + Encoding="Unicode" /> |
| 40 | + |
| 41 | + </Target> |
| 42 | + |
| 43 | + <Target Name="PublishToDisk" |
| 44 | + DependsOnTargets="AcquireNETStandard21PackageContents"> |
| 45 | + <Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." /> |
| 46 | + |
| 47 | + <ItemGroup> |
| 48 | + <Content Include="$(NETStandard21TempDir)usr/share/dotnet/**/*" /> |
| 49 | + </ItemGroup> |
| 50 | + |
| 51 | + <Copy SourceFiles="@(Content)" |
| 52 | + DestinationFolder="$(OutputPath)/%(RecursiveDir)" /> |
| 53 | + </Target> |
| 54 | + |
| 55 | + <Target Name="AddLinuxPackageInformation" BeforeTargets="GetRpmInstallerJsonProperties"> |
| 56 | + <ItemGroup> |
| 57 | + <RpmJsonProperty Include="directories" Object="[ "/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0", "/usr/share/doc/netstandard-targeting-pack-2.1" ]" /> |
| 58 | + </ItemGroup> |
| 59 | + </Target> |
| 60 | +</Project> |
0 commit comments