Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update assemblies versions by MSBuild
  • Loading branch information
iSazonov committed Jun 23, 2017
commit 6ec07b9818198108d6898b32a8af72da59ff3ab6
16 changes: 11 additions & 5 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ function Start-PSBuild {
# Generate version constant for $PSVersionTable

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in formatting breaks our telemetry

function Start-PowerShellVersionGen {
$powershellVersion = git --git-dir="$PSScriptRoot/.git" describe --abbrev=60 --long
$matchVersion = ([regex]::Match($powershellVersion, "^(v.+)-(\d+)-g(.+)")).Groups.Value
$null, $ps6MajorVersion, $ps6MinorVersion, $ps6PatchVersion, $ps6LabelVersion = ([regex]::Match($matchVersion[1], "^v(\d+).(\d+).(\d+)-(.+)")).Groups.Value
$formattedVersion = "Version: $($matchVersion[1])"
$matchVersion = ([regex]::Match($powershellVersion, "^v(.+)-(\d+)-g(.+)")).Groups.Value
$null, $ps6MajorVersion, $ps6MinorVersion, $ps6PatchVersion, $ps6LabelVersion = ([regex]::Match($matchVersion[1], "^(\d+).(\d+).(\d+)-(.+)")).Groups.Value
$Global:formattedVersion = "$($matchVersion[1])"
if ($($matchVersion[1]) -ne "0") {
$formattedVersion += " Additional commits: $($matchVersion[2])"
$Global:formattedVersion += " Additional commits: $($matchVersion[2])"
}
$formattedVersion += " Commit Hash: $($matchVersion[3])"
$Global:formattedVersion += " Commit Hash: $($matchVersion[3])"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JamesWTruher the telemetry you're receiving is from @iSazonov running a build of PowerShell with this (not yet committed to master) change.


$template = @"
//------------------------------------------------------------------------------
Expand All @@ -182,6 +182,8 @@ namespace System.Management.Automation
"@

Set-Content -Path "$PSScriptRoot\src\System.Management.Automation\gen\PSVersionInfo.generated.cs" -Value $template

$Global:formattedVersion = $Global:formattedVersion -replace ' ', '%20'
}

if ($Clean) {
Expand Down Expand Up @@ -332,6 +334,10 @@ Fix steps:
# (Call after 'Start-ResGen'!)
Start-PowerShellVersionGen

# $Arguments += "/p:ProductVersion=$formattedVersion;InformationalVersion=$formattedVersion;"
$Arguments += "/p:ProductVersion=$formattedVersion;InformationalVersion=$formattedVersion"


# handle xaml files
# Heuristic to resolve xaml on the fresh machine
if ($FullCLR -and ($XamlGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.Activities/gen/*.g.cs"))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<AssemblyName>Microsoft.Management.Infrastructure.CimCmdlets</AssemblyName>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<AssemblyName>Microsoft.PowerShell.ConsoleHost</AssemblyName>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<AssemblyName>Microsoft.PowerShell.CoreCLR.AssemblyLoadContext</AssemblyName>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<AssemblyName>Microsoft.PowerShell.CoreCLR.Eventing</AssemblyName>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\Microsoft.PowerShell.Commands.Management\Microsoft.PowerShell.Commands.Management.csproj" />
<ProjectReference Include="..\Microsoft.PowerShell.Commands.Utility\Microsoft.PowerShell.Commands.Utility.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<AssemblyName>Microsoft.WSMan.Management</AssemblyName>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<ProjectReference Include="..\Microsoft.WSMan.Runtime\Microsoft.WSMan.Runtime.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<AssemblyName>Microsoft.WSMan.Runtime</AssemblyName>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<ProjectReference Include="..\Microsoft.PowerShell.CoreCLR.AssemblyLoadContext\Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.csproj" />
<ProjectReference Include="..\Microsoft.PowerShell.CoreCLR.Eventing\Microsoft.PowerShell.CoreCLR.Eventing.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions src/powershell-unix/powershell-unix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<RuntimeIdentifiers>ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;centos.7-x64;fedora.24-x64;osx.10.11-x64;osx.10.12-x64;opensuse.13.2-x64;opensuse.42.1-x64</RuntimeIdentifiers>
</PropertyGroup>

<Import Project="..\powershell-win-core\powershell-win-core.targets"/>

<ItemGroup>
<Compile Include="..\powershell\Program.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<Content Include="..\Modules\Unix\**\*;..\Modules\Shared\**\*" Exclude="..\Modules\Shared\Pester\.git*;..\Modules\Shared\Pester\*.yml">
Expand Down
2 changes: 2 additions & 0 deletions src/powershell-win-core/powershell-win-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<RuntimeIdentifiers>win7-x86;win7-x64;win81-x64;win10-x64</RuntimeIdentifiers>
</PropertyGroup>

<Import Project="powershell-win-core.targets"/>

<ItemGroup>
<Compile Include="..\powershell\Program.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<Content Include="..\System.Management.Automation\PowerShellProperties.json">
Expand Down
22 changes: 22 additions & 0 deletions src/powershell-win-core/powershell-win-core.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Product>PowerShell Core</Product>
<Company>Microsoft Corporation</Company>
<Copyright>(c) Microsoft Corporation. All rights reserved.</Copyright>

<FileVersion>6.0.0.0</FileVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<!--
<ProductVersion>6.0.0-beta.1 Additional commits: 1 Commit Hash: 9ebe</ProductVersion>
<InformationalVersion>6.0.0-beta.1 Additional commits: 2 Commit Hash: 59ebe</InformationalVersion>
!-->
<TargetFramework>netcoreapp2.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>../signing/visualstudiopublic.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
</Project>