|
| 1 | +<Project Sdk="Microsoft.Build.NoTargets"> |
| 2 | + |
| 3 | + <PropertyGroup> |
| 4 | + <SkipBuild Condition="'$(BuildSdkDeb)' != 'true' and '$(IsRPMBasedDistro)' != 'true'">true</SkipBuild> |
| 5 | + <TargetFramework>$(SdkTargetFramework)</TargetFramework> |
| 6 | + <RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier> |
| 7 | + <GenerateInstallers>true</GenerateInstallers> |
| 8 | + <BuildDebPackage Condition="'$(BuildSdkDeb)' == 'true'">true</BuildDebPackage> |
| 9 | + <BuildRpmPackage Condition="'$(IsRPMBasedDistro)' == 'true'">true</BuildRpmPackage> |
| 10 | + <UseArcadeRpmTooling>true</UseArcadeRpmTooling> |
| 11 | + <ProductBrandPrefix>Microsoft .NET</ProductBrandPrefix> |
| 12 | + <LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile> |
| 13 | + <InstallerName>dotnet-sdk</InstallerName> |
| 14 | + <PackageBrandNameSuffix>SDK</PackageBrandNameSuffix> |
| 15 | + <!-- |
| 16 | + Installer infra requires MajorVersion and MinorVersion, which triggers reevaluation of Arcade's |
| 17 | + VersionPrefix property. This requires PatchVersion to be set in order to produce the correct SDK version. |
| 18 | + --> |
| 19 | + <MajorVersion>$(VersionMajor)</MajorVersion> |
| 20 | + <MinorVersion>$(VersionMinor)</MinorVersion> |
| 21 | + <PatchVersion>$(VersionPrefix.Split('.')[2])</PatchVersion> |
| 22 | + <!-- |
| 23 | + All supported installer runtime identifiers should be specified here. |
| 24 | + New arcade infra is only used for Linux installers, at the moment. |
| 25 | + --> |
| 26 | + <InstallerRuntimeIdentifiers>linux-$(Architecture)</InstallerRuntimeIdentifiers> |
| 27 | + <IsShippingPackage>true</IsShippingPackage> |
| 28 | + </PropertyGroup> |
| 29 | + |
| 30 | + <ItemGroup> |
| 31 | + <ProjectReference Include="..\redist-installer\redist-installer.csproj" ReferenceOutputAssembly="false" /> |
| 32 | + </ItemGroup> |
| 33 | + |
| 34 | + <ItemGroup> |
| 35 | + <PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" /> |
| 36 | + </ItemGroup> |
| 37 | + |
| 38 | + <Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" /> |
| 39 | + |
| 40 | + <PropertyGroup> |
| 41 | + <RedistLayoutPath>$(ArtifactsBinDir)redist-installer\$(Configuration)\dotnet\</RedistLayoutPath> |
| 42 | + <ManpagesDirectory>$(RepoRoot)documentation/manpages/sdk</ManpagesDirectory> |
| 43 | + <CLISdkRoot>$(RedistLayoutPath)sdk/</CLISdkRoot> |
| 44 | + <TemplatesRoot>$(RedistLayoutPath)templates/</TemplatesRoot> |
| 45 | + </PropertyGroup> |
| 46 | + |
| 47 | + <Target Name="PublishToDisk"> |
| 48 | + <Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." /> |
| 49 | + |
| 50 | + <ItemGroup> |
| 51 | + <CLISdkFiles Include="$(CLISdkRoot)**/*" /> |
| 52 | + <TemplatesFiles Include="$(TemplatesRoot)**/*" /> |
| 53 | + <ManifestFiles Include="$(RedistLayoutPath)sdk-manifests/**/*" /> |
| 54 | + </ItemGroup> |
| 55 | + |
| 56 | + <!-- Create layout: Binaries --> |
| 57 | + <Copy |
| 58 | + DestinationFiles="@(CLISdkFiles->'$(OutputPath)/sdk/%(RecursiveDir)%(Filename)%(Extension)')" |
| 59 | + SourceFiles="@(CLISdkFiles)" |
| 60 | + OverwriteReadOnlyFiles="True" |
| 61 | + SkipUnchangedFiles="False" |
| 62 | + UseHardlinksIfPossible="False" /> |
| 63 | + |
| 64 | + <!-- Create layout: Templates --> |
| 65 | + <Copy |
| 66 | + DestinationFiles="@(TemplatesFiles->'$(OutputPath)/templates/%(RecursiveDir)%(Filename)%(Extension)')" |
| 67 | + SourceFiles="@(TemplatesFiles)" |
| 68 | + OverwriteReadOnlyFiles="True" |
| 69 | + SkipUnchangedFiles="False" |
| 70 | + UseHardlinksIfPossible="False" /> |
| 71 | + |
| 72 | + <!-- Create layout: Workload Manifests --> |
| 73 | + <Copy |
| 74 | + DestinationFiles="@(ManifestFiles->'$(OutputPath)/sdk-manifests/%(RecursiveDir)%(Filename)%(Extension)')" |
| 75 | + SourceFiles="@(ManifestFiles)" |
| 76 | + OverwriteReadOnlyFiles="True" |
| 77 | + SkipUnchangedFiles="False" |
| 78 | + UseHardlinksIfPossible="False" /> |
| 79 | + </Target> |
| 80 | + |
| 81 | + <Target Name="SetCustomPackagingProperties" AfterTargets="_GetInstallerProperties"> |
| 82 | + <PropertyGroup> |
| 83 | + <PackageSummary>Microsoft .NET SDK $(PackageVersion)</PackageSummary> |
| 84 | + <!-- Clear PackageDescription to have it correctly set by Arcade. --> |
| 85 | + <PackageDescription></PackageDescription> |
| 86 | + </PropertyGroup> |
| 87 | + |
| 88 | + <!-- |
| 89 | + Manpages are not installed atm, tracked with https://github.com/dotnet/sdk/issues/44833 |
| 90 | + Arcade infra expects the following items, but the installation path is TBD. |
| 91 | + Tracked in https://github.com/dotnet/arcade/issues/15243 |
| 92 | +
|
| 93 | + <ItemGroup> |
| 94 | + <Manpage Include="$(ManpagesDirectory)**/*" /> |
| 95 | + </ItemGroup> |
| 96 | + --> |
| 97 | + |
| 98 | + </Target> |
| 99 | + |
| 100 | + <Target Name="AddLinuxPackageInformation" |
| 101 | + BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties" |
| 102 | + DependsOnTargets="CalculateLinuxNativeInstallerDependencyVersions"> |
| 103 | + |
| 104 | + <PropertyGroup> |
| 105 | + <DebianPostinstTemplateFile>$(MSBuildThisFileDirectory)../redist-installer/packaging/deb/postinst</DebianPostinstTemplateFile> |
| 106 | + <DebianPostinstFile>$(BaseIntermediateOutputPath)debian/postinst</DebianPostinstFile> |
| 107 | + </PropertyGroup> |
| 108 | + |
| 109 | + <!-- Generate postinst file --> |
| 110 | + <ReplaceFileContents |
| 111 | + InputFiles="$(DebianPostinstTemplateFile)" |
| 112 | + DestinationFiles="$(DebianPostinstFile)" |
| 113 | + ReplacementPatterns="%SDK_VERSION%" |
| 114 | + ReplacementStrings="$(Version)" |
| 115 | + Condition="'$(BuildDebPackage)' == 'true'" /> |
| 116 | + |
| 117 | + <ItemGroup> |
| 118 | + <LinuxPackageDependency Include="dotnet-runtime-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRuntimePackageVersionWithTilde)" /> |
| 119 | + <LinuxPackageDependency Include="dotnet-targeting-pack-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRefPackageVersionWithTilde)" /> |
| 120 | + <LinuxPackageDependency Include="dotnet-apphost-pack-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRuntimePackageVersionWithTilde)" /> |
| 121 | + <LinuxPackageDependency Include="netstandard-targeting-pack-$(NetStandardTargetingPackMajorMinorVersion)" Version="$(NetStandardTargetingPackPackageVersionWithTilde)" /> |
| 122 | + <LinuxPackageDependency Include="aspnetcore-runtime-$(AspNetCoreMajorMinorVersion)" Version="$(AspNetCoreRuntimeVersionWithTilde)" /> |
| 123 | + <LinuxPackageDependency Include="aspnetcore-targeting-pack-$(AspNetCoreMajorMinorVersion)" Version="$(AspNetCoreRefVersionWithTilde)" /> |
| 124 | + <LinuxPostInstallScript Include="$(DebianPostinstFile)" Condition="'$(BuildDebPackage)' == 'true'" /> |
| 125 | + </ItemGroup> |
| 126 | + </Target> |
| 127 | + |
| 128 | + <Target Name="CalculateLinuxNativeInstallerDependencyVersions"> |
| 129 | + <GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"> |
| 130 | + <Output TaskParameter="VersionWithTilde" PropertyName="MicrosoftNETCoreAppRuntimePackageVersionWithTilde" /> |
| 131 | + <Output TaskParameter="MajorMinorVersion" PropertyName="MicrosoftNETCoreAppMajorMinorVersion" /> |
| 132 | + <Output TaskParameter="MajorMinorPatchVersion" PropertyName="MicrosoftNETCoreAppMajorMinorPatchVersion" /> |
| 133 | + </GetLinuxNativeInstallerDependencyVersions> |
| 134 | + |
| 135 | + <GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"> |
| 136 | + <Output TaskParameter="VersionWithTilde" PropertyName="MicrosoftNETCoreAppRefPackageVersionWithTilde" /> |
| 137 | + </GetLinuxNativeInstallerDependencyVersions> |
| 138 | + |
| 139 | + <GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersion)"> |
| 140 | + <Output TaskParameter="VersionWithTilde" PropertyName="AspNetCoreRuntimeVersionWithTilde" /> |
| 141 | + <Output TaskParameter="MajorMinorVersion" PropertyName="AspNetCoreMajorMinorVersion" /> |
| 142 | + <Output TaskParameter="MajorMinorVersion" PropertyName="AspNetCoreMajorMinorPatchVersion" /> |
| 143 | + </GetLinuxNativeInstallerDependencyVersions> |
| 144 | + |
| 145 | + <GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)"> |
| 146 | + <Output TaskParameter="VersionWithTilde" PropertyName="AspNetCoreRefVersionWithTilde" /> |
| 147 | + </GetLinuxNativeInstallerDependencyVersions> |
| 148 | + |
| 149 | + <GetLinuxNativeInstallerDependencyVersions PackageVersion="$(HostFxrVersion)"> |
| 150 | + <Output TaskParameter="MajorMinorVersion" PropertyName="HostFxrMajorMinorVersion" /> |
| 151 | + </GetLinuxNativeInstallerDependencyVersions> |
| 152 | + |
| 153 | + <GetLinuxNativeInstallerDependencyVersions PackageVersion="$(NETStandardLibraryRefPackageVersion)"> |
| 154 | + <Output TaskParameter="VersionWithTilde" PropertyName="NetStandardTargetingPackPackageVersionWithTilde" /> |
| 155 | + <Output TaskParameter="MajorMinorVersion" PropertyName="NetStandardTargetingPackMajorMinorVersion" /> |
| 156 | + <Output TaskParameter="MajorMinorPatchVersion" PropertyName="NetStandardTargetingPackMajorMinorPatchVersion" /> |
| 157 | + </GetLinuxNativeInstallerDependencyVersions> |
| 158 | + </Target> |
| 159 | + |
| 160 | +</Project> |
0 commit comments