Skip to content

Commit 6e3365b

Browse files
Merge pull request #1494 from PowerShell/andschwa/build-fix
Work around `dotnet publish` bug
2 parents a12edc9 + 684ef31 commit 6e3365b

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

Diff for: PowerShellEditorServices.build.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ task SetupDotNet -Before Clean, Build, TestServerWinPS, TestServerPS7, TestServe
107107
$dotnetExePath = if ($script:IsNix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" }
108108

109109
if (!(Test-Path $dotnetExePath)) {
110-
# TODO: Test .NET 5 with PowerShell 7.1, and add that channel here.
111-
Install-Dotnet -Channel '3.1','release/6.0.1xx-preview2'
110+
# TODO: Test .NET 5 with PowerShell 7.1
111+
Install-Dotnet -Channel '3.1','5.0','6.0'
112112
}
113113

114114
# This variable is used internally by 'dotnet' to know where it's installed
@@ -174,6 +174,7 @@ task GetProductVersion -Before PackageModule, UploadArtifacts {
174174
task CreateBuildInfo -Before Build {
175175
$buildVersion = "<development-build>"
176176
$buildOrigin = "Development"
177+
$buildCommit = git rev-parse HEAD
177178

178179
# Set build info fields on build platforms
179180
if ($env:TF_BUILD) {
@@ -215,6 +216,7 @@ namespace Microsoft.PowerShell.EditorServices.Hosting
215216
{
216217
public static readonly string BuildVersion = "$buildVersion";
217218
public static readonly string BuildOrigin = "$buildOrigin";
219+
public static readonly string BuildCommit= "$buildCommit";
218220
public static readonly System.DateTime? BuildTime = System.DateTime.Parse("$buildTime", CultureInfo.InvariantCulture.DateTimeFormat);
219221
}
220222
}

Diff for: src/PowerShellEditorServices.Hosting/BuildInfo.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public static class BuildInfo
77
// TODO: Include a Git commit hash in this.
88
public static readonly string BuildVersion = "<development-build>";
99
public static readonly string BuildOrigin = "<development>";
10+
public static readonly string BuildCommit= "<development>";
1011
public static readonly System.DateTime? BuildTime = System.DateTime.Parse("2019-12-06T21:43:41", CultureInfo.InvariantCulture.DateTimeFormat);
1112
}
1213
}

Diff for: src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
<AssemblyName>Microsoft.PowerShell.EditorServices.Hosting</AssemblyName>
77
</PropertyGroup>
88

9+
<!-- HACK: This is a temporary workaround of `dotnet publish` -->
10+
<Target Name="InjectNetStandardFacadesToPublishDirectory"
11+
BeforeTargets="ComputeResolvedFilesToPublishList"
12+
Condition="'@(_NETStandardLibraryNETFrameworkLib)' != ''">
13+
<ItemGroup>
14+
<_ResolvedCopyLocalPublishAssets
15+
Include="@(_NETStandardLibraryNETFrameworkLib)"
16+
Condition="'%(_NETStandardLibraryNETFrameworkLib.FileName)' != 'netfx.force.conflicts'"
17+
/>
18+
</ItemGroup>
19+
</Target>
20+
921
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
1022
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
1123
</PropertyGroup>

0 commit comments

Comments
 (0)