Skip to content

Work around dotnet publish bug #1494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 14, 2021
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
@@ -107,8 +107,8 @@ task SetupDotNet -Before Clean, Build, TestServerWinPS, TestServerPS7, TestServe
$dotnetExePath = if ($script:IsNix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" }

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

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

# Set build info fields on build platforms
if ($env:TF_BUILD) {
@@ -215,6 +216,7 @@ namespace Microsoft.PowerShell.EditorServices.Hosting
{
public static readonly string BuildVersion = "$buildVersion";
public static readonly string BuildOrigin = "$buildOrigin";
public static readonly string BuildCommit= "$buildCommit";
public static readonly System.DateTime? BuildTime = System.DateTime.Parse("$buildTime", CultureInfo.InvariantCulture.DateTimeFormat);
}
}
1 change: 1 addition & 0 deletions src/PowerShellEditorServices.Hosting/BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ public static class BuildInfo
// TODO: Include a Git commit hash in this.
public static readonly string BuildVersion = "<development-build>";
public static readonly string BuildOrigin = "<development>";
public static readonly string BuildCommit= "<development>";
public static readonly System.DateTime? BuildTime = System.DateTime.Parse("2019-12-06T21:43:41", CultureInfo.InvariantCulture.DateTimeFormat);
}
}
Original file line number Diff line number Diff line change
@@ -6,6 +6,18 @@
<AssemblyName>Microsoft.PowerShell.EditorServices.Hosting</AssemblyName>
</PropertyGroup>

<!-- HACK: This is a temporary workaround of `dotnet publish` -->
<Target Name="InjectNetStandardFacadesToPublishDirectory"
BeforeTargets="ComputeResolvedFilesToPublishList"
Condition="'@(_NETStandardLibraryNETFrameworkLib)' != ''">
<ItemGroup>
<_ResolvedCopyLocalPublishAssets
Include="@(_NETStandardLibraryNETFrameworkLib)"
Condition="'%(_NETStandardLibraryNETFrameworkLib.FileName)' != 'netfx.force.conflicts'"
/>
</ItemGroup>
</Target>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
</PropertyGroup>