Skip to content

Commit

Permalink
Update the project files for .NET Core 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-tolksdorf committed Aug 20, 2017
1 parent beb56e1 commit 7b69fc9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Expand Up @@ -16,7 +16,7 @@
{
"taskName": "Build .NET Core Test (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": ["build", "Test", "-c", "Debug-LowTrust", "-f", "netcoreapp1.1"],
"args": ["build", "Test", "-c", "Debug-LowTrust", "-f", "netcoreapp2.0"],
"isBuildCommand": true,
"showOutput": "silent",
"problemMatcher": "$msCompile"
Expand All @@ -38,7 +38,7 @@
{
"taskName": "Test .NET  Core (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": [ "Test/bin/Debug-LowTrust/netcoreapp1.1/Test.dll" ],
"args": [ "Test/bin/Debug-LowTrust/netcoreapp2.0/Test.dll" ],
"isTestCommand": true,
"showOutput": "always"
},
Expand Down
4 changes: 3 additions & 1 deletion Build/FParsec.Common.targets
Expand Up @@ -32,7 +32,7 @@
<TargetFrameworks Condition="'$(OutputType)' != 'Exe'">netstandard1.6</TargetFrameworks>
<TargetFrameworks Condition="'$(OutputType)' != 'Exe' and '$(CoreOnNonWin)' == 'false'">$(TargetFrameworks);net40-client</TargetFrameworks>
<TargetFrameworks Condition="'$(OutputType)' != 'Exe' and '$(FSharpPortableLanguageTargets)' != ''">$(TargetFrameworks);portable-net45+win8+wp8+wpa81</TargetFrameworks>
<TargetFrameworks Condition="'$(OutputType)' == 'Exe'">netcoreapp1.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OutputType)' == 'Exe'">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OutputType)' == 'Exe' and '$(CoreOnNonWin)' == 'false'">$(TargetFrameworks);net45</TargetFrameworks>
</PropertyGroup>

Expand All @@ -56,7 +56,9 @@
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == ''">
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' == 'net45'">.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' == 'netstandard1.6'">.NETStandard</TargetFrameworkIdentifier>
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' == 'netstandard2.0'">.NETStandard</TargetFrameworkIdentifier>
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' == 'netcoreapp1.1'">.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkIdentifier Condition="'$(TargetFramework)' == 'netcoreapp2.0'">.NETCoreApp</TargetFrameworkIdentifier>
</PropertyGroup>

<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.fsproj'">
Expand Down
2 changes: 1 addition & 1 deletion Samples/FParsec.Samples.Common.targets
Expand Up @@ -21,7 +21,7 @@
<TargetFrameworks>net45</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(LowTrust)' == 'true'">
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(CoreOnNonWin)' == 'false'">$(TargetFrameworks);net45</TargetFrameworks>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Test/Test.fsproj
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<TargetFrameworks>net40-client;net45;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net40-client;net45;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\Build\FParsec.Common.targets" />
Expand All @@ -29,7 +29,7 @@
<Compile Include="AllTests.fs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="System.Globalization.Extensions" Version="4.*" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.*" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions pack.ps1
Expand Up @@ -16,7 +16,7 @@ $ErrorActionPreference = 'Stop'
$configs = $('Release-LowTrust', 'Release')

$testTargetFrameworks = @{'Release' = $('net45', 'net40-client')
'Release-LowTrust' = $('netcoreapp1.1', 'net45')}
'Release-LowTrust' = $('netcoreapp2.0', 'net45')}
$testPCL = $true

function invoke([string] $cmd) {
Expand All @@ -41,7 +41,7 @@ foreach ($config in $configs) {
invoke "msbuild FParsec /t:Build $props"
invoke "msbuild Test /t:Build $props"
foreach ($tf in $testTargetFrameworks[$config]) {
if ($tf -eq 'netcoreapp1.1') {
if ($tf.StartsWith('netcoreapp')) {
invoke "dotnet .\Test\bin\$config\$tf\Test.dll"
} else {
invoke ".\Test\bin\$config\$tf\Test.exe"
Expand Down

0 comments on commit 7b69fc9

Please sign in to comment.