2017-06-30 01:25:49 +08:00
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2020-11-19 02:13:09 +08:00
<Import Project=".\Analyzers.props" />
2017-09-07 06:20:25 +08: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)' != ''">
2021-03-24 02:03:05 +08:00
<!--
DO NOT UPDATE without reviewing with the Microsoft update plan.
7.2.0-preview.1
__a__.__b____.c
a = Version part and is group 1 of the regex
b = the Semantic version prerelease name. This is optional.
c = The semantic version prerelease iteration. This is optional and only allowed of the prerelease name is present.
Our version will become the version part with the prerelease iteration being the revision (the 4th part of the version).
For RCs, we will increment the iteration from 100.
Examples
7.2.0 becomes 7.2.0
7.2.0-preview.1 becomes 7.2.0.1
7.2.0-rc.1 becomes 7.2.0.101
-->
<!-- parse the release tag into the parts we need -->
<RegexReleaseTag>^((\d+).(\d+).(\d+))(-(\w+)(.(\d+))?)?$</RegexReleaseTag>
<ReleaseTagVersionPart>$([System.Text.RegularExpressions.Regex]::Match($(ReleaseTag), $(RegexReleaseTag)).Groups[1].Value)</ReleaseTagVersionPart>
<ReleaseTagSemVersionPart>$([System.Text.RegularExpressions.Regex]::Match($(ReleaseTag), $(RegexReleaseTag)).Groups[8].Value)</ReleaseTagSemVersionPart>
<ReleaseTagSemVersionPrereleaseNamePart>$([System.Text.RegularExpressions.Regex]::Match($(ReleaseTag), $(RegexReleaseTag)).Groups[6].Value)</ReleaseTagSemVersionPrereleaseNamePart>
<!-- Increment revision 100 for rc releases -->
<RCIncrementValue>100</RCIncrementValue>
2021-06-16 04:44:08 +08:00
<!-- Increment revision 500 for GA releases -->
<GAIncrementValue>500</GAIncrementValue>
2021-03-24 02:03:05 +08:00
<ReleaseTagSemVersionPart Condition = "'$(ReleaseTagSemVersionPrereleaseNamePart)' == 'rc'">$([MSBuild]::Add($(ReleaseTagSemVersionPart), $(RCIncrementValue)))</ReleaseTagSemVersionPart>
<!-- Create the internal version -->
2017-09-07 06:20:25 +08:00
<PSCoreBuildVersion>$(ReleaseTag)</PSCoreBuildVersion>
2021-03-24 02:03:05 +08:00
<!-- Create the version if we have a pre-release -->
<PSCoreFileVersion Condition = "'$(ReleaseTagSemVersionPart)' != ''">$(ReleaseTagVersionPart).$(ReleaseTagSemVersionPart)</PSCoreFileVersion>
<!-- Create the version if we have a release build -->
2021-06-16 04:44:08 +08:00
<PSCoreFileVersion Condition = "'$(PSCoreFileVersion)' == ''">$(ReleaseTagVersionPart).$(GAIncrementValue)</PSCoreFileVersion>
2017-09-07 06:20:25 +08:00
</PropertyGroup>
<PropertyGroup>
<RegexGitVersion>^v(.+)-(\d+)-g(.+)</RegexGitVersion>
2021-03-24 02:03:05 +08:00
<PSCoreFileVersion Condition = "'$(PSCoreFileVersion)' == ''">$([System.Text.RegularExpressions.Regex]::Match($(PowerShellVersion), $(RegexGitVersion)).Groups[1].Value)</PSCoreFileVersion>
2017-09-07 06:20:25 +08:00
<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-29 00:27:43 +08:00
<!--
Caution! 'PSVersion' and 'GitCommitId' from 'PSVersionInfo.cs' depend on the format of this version string.
-->
2017-09-07 06:20:25 +08: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'.
-->
2021-03-24 02:03:05 +08:00
<Version>$(PSCoreFileVersion)</Version>
2017-09-07 06:20:25 +08:00
<InformationalVersion>$(PSCoreFormattedVersion)</InformationalVersion>
<ProductVersion>$(PSCoreFormattedVersion)</ProductVersion>
<!--
2020-05-01 00:35:54 +08: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 06:20:25 +08:00
-->
<PackageVersion>$(PSCoreBuildVersion)</PackageVersion>
2020-05-01 00:35:54 +08:00
2019-05-21 13:43:51 +08:00
<ApplicationIcon Condition="$(ProductVersion.Contains('preview'))">..\..\assets\Powershell_av_colors.ico</ApplicationIcon>
2020-07-21 22:53:51 +08: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 06:20:25 +08:00
</PropertyGroup>
2022-10-12 02:50:16 +08:00
<!-- Remove existing generated files by source generators because new source code will soon be generated when the build starts -->
<RemoveDir Directories="gen\SourceGenerated" Condition="Exists('gen\SourceGenerated')" />
2017-09-07 06:20:25 +08:00
<!-- Output For Debugging
<WriteLinesToFile File="targetfile1.txt"
Lines="ReleaseTag=$(ReleaseTag);
2021-03-24 02:03:05 +08:00
PowerShellVersion = $(PowerShellVersion);
2017-09-07 06:20:25 +08:00
PSCoreBuildVersion = $(PSCoreBuildVersion);
2021-03-24 02:03:05 +08:00
PSCoreFileVersion = $(PSCoreFileVersion);
ReleaseTagVersionPart = $(ReleaseTagVersionPart);
ReleaseTagSemVersionPart = $(ReleaseTagSemVersionPart);
2017-09-07 06:20:25 +08:00
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-30 01:25:49 +08:00
<PropertyGroup>
2019-05-11 06:34:27 +08:00
<Product>PowerShell</Product>
2017-06-30 01:25:49 +08:00
<Company>Microsoft Corporation</Company>
2020-05-20 20:02:38 +08:00
<Copyright>(c) Microsoft Corporation.</Copyright>
2024-03-27 00:54:05 +08:00
<AssemblyTitle>PowerShell 7</AssemblyTitle>
2017-06-30 01:25:49 +08:00
2024-02-16 11:15:11 +08:00
<TargetFramework>net9.0</TargetFramework>
2023-02-23 08:12:16 +08:00
<LangVersion>11.0</LangVersion>
2017-07-01 04:07:14 +08:00
2017-06-30 01:25:49 +08:00
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2018-05-03 07:58:39 +08:00
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
2017-07-01 04:07:14 +08:00
<NeutralLanguage>en-US</NeutralLanguage>
2021-08-10 03:21:14 +08:00
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<DisableImplicitNamespaceImports_DotNet>true</DisableImplicitNamespaceImports_DotNet>
2017-06-30 01:25:49 +08:00
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>../signing/visualstudiopublic.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
2017-11-16 02:12:03 +08:00
<HighEntropyVA>true</HighEntropyVA>
2017-06-30 01:25:49 +08:00
</PropertyGroup>
2017-09-07 06:20:25 +08:00
2018-05-15 06:01:44 +08:00
<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
2019-04-17 05:14:29 +08:00
<IsWindows Condition="'$(IsWindows)' =='true' or ( '$(IsWindows)' == '' and '$(OS)' == 'Windows_NT')">true</IsWindows>
2018-05-15 06:01:44 +08:00
</PropertyGroup>
<!-- Define non-windows, all configuration properties -->
<PropertyGroup Condition=" '$(IsWindows)' != 'true' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>
2018-07-13 12:00:35 +08:00
2018-05-15 06:01:44 +08: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' ">
2022-10-01 05:59:01 +08:00
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunEmitSymbols>true</PublishReadyToRunEmitSymbols>
<Optimize>true</Optimize>
2022-10-05 07:17:45 +08:00
<DebugType>portable</DebugType>
2022-10-01 05:59:01 +08:00
</PropertyGroup>
<!-- Define all OS, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'StaticAnalysis' ">
2018-05-15 06:01:44 +08:00
<Optimize>true</Optimize>
2019-04-14 10:00:30 +08:00
<!-- This is required to be full for compliance tools !-->
2018-05-15 06:01:44 +08:00
<DebugType>full</DebugType>
</PropertyGroup>
2020-10-24 02:39:06 +08:00
<PropertyGroup>
<Features>strict</Features>
</PropertyGroup>
2020-11-01 15:33:18 +08:00
<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
2017-06-30 01:25:49 +08:00
</Project>