Skip to content
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

Update projects to .NET sdk, support netstandard2.0, drop tfms, etc #38

Merged
merged 61 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c61b8f4
add global.json to pin .net core sdk version
enricosada Feb 19, 2019
56a3334
remove FSharp.NET.Sdk usage, deprecated in .net core sdk 1.0
enricosada Feb 19, 2019
55aab7e
move metadata in a shared and auto imported Directory.Build.props
enricosada Feb 19, 2019
7a2ba35
remove default
enricosada Feb 19, 2019
5ce3cf5
simplify dependencies, use FSharp.Core 4.3.4
enricosada Feb 19, 2019
8ce5c0b
drop support for `.NETPortable`( `portable-net45+win8+wp8+wpa81` ) ta…
enricosada Feb 19, 2019
db9391e
simplify, move metadata of package in the project
enricosada Feb 19, 2019
77ba905
remove MergedFParsecPackage conditional, i'll embeed FParsecCS later
enricosada Feb 19, 2019
33fa6f6
drop support for `netstandard1.6`, support `netstandard2.0` instead
enricosada Feb 19, 2019
5231fbd
property `TargetFrameworkIdentifier` is automatically defined by .NET…
enricosada Feb 19, 2019
1edf606
use default conventions for compile c#
enricosada Feb 19, 2019
8b690e2
remove VS11 projects
enricosada Feb 19, 2019
3a4387d
drop support for discontinued `net40-client` target framework
enricosada Feb 19, 2019
1cb3ede
use conventions of .NET Sdk
enricosada Feb 19, 2019
2a17c0f
remove useless `CoreOnNonWin` property
enricosada Feb 19, 2019
acc09ed
refactor common properties in Directory.Build.props
enricosada Feb 19, 2019
d25e019
more properties into test projects
enricosada Feb 19, 2019
019d15a
move shared deps into projects
enricosada Feb 19, 2019
50bc6ee
move shared deps into projects
enricosada Feb 19, 2019
2120367
move in the correct place
enricosada Feb 19, 2019
ed642c9
move shared deps into projects
enricosada Feb 19, 2019
b0c4fb6
remove now useless FParsec.Samples.Common.targets
enricosada Feb 19, 2019
4636d21
simplify project, move TargetFrameworks in projects
enricosada Feb 19, 2019
088f672
move shared properties in Directory.Build.props
enricosada Feb 19, 2019
f7b5c65
cleanup
enricosada Feb 19, 2019
21fed8e
more shared props near usage in projects
enricosada Feb 19, 2019
fb0c9d0
pin fsharp.core
enricosada Feb 19, 2019
1fb7919
cleanup
enricosada Feb 19, 2019
6b60ab6
upgrade from netcoreapp2.0 to netcoreapp2.1
enricosada Feb 19, 2019
253a950
fix fsharp.core
enricosada Feb 19, 2019
fa69e36
fix p2p
enricosada Feb 19, 2019
e53156e
embeed FParsecCS.dll into FParsec nupkg
enricosada Feb 19, 2019
985c6ab
include pdb in nupkg
enricosada Feb 19, 2019
348c05e
update pack powershell script
enricosada Feb 19, 2019
5e3b183
f
enricosada Feb 19, 2019
9ec707b
add entrypoint
enricosada Feb 19, 2019
037f07b
fix error No data is available for encoding 54936
enricosada Feb 20, 2019
7e71166
nupkgs are generated in `~/bin/nupkg`
enricosada Feb 20, 2019
cd54073
add travis
enricosada Feb 20, 2019
15535a2
add appveyor
enricosada Feb 20, 2019
9da691f
empty commit
enricosada Feb 20, 2019
3600028
fix travis
enricosada Feb 20, 2019
0088b08
dotnet run doesnt work on mono
enricosada Feb 20, 2019
f209a4f
update sln
enricosada Feb 21, 2019
07dd4a7
custom configurations require Configurations property
enricosada Feb 21, 2019
bda5aef
add solutions files
enricosada Feb 21, 2019
6ba1db1
fix prerelease tag in appveyor
enricosada Feb 27, 2019
63f5049
conditionals using tfm
enricosada Feb 27, 2019
a9f1a3c
move properties near usage
enricosada Feb 27, 2019
b1c6609
verbose log for build
enricosada Feb 27, 2019
158362a
clean package output dir at beginning of build
enricosada Feb 27, 2019
78d1e57
Add back default StartArguments to sample projects
stephan-tolksdorf Mar 2, 2019
62b7b15
Add back InterpLexYacc project
stephan-tolksdorf Mar 2, 2019
e4ade73
Add FParsec.Common.targets to solution file, rename "build" folder to…
stephan-tolksdorf Mar 2, 2019
9c992be
Move Summary, Description and PackageDescription properties from Dire…
stephan-tolksdorf Mar 2, 2019
3479c72
Output nupkg files in nupkgs directory, not bin/nupkg
stephan-tolksdorf Mar 2, 2019
5a10d1f
Update readme.txt
stephan-tolksdorf Mar 2, 2019
0962998
Fix missing optimization flag for Release-LowTrust configuration and …
stephan-tolksdorf Mar 2, 2019
04575a2
Make comment in FParsec.fsproj less terse
stephan-tolksdorf Mar 2, 2019
c226295
Update .vscode/tasks.json
stephan-tolksdorf Mar 2, 2019
92ae6ff
Always show the output of .vscode test tasks
stephan-tolksdorf Mar 2, 2019
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ obj/
*.swp
*.pdb
packages/
version.props
version.props
/.vs/
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: csharp

