deployment-tools/Directory.Build.props

93 строки
5.3 KiB
XML

<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<!-- Provides a way to override ClickOnce configuration. -->
<PropertyGroup>
<ClickOnceConfiguration Condition="'$(ClickOnceConfiguration)' == ''">$(Configuration)</ClickOnceConfiguration>
</PropertyGroup>
<PropertyGroup Label="CalculateTargetOS">
<BuildOS>linux</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('FREEBSD'))">freebsd</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('NETBSD'))">netbsd</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('ILLUMOS'))">illumos</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('SOLARIS'))">solaris</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('HAIKU'))">haiku</BuildOS>
<BuildOS Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">windows</BuildOS>
<TargetOS Condition="'$(TargetOS)' == ''">$(BuildOS)</TargetOS>
<HostOS Condition="'$(HostOS)' == ''">$(TargetOS)</HostOS>
</PropertyGroup>
<PropertyGroup Label="CalculateArch">
<!-- Build architecture is what we are building on. -->
<BuildArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</BuildArchitecture>
<!-- The target architecture is the what the customer is targeting their outputs to run on. -->
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">$(BuildArchitecture)</TargetArchitecture>
<!-- The host architecture is the what the customer will build on. Much of the time, Host==Target. -->
<HostArchitecture Condition="'$(HostArchitecture)' == ''">$(TargetArchitecture)</HostArchitecture>
</PropertyGroup>
<PropertyGroup Label="CalculateRID">
<BuildRid Condition="'$(BuildRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</BuildRid>
<BuildRid Condition="'$(BuildRid)' == '' and '$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</BuildRid>
<TargetRid Condition="'$(TargetRid)' == ''">$(BuildRid.Substring(0, $(BuildRid.LastIndexOf('-'))))-$(TargetArchitecture)</TargetRid>
<HostRid Condition="'$(HostRid)' == ''">$(TargetRid)</HostRid>
<!-- Source-only builds are non portable, except for cross-builds.
Source-only cross-builds default to the portable configuration so the resulting SDK works on a wider range of distros. -->
<PortableBuild Condition="'$(PortableBuild)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(BuildArchitecture)' == '$(TargetArchitecture)'">false</PortableBuild>
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'freebsd'">freebsd-$(TargetArchitecture)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'osx'">osx-$(TargetArchitecture)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'linux'">linux-$(TargetArchitecture)</PortableRid>
<PortableRid Condition="$(TargetRid.StartsWith('linux-musl')) or $(TargetRid.StartsWith('alpine'))">linux-musl-$(TargetArchitecture)</PortableRid>
<PortableRid Condition="'$(PortableRid)' == '' and '$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</PortableRid>
<TargetRid Condition="'$(PortableBuild)' == 'true' and '$(PortableRid)' != ''">$(PortableRid)</TargetRid>
</PropertyGroup>
<!-- Packaging properties -->
<PropertyGroup>
<!--
This name is used to create a GIT repository URL https://github.com/dotnet/$(GitHubRepositoryName) used
to find source code for debugging. It is also used to name the build output manifest for orchestrated builds.
-->
<GitHubRepositoryName>deployment-tools</GitHubRepositoryName>
<RepositoryUrl>https://github.com/dotnet/deployment-tools</RepositoryUrl>
<ProjectUrl>https://github.com/dotnet/deployment-tools</ProjectUrl>
<LicenseUrl>https://github.com/dotnet/deployment-tools/blob/main/LICENSE.TXT</LicenseUrl>
<LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>
<ThirdPartyNoticesFile>$(RepoRoot)THIRD-PARTY-NOTICES.TXT</ThirdPartyNoticesFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
<!-- Keep it in sync with PRERELEASE in eng/native/configureplatform.cmake -->
<IsPrerelease>true</IsPrerelease>
</PropertyGroup>
<ItemGroup>
<Content Include="$(LicenseFile)"
Pack="true"
PackagePath="/" />
<Content Include="$(ThirdPartyNoticesFile)"
Pack="true"
PackagePath="/" />
</ItemGroup>
<PropertyGroup>
<!-- Language configuration -->
<Deterministic>true</Deterministic>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisRuleset>$(RepositoryEngineeringDir)CodeAnalysis.ruleset</CodeAnalysisRuleset>
<!-- Only upgrade NuGetAudit warnings to errors for official builds. -->
<WarningsNotAsErrors Condition="'$(OfficialBuild)' != 'true'">$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
</Project>