Skip to content

Commit fb48799

Browse files
busgaidw2natemcmaster
authored andcommitted
Add package reference to .NET Framework ref assemblies for x-plat work
Workaround dotnet/sdk#335
1 parent 14ead6f commit fb48799

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@
3333
<BaseOutputPath>$(MSBuildThisFileDirectory).build\bin\$(MSBuildProjectName)\</BaseOutputPath>
3434
</PropertyGroup>
3535

36+
<ItemGroup>
37+
<!-- For x-plat develpment. Workaround for https://github.com/dotnet/sdk/issues/335 -->
38+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-alpha-004" PrivateAssets="all" />
39+
</ItemGroup>
40+
3641
</Project>

NuGet.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
<packageSources>
44
<clear />
55
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
6+
<add key="roslyntools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
67
</packageSources>
7-
</configuration>
8+
</configuration>

build.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,15 @@ Remove-Item -Recurse $artifacts -ErrorAction Ignore
6464

6565
exec dotnet build --configuration $Configuration '-warnaserror:CS1591' @MSBuildArgs
6666
exec dotnet pack --no-restore --no-build --configuration $Configuration -o $artifacts @MSBuildArgs
67+
68+
[string[]] $testArgs=@()
69+
if (-not $IsCoreCLR -or -not $IsWindows) {
70+
$testArgs += '--framework','netcoreapp2.1'
71+
}
72+
6773
exec dotnet test --no-restore --no-build --configuration $Configuration '-clp:Summary' `
6874
"$PSScriptRoot/test/CommandLineUtils.Tests/McMaster.Extensions.CommandLineUtils.Tests.csproj" `
75+
@testArgs `
6976
@MSBuildArgs
7077

7178
write-host -f magenta 'Done'

src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
2+
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netstandard1.6</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform(Windows))">$(TargetFrameworks);net45</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netstandard1.6;net45</TargetFrameworks>
65
<GenerateDocumentationFile>true</GenerateDocumentationFile>
76
<IsPackable>true</IsPackable>
87
<Description>Command-line parsing API. A community-maintained fork of Microsoft.Extensions.CommandLineUtils, plus extras.

test/CommandLineUtils.Tests/McMaster.Extensions.CommandLineUtils.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform(Windows))">$(TargetFrameworks);net461</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
65
</PropertyGroup>
76

87
<ItemGroup>

0 commit comments

Comments
 (0)