mono: 5.18.0
dotnet: 2.1.500

install:
# workaround for missing .net 4.5 targing pack
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/

script:
- dotnet build FParsec.sln -c $CONFIGURATION -v n
- |
if [ "$RUN_TESTS" == "1" ]; then
dotnet run --no-build -p Test -c $CONFIGURATION -f $TFM
fi

env:
- CONFIGURATION=Release
TFM=net45
- CONFIGURATION=Release-LowTrust
TFM=net45
- CONFIGURATION=Release-LowTrust
TFM=netcoreapp2.1
RUN_TESTS=1

matrix:
include:
- os: linux
dist: trusty
sudo: required
- os: osx
osx_image: xcode9
74 changes: 44 additions & 30 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,67 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"version": "2.0.0",
"tasks": [
{
"taskName": "Restore (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": ["restore", "/p:Configuration=Debug-LowTrust"],
"showOutput": "always",
"label": "Restore (Config: Debug-LowTrust)",
"command": "dotnet restore /p:Configuration=Debug-LowTrust",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
},
{
"taskName": "Build .NET Core Test (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": ["build", "Test", "-c", "Debug-LowTrust", "-f", "netcoreapp2.0"],
"isBuildCommand": true,
"showOutput": "silent",
"label": "Build .NET Core Test (Config: Debug-LowTrust)",
"command": "dotnet build Test -c Debug-LowTrust -f netcoreapp2.1",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"taskName": "Build .NET 4.5 Test (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": ["build", "Test", "-c", "Debug-LowTrust", "-f", "net45"],
"showOutput": "silent",
"label": "Build .NET 4.5 Test (Config: Debug-LowTrust)",
"command": "dotnet build Test -c Debug-LowTrust -f net45",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"taskName": "Build All (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": ["build", "-c", "Debug-LowTrust"],
"showOutput": "silent",
"label": "Build All (Config: Debug-LowTrust)",
"command": "dotnet build -c Debug-LowTrust",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"taskName": "Test .NET  Core (Config: Debug-LowTrust)",
"suppressTaskName": true,
"args": [ "Test/bin/Debug-LowTrust/netcoreapp2.0/Test.dll" ],
"isTestCommand": true,
"showOutput": "always"
"label": "Test .NET Core (Config: Debug-LowTrust)",
"command": "dotnet Test/bin/Debug-LowTrust/netcoreapp2.1/Test.dll",
"type": "shell",
"group": "test",
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
},

{
"taskName": "Test .NET 4.5 (Config: Debug-LowTrust)",
"suppressTaskName": true,
"label": "Test .NET 4.5 (Config: Debug-LowTrust)",
"command": "Test/bin/Debug-LowTrust/net45/Test.exe",
"showOutput": "always"
"type": "shell",
"group": "test",
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
}
]
}
150 changes: 8 additions & 142 deletions Build/FParsec.Common.targets
Original file line number Diff line number Diff line change
@@ -1,127 +1,22 @@
<Project>

<PropertyGroup>
<LowTrust>false</LowTrust>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug-LowTrust' or '$(Configuration)' == 'Release-LowTrust'">
<LowTrust>true</LowTrust>
<DefineConstants>$(DefineConstants);LOW_TRUST</DefineConstants>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup>
<FSharpPortableLanguageTargets>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets</FSharpPortableLanguageTargets>
<FSharpPortableLanguageTargets Condition="!Exists('$(FSharpPortableLanguageTargets)')" />
</PropertyGroup>

<PropertyGroup>
<CoreOnNonWin>false</CoreOnNonWin>
<CoreOnNonWin Condition="'$(MSBuildRuntimeType)' == 'Core' and '$(OS)' != 'Windows_NT'">true</CoreOnNonWin>
</PropertyGroup>

<Target Name="CheckFParsecConfiguration" BeforeTargets="BeforeBuild;_GetProjectJsonPath">
<Error Condition="'$(LowTrust)' == 'false' and '$(CoreOnNonWin)' == 'true'"
Text="Currently, only the configurations 'Debug-LowTrust' and 'Release-LowTrust' are .NET Core compatible, but the selected configuration is: '$(Configuration)'." />
</Target>

