Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Froto.Parser & Froto.Serialization target netstandard2.0 (#78)
Browse files Browse the repository at this point in the history
* see if we can get the latest dotnet core

* try dotnet: 2.0.4

* it is the sdk version

* no mono

* dotnet build

* restore then build just Froto.sln

* try 2.1.2

* unix compatible slashes in sln

* netcore

* replaced the slashes

* fold restore

* fold didn't work

* netstandard2.0

* disabe the TypeProvider tests

* netstandard2.0 tests

* DotNetCli

* update nuspec
  • Loading branch information
ctaggart authored Dec 25, 2017
1 parent bf84c4a commit 7f9cfdb
Show file tree
Hide file tree
Showing 17 changed files with 133 additions and 68 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: csharp

sudo: false # use the new container-based Travis infrastructure

before_install:
- chmod +x build.sh

mono: none
dotnet: 2.1.3
script:
- ./build.sh unittest
- dotnet restore Froto.unix.sln
- dotnet build Froto.unix.sln -c Release
- dotnet test Parser.Test/Froto.Parser.Test.fsproj
- dotnet test Serialization.Test/Froto.Serialization.Test.fsproj
2 changes: 1 addition & 1 deletion Compiler/Froto.Compiler.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net46</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>froto</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
12 changes: 6 additions & 6 deletions Froto.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "protobuf", "protobuf", "{82
test\google\protobuf\descriptor.proto = test\google\protobuf\descriptor.proto
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Parser", "Parser\Froto.Parser.fsproj", "{1C31DA31-BEC5-4E73-9D83-E36D18847439}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Parser", "Parser/Froto.Parser.fsproj", "{1C31DA31-BEC5-4E73-9D83-E36D18847439}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Parser.Test", "Parser.Test\Froto.Parser.Test.fsproj", "{18104831-6F33-4F15-AB45-3E8527CC5181}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Parser.Test", "Parser.Test/Froto.Parser.Test.fsproj", "{18104831-6F33-4F15-AB45-3E8527CC5181}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Serialization", "Serialization\Froto.Serialization.fsproj", "{C37745D0-275D-4DCE-9DDC-C4663A462EDD}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Serialization", "Serialization/Froto.Serialization.fsproj", "{C37745D0-275D-4DCE-9DDC-C4663A462EDD}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Serialization.Test", "Serialization.Test\Froto.Serialization.Test.fsproj", "{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Serialization.Test", "Serialization.Test/Froto.Serialization.Test.fsproj", "{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Froto.Compiler", "Compiler\Froto.Compiler.fsproj", "{F5D8D709-919D-4539-8908-91C540C970B3}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Froto.Compiler", "Compiler/Froto.Compiler.fsproj", "{F5D8D709-919D-4539-8908-91C540C970B3}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.TypeProvider", "TypeProvider\Froto.TypeProvider.fsproj", "{837AA4FC-E2DD-48A1-A793-50DC4404EE57}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.TypeProvider", "TypeProvider/Froto.TypeProvider.fsproj", "{837AA4FC-E2DD-48A1-A793-50DC4404EE57}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
89 changes: 89 additions & 0 deletions Froto.unix.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2291EB39-A4CC-471C-BA12-1E58F298B395}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
build.fsx = build.fsx
readme.md = readme.md
release_notes.md = release_notes.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{992FDC44-075B-4B9D-BFF4-0C34093627E6}"
ProjectSection(SolutionItems) = preProject
test\addressbook.proto = test\addressbook.proto
test\addressbook1.proto = test\addressbook1.proto
test\FooOptions.proto = test\FooOptions.proto
test\grpc.proto = test\grpc.proto
test\javatutorial.proto = test\javatutorial.proto
test\nwind.proto = test\nwind.proto
test\person.proto = test\person.proto
test\protoenum.proto = test\protoenum.proto
test\protooptions.proto = test\protooptions.proto
test\riak.proto = test\riak.proto
test\riak_kv.proto = test\riak_kv.proto
test\riak_search.proto = test\riak_search.proto
test\rpc.proto = test\rpc.proto
test\SearchRequest.proto = test\SearchRequest.proto
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "google", "google", "{E1A81C99-B921-4EAF-9912-2B2306779E22}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "protobuf", "protobuf", "{828E3BC0-8DF8-48B5-BA98-BDB8C108C25A}"
ProjectSection(SolutionItems) = preProject
test\google\protobuf\descriptor.proto = test\google\protobuf\descriptor.proto
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Parser", "Parser/Froto.Parser.fsproj", "{1C31DA31-BEC5-4E73-9D83-E36D18847439}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Parser.Test", "Parser.Test/Froto.Parser.Test.fsproj", "{18104831-6F33-4F15-AB45-3E8527CC5181}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Serialization", "Serialization/Froto.Serialization.fsproj", "{C37745D0-275D-4DCE-9DDC-C4663A462EDD}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Serialization.Test", "Serialization.Test/Froto.Serialization.Test.fsproj", "{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Froto.Compiler", "Compiler/Froto.Compiler.fsproj", "{F5D8D709-919D-4539-8908-91C540C970B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1C31DA31-BEC5-4E73-9D83-E36D18847439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C31DA31-BEC5-4E73-9D83-E36D18847439}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C31DA31-BEC5-4E73-9D83-E36D18847439}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C31DA31-BEC5-4E73-9D83-E36D18847439}.Release|Any CPU.Build.0 = Release|Any CPU
{18104831-6F33-4F15-AB45-3E8527CC5181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{18104831-6F33-4F15-AB45-3E8527CC5181}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18104831-6F33-4F15-AB45-3E8527CC5181}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18104831-6F33-4F15-AB45-3E8527CC5181}.Release|Any CPU.Build.0 = Release|Any CPU
{C37745D0-275D-4DCE-9DDC-C4663A462EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C37745D0-275D-4DCE-9DDC-C4663A462EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C37745D0-275D-4DCE-9DDC-C4663A462EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C37745D0-275D-4DCE-9DDC-C4663A462EDD}.Release|Any CPU.Build.0 = Release|Any CPU
{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF2D437D-55A1-4F31-86BD-9B9D7E05CAEA}.Release|Any CPU.Build.0 = Release|Any CPU
{F5D8D709-919D-4539-8908-91C540C970B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5D8D709-919D-4539-8908-91C540C970B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5D8D709-919D-4539-8908-91C540C970B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5D8D709-919D-4539-8908-91C540C970B3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{992FDC44-075B-4B9D-BFF4-0C34093627E6} = {2291EB39-A4CC-471C-BA12-1E58F298B395}
{E1A81C99-B921-4EAF-9912-2B2306779E22} = {992FDC44-075B-4B9D-BFF4-0C34093627E6}
{828E3BC0-8DF8-48B5-BA98-BDB8C108C25A} = {E1A81C99-B921-4EAF-9912-2B2306779E22}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8FAB0177-725B-49AC-A02D-F7B95EB975C2}
EndGlobalSection
EndGlobal
4 changes: 3 additions & 1 deletion Parser.Test/Froto.Parser.Test.fsproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="TestParser.fs" />
<Compile Include="TestClassModel.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Parser\Froto.Parser.fsproj" />
Expand All @@ -15,5 +16,6 @@
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.console" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Parser.Test/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Program = let [<EntryPoint>] main _ = 0
2 changes: 1 addition & 1 deletion Parser/Froto.Parser.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" Condition="Exists('AssemblyInfo.fs')" />
Expand Down
4 changes: 2 additions & 2 deletions Parser/Froto.Parser.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<tags>froto protobuf parser binary protocol buffers serialization deserialization</tags>
</metadata>
<files>
<file src="net45/Froto.Parser.dll" target="lib/net45" />
<file src="net45/Froto.Parser.pdb" target="lib/net45" />
<file src="netstandard2.0/Froto.Parser.dll" target="lib/netstandard2.0" />
<file src="netstandard2.0/Froto.Parser.pdb" target="lib/netstandard2.0" />
</files>
</package>
4 changes: 3 additions & 1 deletion Serialization.Test/Froto.Serialization.Test.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -12,6 +12,7 @@
<Compile Include="TestClassSerialization.fs" />
<Compile Include="ExampleProtoRecord.fs" />
<Compile Include="ExampleProtoClass.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Serialization\Froto.Serialization.fsproj" />
Expand All @@ -22,5 +23,6 @@
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.console" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Serialization.Test/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Program = let [<EntryPoint>] main _ = 0
2 changes: 1 addition & 1 deletion Serialization/Froto.Serialization.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Exceptions.fs" />
Expand Down
4 changes: 2 additions & 2 deletions Serialization/Froto.Serialization.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<tags>froto protobuf binary protocol buffers serialization deserialization</tags>
</metadata>
<files>
<file src="net45/Froto.Serialization.dll" target="lib/net45" />
<file src="net45/Froto.Serialization.pdb" target="lib/net45" />
<file src="netstandard2.0/Froto.Serialization.dll" target="lib/netstandard2.0" />
<file src="netstandard2.0/Froto.Serialization.pdb" target="lib/netstandard2.0" />
</files>
</package>
11 changes: 6 additions & 5 deletions TypeProvider.Test/Froto.TypeProvider.Test.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net461</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -14,25 +14,26 @@
<When Condition="$(Configuration) == 'Debug'">
<ItemGroup>
<Reference Include="Froto.TypeProvider">
<HintPath>..\TypeProvider\bin\Debug\net45\Froto.TypeProvider.dll</HintPath>
<HintPath>..\TypeProvider\bin\Debug\net461\Froto.TypeProvider.dll</HintPath>
</Reference>
<Reference Include="Froto.Serialization">
<HintPath>..\Serialization\bin\Debug\net45\Froto.Serialization.dll</HintPath>
<HintPath>..\Serialization\bin\Debug\netstandard2.0\Froto.Serialization.dll</HintPath>
</Reference>
</ItemGroup>
</When>
<When Condition="$(Configuration) == 'Release'">
<ItemGroup>
<Reference Include="Froto.TypeProvider">
<HintPath>..\TypeProvider\bin\Release\net45\Froto.TypeProvider.dll</HintPath>
<HintPath>..\TypeProvider\bin\Release\net461\Froto.TypeProvider.dll</HintPath>
</Reference>
<Reference Include="Froto.Serialization">
<HintPath>..\Serialization\bin\Release\net45\Froto.Serialization.dll</HintPath>
<HintPath>..\Serialization\bin\Release\netstandard2.0\Froto.Serialization.dll</HintPath>
</Reference>
</ItemGroup>
</When>
</Choose>
<ItemGroup>
<PackageReference Include="FParsec" Version="1.0.3" />
<PackageReference Include="FsUnit.xUnit" Version="3.1.0-beta2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit" Version="2.3.1" />
Expand Down
4 changes: 0 additions & 4 deletions TypeProvider.Test/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion TypeProvider/Froto.TypeProvider.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="lib/ProvidedTypes.fsi" />
Expand Down
4 changes: 2 additions & 2 deletions TypeProvider/Froto.TypeProvider.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<tags>froto protobuf binary protocol buffers serialization deserialization type provider</tags>
</metadata>
<files>
<file src="net45/Froto.TypeProvider.dll" target="lib/net45" />
<file src="net45/Froto.TypeProvider.pdb" target="lib/net45" />
<file src="net461/Froto.TypeProvider.dll" target="lib/net461" />
<file src="net461/Froto.TypeProvider.pdb" target="lib/net461" />
</files>
</package>
42 changes: 8 additions & 34 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ open Fake.Core.Process
open Fake.Core.TargetOperators
open Fake.DotNet
open Fake.DotNet.NuGet.NuGet
open Fake.DotNet.Testing.XUnit2
// open Fake.DotNet.Testing.XUnit2

