2017-06-29 19:25:49 +02:00
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2020-11-18 19:13:09 +01:00
<Import Project=".\Analyzers.props" />
2017-09-07 00:20:25 +02:00
<!--
The 'version' property is populated with the default value in 'Microsoft.NET.DefaultAssemblyInfo.targets'
*before* any targets get a chance to execute.
We need to *explicitly* re-assign the 'version' property and other version tags in this target.
In order for the versions assigned here to take effect, we need to execute this target at an early stage:
before 'Restore' target - '_GenerateRestoreProjectSpec'
before 'Pack' target - 'GenerateNuspec'
before 'Build' target - 'BeforeBuild'
-->
<Target Name="GetPSCoreVersionFromGit"
BeforeTargets="_GenerateRestoreProjectSpec;GenerateNuspec;BeforeBuild"
>
<Exec Command='git describe --abbrev=60 --long'
WorkingDirectory="$(MSBuildProjectDirectory)"
ConsoleToMSBuild="true"
StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="PowerShellVersion" />
</Exec>
<PropertyGroup Condition = "'$(ReleaseTag)' != ''">
<PSCoreBuildVersion>$(ReleaseTag)</PSCoreBuildVersion>
</PropertyGroup>
<PropertyGroup>
<RegexGitVersion>^v(.+)-(\d+)-g(.+)</RegexGitVersion>
<PSCoreBuildVersion Condition = "'$(PSCoreBuildVersion)' == ''">$([System.Text.RegularExpressions.Regex]::Match($(PowerShellVersion), $(RegexGitVersion)).Groups[1].Value)</PSCoreBuildVersion>
<PSCoreAdditionalCommits>$([System.Text.RegularExpressions.Regex]::Match($(PowerShellVersion), $(RegexGitVersion)).Groups[2].Value)</PSCoreAdditionalCommits>
<PSCoreCommitSHA>$([System.Text.RegularExpressions.Regex]::Match($(PowerShellVersion), $(RegexGitVersion)).Groups[3].Value)</PSCoreCommitSHA>
2017-09-28 18:27:43 +02:00
<!--
Caution! 'PSVersion' and 'GitCommitId' from 'PSVersionInfo.cs' depend on the format of this version string.
-->
2017-09-07 00:20:25 +02:00
<PSCoreFormattedVersion Condition = "'$(ReleaseTag)' != '' or '$(PSCoreAdditionalCommits)' == '0'">$(PSCoreBuildVersion) SHA: $(PSCoreCommitSHA)</PSCoreFormattedVersion>
<PSCoreFormattedVersion Condition = "'$(PSCoreFormattedVersion)' == ''">$(PSCoreBuildVersion) Commits: $(PSCoreAdditionalCommits) SHA: $(PSCoreCommitSHA)</PSCoreFormattedVersion>
<!-- Extract the major, minor and patch version numbers, as well as the preview label.
They are currently not used anywhere, so we comment them out for now.
<RegexSymVer>^((\d+).(\d+).(\d+))(?:-(.+))?</RegexSymVer>
<PSCorePrefixVersion>$([System.Text.RegularExpressions.Regex]::Match($(PSCoreBuildVersion), $(RegexSymVer)).Groups[1].Value)</PSCorePrefixVersion>
<PSCoreMajorVersion>$([System.Text.RegularExpressions.Regex]::Match($(PSCoreBuildVersion), $(RegexSymVer)).Groups[2].Value)</PSCoreMajorVersion>
<PSCoreMinorVersion>$([System.Text.RegularExpressions.Regex]::Match($(PSCoreBuildVersion), $(RegexSymVer)).Groups[3].Value)</PSCoreMinorVersion>
<PSCorePatchVersion>$([System.Text.RegularExpressions.Regex]::Match($(PSCoreBuildVersion), $(RegexSymVer)).Groups[4].Value)</PSCorePatchVersion>
<PSCoreLabelVersion>$([System.Text.RegularExpressions.Regex]::Match($(PSCoreBuildVersion), $(RegexSymVer)).Groups[5].Value)</PSCoreLabelVersion>
-->
<!--
Here we define explicitly 'Version' to set 'FileVersion' and 'AssemblyVersion' by 'GetAssemblyVersion' target in 'Microsoft.NET.GenerateAssemblyInfo.targets'.
Here we define explicitly 'InformationalVersion' because by default it is defined as 'Version' by 'GetAssemblyVersion' target in 'Microsoft.NET.GenerateAssemblyInfo.targets'.
-->
<Version>$(PSCoreBuildVersion)</Version>
<InformationalVersion>$(PSCoreFormattedVersion)</InformationalVersion>
<ProductVersion>$(PSCoreFormattedVersion)</ProductVersion>
<!--
2020-04-30 18:35:54 +02:00
We have to explicitly assign 'PackageVersion' here because we're changing 'Version' in a target.
Before any targets have run (during static evaluation), 'Version' will have defaulted to '1.0.0' and PackageVersion will have defaulted to 'Version'.
See https://github.com/dotnet/sdk/issues/1557
2017-09-07 00:20:25 +02:00
-->
<PackageVersion>$(PSCoreBuildVersion)</PackageVersion>
2020-04-30 18:35:54 +02:00
2019-05-21 07:43:51 +02:00
<ApplicationIcon Condition="$(ProductVersion.Contains('preview'))">..\..\assets\Powershell_av_colors.ico</ApplicationIcon>
2020-07-21 16:53:51 +02:00
<ApplicationIcon Condition="$(ProductVersion.Contains('daily'))">..\..\assets\Powershell_avatar.ico</ApplicationIcon>
<ApplicationIcon Condition="!$(ProductVersion.Contains('preview')) And !$(ProductVersion.Contains('daily'))">..\..\assets\Powershell_black.ico</ApplicationIcon>
2017-09-07 00:20:25 +02:00
</PropertyGroup>
<!-- Output For Debugging
<WriteLinesToFile File="targetfile1.txt"
Lines="ReleaseTag=$(ReleaseTag);
PowerShellVersion=$(PowerShellVersion);
PSCoreBuildVersion = $(PSCoreBuildVersion);
PSCoreAdditionalCommits = $(PSCoreAdditionalCommits);
PSCoreCommitSHA = $(PSCoreCommitSHA);
PSCoreMajorVersion = $(PSCoreMajorVersion);
PSCoreMinorVersion = $(PSCoreMinorVersion);
PSCorePatchVersion = $(PSCorePatchVersion);
PSCoreLabelVersion = $(PSCoreLabelVersion);
RegexGitVersion = $(RegexGitVersion);
PSCoreFormattedVersion = $(PSCoreFormattedVersion);
ProductVersion = $(ProductVersion);
Version = $(Version);
ProjectVersion = '!$(ProjectVersion)!'
InformationalVersion = $(InformationalVersion);
"
Overwrite="true" />
-->
</Target>
2017-06-29 19:25:49 +02:00
<PropertyGroup>
2019-05-11 00:34:27 +02:00
<Product>PowerShell</Product>
2017-06-29 19:25:49 +02:00
<Company>Microsoft Corporation</Company>
2020-05-20 14:02:38 +02:00
<Copyright>(c) Microsoft Corporation.</Copyright>
2017-06-29 19:25:49 +02:00
2021-02-09 02:13:33 +01:00
<TargetFramework>net6.0</TargetFramework>
2020-09-23 23:04:01 +02:00
<LangVersion>9.0</LangVersion>
2020-07-10 17:55:49 +02:00
<PublishReadyToRun Condition=" '$(Configuration)' != 'Debug' ">true</PublishReadyToRun>
2017-06-30 22:07:14 +02:00
2017-06-29 19:25:49 +02:00
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2018-05-03 01:58:39 +02:00
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
2017-06-30 22:07:14 +02:00
<NeutralLanguage>en-US</NeutralLanguage>
2017-06-29 19:25:49 +02:00
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>../signing/visualstudiopublic.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
2017-11-15 19:12:03 +01:00
<HighEntropyVA>true</HighEntropyVA>
2017-06-29 19:25:49 +02:00
</PropertyGroup>
2017-09-07 00:20:25 +02:00
2018-05-15 00:01:44 +02:00
<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
2019-04-16 23:14:29 +02:00
<IsWindows Condition="'$(IsWindows)' =='true' or ( '$(IsWindows)' == '' and '$(OS)' == 'Windows_NT')">true</IsWindows>
2018-05-15 00:01:44 +02:00
</PropertyGroup>
<!-- Define non-windows, all configuration properties -->
<PropertyGroup Condition=" '$(IsWindows)' != 'true' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>
2018-07-13 06:00:35 +02:00
2018-05-15 00:01:44 +02:00
<!-- Define all OS, debug configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>
<!-- Define all OS, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>true</Optimize>
</PropertyGroup>
<!-- Define windows, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' And '$(IsWindows)' == 'true' ">
<Optimize>true</Optimize>
2019-04-14 04:00:30 +02:00
<!-- This is required to be full for compliance tools !-->
2018-05-15 00:01:44 +02:00
<DebugType>full</DebugType>
</PropertyGroup>
<!-- Define non-windows, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' And '$(IsWindows)' != 'true' ">
<!-- Set-Date fails with optimize enabled in NonWindowsSetDate
Debugging the issues resolves the problem
-->
<Optimize>false</Optimize>
<DebugType>portable</DebugType>
</PropertyGroup>
<!-- Define all OS, CodeCoverage configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
2019-04-14 04:00:30 +02:00
<!-- This is required to be portable to Coverlet tool !-->
<DebugType>portable</DebugType>
2018-05-15 00:01:44 +02:00
</PropertyGroup>
2020-10-23 20:39:06 +02:00
<PropertyGroup>
<Features>strict</Features>
</PropertyGroup>
2020-11-01 08:33:18 +01:00
<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
2017-06-29 19:25:49 +02:00
</Project>