<PropertyGroup Condition="'$(LowTrust)' != 'true'">
<TargetFrameworks>net40-client;net45</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(LowTrust)' == 'true'">
<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'">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OutputType)' == 'Exe' and '$(CoreOnNonWin)' == 'false'">$(TargetFrameworks);net45</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net40-client'">
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'portable-net45+win8+wp8+wpa81'">
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
<NugetTargetMoniker>.NETPortable,Version=v0.0,Profile=Profile259</NugetTargetMoniker>
<TargetProfile>netcore</TargetProfile>
<TargetFSharpCoreVersion>3.259.4.0</TargetFSharpCoreVersion>
<!-- https://github.com/NuGet/Home/issues/5021 -->
<IncludeProjectPriFile>false</IncludeProjectPriFile>
</PropertyGroup>

<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'">
<PackageReference Include="FSharp.NET.Sdk" Version="1.*" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETPortable'">
<LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.csproj'">$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets</LanguageTargets>
<LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.fsproj'">$(FSharpPortableLanguageTargets)</LanguageTargets>
</PropertyGroup>

<Choose>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<ItemGroup><PackageReference Include="FSharp.Core" Version="4.*" /></ItemGroup>
</When>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETPortable'">
<ItemGroup>
<Reference Include="FSharp.Core">
<Name>FSharp.Core</Name>
<AssemblyName>FSharp.Core.dll</AssemblyName>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETCore\$(TargetFSharpCoreVersion)\FSharp.Core.dll</HintPath>
</Reference>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup><PackageReference Include="FSharp.Core" Version="4.0.0.1" /></ItemGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<DisableImplicitConfigurationDefines>true</DisableImplicitConfigurationDefines>
</PropertyGroup>
<Choose>
<When Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Debug-LowTrust'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(Configuration)' == 'Release' or '$(Configuration)' == 'Release-LowTrust'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
</When>
</Choose>

<PropertyGroup Condition="'$(LowTrust)' == 'true'">
<DefineConstants>$(DefineConstants);SMALL_STATETAG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' != 'net40-client'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);AGGRESSIVE_INLINING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
<DefineConstants>$(DefineConstants);UNALIGNED_READS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETPortable'">
<DefineConstants>$(DefineConstants);PCL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(LowTrust)' == 'false' and '$(AssemblyName)' != 'FParsecCS'">
<DefineConstants>$(DefineConstants);USE_STATIC_MAPPING_FOR_IS_ANY_OF</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(FParsecNuGet)' == 'true'">
<SignAssembly Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' or '$(TargetFrameworkIdentifier)' == '.NETPortable'">true</SignAssembly>
<SignAssembly Condition="'$(TargetFramework)' == 'net45'">true</SignAssembly>
</PropertyGroup>

<PropertyGroup>
<AssemblyVersion Condition="'$(SignAssembly)' == 'true'">1.0.0.0</AssemblyVersion>
<AssemblyVersion Condition="'$(SignAssembly)' != 'true'">$(FileVersion)</AssemblyVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(SignAssembly)' == 'true'">
Expand All @@ -130,33 +25,4 @@
<DefineConstants>$(DefineConstants);STRONG_NAME</DefineConstants>
</PropertyGroup>

<Import Project="..\Build\NuGet.props" />

<!-- See https://github.com/dotnet/netcorecli-fsc/issues/93 -->
<Target Name="FParsecAssemblyInfoWorkaround"
Condition="'$(AssemblyName)' == 'FParsec'"
AfterTargets="GetAssemblyVersion" BeforeTargets="GenerateAssemblyInfo">
<PropertyGroup>
<FParsecAssemblyInfoFile>$(IntermediateOutputPath)$(AssemblyName).ExtraAssemblyInfo.fs</FParsecAssemblyInfoFile>
<FParsecAssemblyInfo><![CDATA[
namespace FParsec
open System.Reflection

[<assembly: System.Runtime.Versioning.TargetFrameworkAttribute("$(TargetFrameworkMoniker)", FrameworkDisplayName = "$(TargetFrameworkMonikerDisplayName)")>]
[<assembly: AssemblyConfiguration("$(Configuration)")>]
[<assembly: AssemblyCopyright("$(Copyright)")>]
[<assembly: AssemblyFileVersion("$(FileVersion)")>]
[<assembly: AssemblyInformationalVersion("$(InformationalVersion)")>]
[<assembly: AssemblyProduct("$(Product)")>]
[<assembly: AssemblyTitle("$(AssemblyName)")>]
[<assembly: AssemblyVersion("$(AssemblyVersion)")>]
do ()
]]></FParsecAssemblyInfo>
</PropertyGroup>
<WriteLinesToFile File="$(FParsecAssemblyInfoFile)" Lines="$(FParsecAssemblyInfo)" Overwrite="true" Encoding="UTF-8" />
<ItemGroup>
<Compile Include="$(FParsecAssemblyInfoFile)" />
</ItemGroup>
</Target>

</Project>
40 changes: 0 additions & 40 deletions Build/NuGet.props

This file was deleted.

Loading