type Text.StringBuilder with
member x.Appendf format = Printf.ksprintf (fun s -> x.Append s |> ignore) format
Expand All @@ -29,8 +29,6 @@ let buildVersion =
else sprintf "%s-a%s" assemblyVersion (buildDate.ToString "yyMMddHHmm")
let mutable configuration = "Release"

MSBuildDefaults <- { MSBuildDefaults with Verbosity = Some MSBuildVerbosity.Minimal }

Target.Create "BuildVersion" <| fun _ ->
Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s\"" buildVersion) |> ignore

Expand All @@ -56,38 +54,14 @@ Target.Create "SwitchToDebug" <| fun _ ->
configuration <- "Debug"

Target.Create "Build" <| fun _ ->
["Froto.sln"]
|> MSBuild "" "restore;build" ["Configuration", configuration]
|> ignore

if not isMono then
["Froto.TypeProvider.TestAndDocs.sln"]
|> MSBuild "" "restore;build" ["Configuration", configuration]
|> ignore
let build project = DotNetCli.Build (fun p -> { p with Project = project })
build "Froto.sln"
// build "Froto.TypeProvider.TestAndDocs.sln"

Target.Create "UnitTest" <| fun _ ->
IO.Directory.create "bin"
let dlls =
[ sprintf @"Parser.Test/bin/%s/net46/Froto.Parser.Test.dll" configuration
sprintf @"Serialization.Test/bin/%s/net46/Froto.Serialization.Test.dll" configuration
]

let dlls =
List.append dlls (
if isMono then
[]
else
[ sprintf @"TypeProvider.Test/bin/%s/net46/Froto.TypeProvider.Test.dll" configuration ]
)

xUnit2 (fun p ->
{ p with
IncludeTraits = ["Kind", "Unit"]
XmlOutputPath = Some @"bin/UnitTest.xml"
Parallel = ParallelMode.Assemblies
TimeOut = TimeSpan.FromMinutes 10.0
})
dlls
let test project = DotNetCli.Test (fun p -> { p with Project = project })
test "Parser.Test/Froto.Parser.Test.fsproj"
test "Serialization.Test/Froto.Serialization.Test.fsproj"

// https://github.com/fsharp/FAKE/blob/master/help/markdown/dotnet-nuget.md
Target.Create "NuGet" <| fun _ ->
Expand Down Expand Up @@ -143,7 +117,7 @@ Target.Create "Debug" Target.DoNothing
=?> ("AssemblyInfo", isAppVeyorBuild)
==> "Build"
==> "UnitTest"
=?> ("NuGet", not isMono)
=?> ("NuGet", isAppVeyorBuild)
==> "Default"

"UnitTest" ==> "Debug"
Expand Down

0 comments on commit 7f9cfdb

Please sign in to comment.