Skip to content

Commit 0c65682

Browse files
authored
Initial support for .NET Core (#197)
* Simple build for both .NET Core and .NET Framework * macOS and Linux builds Azure builds * lots of updates for FAKE 5, held off on full migration * moved to combined jupyter-kernel folder, and removed some ipython leftovers * We no longer seem to need NetMQ.dll reference Getting rid of it eases .NET Core compatibility
1 parent 062187c commit 0c65682

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1070
-1107
lines changed

.paket/Paket.Restore.targets

+9-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
6363
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
6464
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
65+
66+
<!-- Disable Paket restore under NCrunch build -->
67+
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
6568
</PropertyGroup>
6669

6770
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
@@ -102,7 +105,11 @@
102105
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
103106
</PropertyGroup>
104107

105-
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' ">
108+
<!--
109+
This value should match the version in the props generated by paket
110+
If they differ, this means we need to do a restore in order to ensure correct dependencies
111+
-->
112+
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
106113
<PaketRestoreRequired>true</PaketRestoreRequired>
107114
</PropertyGroup>
108115

@@ -183,6 +190,7 @@
183190
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
184191
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
185192
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
193+
<AllowExplicitVersion>true</AllowExplicitVersion>
186194
</PackageReference>
187195
</ItemGroup>
188196

.paket/paket.exe

5.5 KB
Binary file not shown.

.travis.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
language: csharp
22

33
sudo: false # use the new container-based Travis infrastructure
4+
dist: xenial
5+
6+
#dotnet 2.* currently fail on unpack
7+
dotnet: 2.1.302
48

59
script:
6-
- ./build.sh
10+
- ./build.sh BuildNetFramework
711

812
branches:
913
only:
10-
- master
11-
14+
- master

IfSharp.sln

+12-57
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,31 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2036
4+
VisualStudioVersion = 15.0.28307.421
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "IfSharp.Kernel", "src\IfSharp.Kernel\IfSharp.Kernel.fsproj", "{2FE619B3-4756-4285-B31F-232607F62D78}"
6+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "IfSharp.Kernel", "src\IfSharp.Kernel\IfSharp.Kernel.fsproj", "{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}"
77
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3C993D34-1BD4-4002-B149-7DB2ECAD61CF}"
9-
ProjectSection(SolutionItems) = preProject
10-
build.cmd = build.cmd
11-
build.fsx = build.fsx
12-
EndProjectSection
13-
EndProject
14-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ipython-profile", "ipython-profile", "{F5A3E866-86FB-44AD-9ED1-DB65D6EB0058}"
15-
ProjectSection(SolutionItems) = preProject
16-
ipython-profile\static\custom\ifsharp_logo.png = ipython-profile\static\custom\ifsharp_logo.png
17-
ipython-profile\ipython_config.py = ipython-profile\ipython_config.py
18-
ipython-profile\ipython_qtconsole_config.py = ipython-profile\ipython_qtconsole_config.py
19-
ipython-profile\kernel.js = ipython-profile\kernel.js
20-
EndProjectSection
21-
EndProject
22-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "static", "static", "{45519D10-5973-41C3-A8D0-BCBF0008044D}"
23-
EndProject
24-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "custom", "custom", "{3AAFA64D-CBB6-488E-B395-6A1E7CB554CE}"
25-
ProjectSection(SolutionItems) = preProject
26-
ipython-profile\static\custom\fsharp.css = ipython-profile\static\custom\fsharp.css
27-
ipython-profile\static\custom\ifsharp_logo.png = ipython-profile\static\custom\ifsharp_logo.png
28-
ipython-profile\static\custom\webintellisense-codemirror.js = ipython-profile\static\custom\webintellisense-codemirror.js
29-
ipython-profile\static\custom\webintellisense.js = ipython-profile\static\custom\webintellisense.js
30-
EndProjectSection
31-
EndProject
32-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "kernel-spec", "kernel-spec", "{4D56C9F0-7F98-4587-A320-98C06876AC9B}"
33-
ProjectSection(SolutionItems) = preProject
34-
kernel-spec\kernel.json = kernel-spec\kernel.json
35-
kernel-spec\logo-32x32.png = kernel-spec\logo-32x32.png
36-
kernel-spec\logo-64x64.png = kernel-spec\logo-64x64.png
37-
EndProjectSection
38-
EndProject
39-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "IfSharp", "src\IfSharp\IfSharp.fsproj", "{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}"
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "IfSharp", "src\IfSharp\IfSharp.fsproj", "{614109A5-EC07-47DA-BE73-D91CCC08FB4F}"
409
EndProject
4110
Global
4211
GlobalSection(SolutionConfigurationPlatforms) = preSolution
43-
Debug|Any CPU = Debug|Any CPU
4412
Debug|x64 = Debug|x64
45-
Release|Any CPU = Release|Any CPU
4613
Release|x64 = Release|x64
4714
EndGlobalSection
4815
GlobalSection(ProjectConfigurationPlatforms) = postSolution
49-
{2FE619B3-4756-4285-B31F-232607F62D78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50-
{2FE619B3-4756-4285-B31F-232607F62D78}.Debug|Any CPU.Build.0 = Debug|Any CPU
51-
{2FE619B3-4756-4285-B31F-232607F62D78}.Debug|x64.ActiveCfg = Debug|x64
52-
{2FE619B3-4756-4285-B31F-232607F62D78}.Debug|x64.Build.0 = Debug|x64
53-
{2FE619B3-4756-4285-B31F-232607F62D78}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{2FE619B3-4756-4285-B31F-232607F62D78}.Release|Any CPU.Build.0 = Release|Any CPU
55-
{2FE619B3-4756-4285-B31F-232607F62D78}.Release|x64.ActiveCfg = Release|x64
56-
{2FE619B3-4756-4285-B31F-232607F62D78}.Release|x64.Build.0 = Release|x64
57-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
59-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Debug|x64.ActiveCfg = Debug|Any CPU
60-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Debug|x64.Build.0 = Debug|Any CPU
61-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
62-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Release|Any CPU.Build.0 = Release|Any CPU
63-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Release|x64.ActiveCfg = Release|Any CPU
64-
{5FC8E68C-C5F9-4FEF-B000-EC99871D3A4E}.Release|x64.Build.0 = Release|Any CPU
16+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Debug|x64.ActiveCfg = Debug|x64
17+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Debug|x64.Build.0 = Debug|x64
18+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Release|x64.ActiveCfg = Release|x64
19+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Release|x64.Build.0 = Release|x64
20+
{614109A5-EC07-47DA-BE73-D91CCC08FB4F}.Debug|x64.ActiveCfg = Debug|x64
21+
{614109A5-EC07-47DA-BE73-D91CCC08FB4F}.Debug|x64.Build.0 = Debug|x64
22+
{614109A5-EC07-47DA-BE73-D91CCC08FB4F}.Release|x64.ActiveCfg = Release|x64
23+
{614109A5-EC07-47DA-BE73-D91CCC08FB4F}.Release|x64.Build.0 = Release|x64
6524
EndGlobalSection
6625
GlobalSection(SolutionProperties) = preSolution
6726
HideSolutionNode = FALSE
6827
EndGlobalSection
69-
GlobalSection(NestedProjects) = preSolution
70-
{45519D10-5973-41C3-A8D0-BCBF0008044D} = {F5A3E866-86FB-44AD-9ED1-DB65D6EB0058}
71-
{3AAFA64D-CBB6-488E-B395-6A1E7CB554CE} = {45519D10-5973-41C3-A8D0-BCBF0008044D}
72-
EndGlobalSection
7328
GlobalSection(ExtensibilityGlobals) = postSolution
74-
SolutionGuid = {0D40E243-FC1E-43DA-B53D-08D731012F40}
29+
SolutionGuid = {6E614E07-33B2-4D12-B1CD-38BBFD484F64}
7530
EndGlobalSection
7631
EndGlobal

IfSharpNetCore.sln

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.421
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "IfSharp.Kernel", "src\IfSharp.Kernel\IfSharp.Kernel.fsproj", "{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}"
7+
EndProject
8+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "IfSharpNetCore", "src\IfSharpNetCore\IfSharpNetCore.fsproj", "{4D3A95BC-3636-4474-B176-9ECCEC4FB3D8}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|x64 = Debug|x64
13+
Release|x64 = Release|x64
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Debug|x64.ActiveCfg = Debug|x64
17+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Debug|x64.Build.0 = Debug|x64
18+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Release|x64.ActiveCfg = Release|x64
19+
{25FE52CD-BCE3-471D-A629-9DC9F0410B6C}.Release|x64.Build.0 = Release|x64
20+
{4D3A95BC-3636-4474-B176-9ECCEC4FB3D8}.Debug|x64.ActiveCfg = Debug|x64
21+
{4D3A95BC-3636-4474-B176-9ECCEC4FB3D8}.Debug|x64.Build.0 = Debug|x64
22+
{4D3A95BC-3636-4474-B176-9ECCEC4FB3D8}.Release|x64.ActiveCfg = Release|x64
23+
{4D3A95BC-3636-4474-B176-9ECCEC4FB3D8}.Release|x64.Build.0 = Release|x64
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {6E614E07-33B2-4D12-B1CD-38BBFD484F64}
30+
EndGlobalSection
31+
EndGlobal

appveyor.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
image: ubuntu
2+
3+
build_script:
4+
- ./build.sh BuildNetCore

azure-pipelines.yml

+16-11
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@
66
trigger:
77
- master
88

9-
pool:
10-
vmImage: 'VS2017-Win2016'
11-
12-
#steps:
13-
#- task: ShellScript@2
14-
# inputs:
15-
# scriptPath: build.sh
16-
17-
steps:
18-
- script: build.cmd
19-
displayName: 'build.cmd'
9+
jobs:
10+
- job: Windows
11+
pool:
12+
vmImage: 'vs2017-win2016'
13+
steps:
14+
- script: build.cmd
15+
- job: macOS
16+
pool:
17+
vmImage: 'macOS-10.13'
18+
steps:
19+
- bash: . '$(Build.SourcesDirectory)/build.sh' BuildNetCore
20+
- job: Linux
21+
pool:
22+
vmImage: 'ubuntu-16.04'
23+
steps:
24+
- bash: . '$(Build.SourcesDirectory)/build.sh' BuildNetCore
2025

2126
#- script: |
2227
# echo Add other tasks to build, test, and deploy your project.

build.fsx

+60-41
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1+
open Fake.Runtime.Trace
2+
open Fake.MSBuildHelper
13
// --------------------------------------------------------------------------------------
24
// FAKE build script
35
// --------------------------------------------------------------------------------------
46

57
#r @"packages/FAKE/tools/FakeLib.dll"
6-
open Fake
8+
open Fake
9+
open Fake.SystemHelper
710
open Fake.Git
11+
open Fake.DotNet
12+
open Fake.IO
813
open Fake.AssemblyInfoFile
914
open Fake.ReleaseNotesHelper
15+
open Fake.Core.TargetOperators
16+
open Fake.IO.Globbing.Operators
1017
open System
18+
open System.IO
1119

1220
// --------------------------------------------------------------------------------------
1321
// START TODO: Provide project-specific details below
@@ -41,67 +49,78 @@ Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
4149
//let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md")
4250

4351
// Generate assembly info files with the right version & up-to-date information
44-
Target "AssemblyInfo" (fun _ ->
45-
let fileName = "src/" + project + "/AssemblyInfo.fs"
46-
CreateFSharpAssemblyInfo fileName
47-
[ Attribute.Title project
48-
Attribute.Product project
49-
Attribute.Description summary
50-
//Attribute.Version release.AssemblyVersion
51-
//Attribute.FileVersion release.AssemblyVersion
52-
]
52+
Fake.Core.Target.create "AssemblyInfo" (fun _ ->
53+
let fileName = "src/" + project + "/AssemblyInfo.fs"
54+
AssemblyInfoFile.createFSharp
55+
fileName
56+
[
57+
//TODO: switch to FAKE5
58+
59+
//Attribute.Title project
60+
//Attribute.Product project
61+
//Attribute.Description summary
62+
//Attribute.Version release.AssemblyVersion
63+
//Attribute.FileVersion release.AssemblyVersion
64+
]
5365
)
5466

5567
// --------------------------------------------------------------------------------------
5668
// Clean build results & restore NuGet packages
5769

58-
Target "Clean" (fun _ ->
59-
CleanDirs ["bin"; "temp"]
70+
Fake.Core.Target.create "Clean" (fun _ ->
71+
Fake.IO.Shell.cleanDirs ["bin"; "temp"]
6072
)
6173

62-
Target "CleanDocs" (fun _ ->
63-
CleanDirs ["docs/output"]
74+
Fake.Core.Target.create "CleanDocs" (fun _ ->
75+
Fake.IO.Shell.cleanDirs ["docs/output"]
6476
)
6577

6678
// --------------------------------------------------------------------------------------
6779
// Build library & test project
68-
Target "Build" (fun _ ->
69-
[ "src/IfSharp/IfSharp.fsproj"]
70-
|> MSBuildRelease "bin" "Rebuild"
71-
|> ignore
80+
Fake.Core.Target.create "BuildNetFramework" (fun _ ->
81+
//Need to restore for .NET Standard
82+
let workingDir = Path.getFullName "src/IfSharp.Kernel"
83+
let result =
84+
DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) "restore" ""
85+
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s messages: %A" "restore" __SOURCE_DIRECTORY__ result.Messages
86+
87+
let setParams (defaults:MSBuildParams) =
88+
{ defaults with
89+
Verbosity = Some(MSBuildVerbosity.Detailed)
90+
Targets = ["Build"]
91+
Properties =
92+
[
93+
"Optimize", "True"
94+
"DebugSymbols", "True"
95+
"Configuration", "Release"
96+
]
97+
}
98+
Fake.DotNet.MSBuild.build setParams "IfSharp.sln"
7299
)
73100

74-
// --------------------------------------------------------------------------------------
75-
// Run the unit tests using test runner & kill test runner when complete
76-
77-
Target "xUnit" (fun _ ->
78-
!! "**/bin/**/*.Tests.dll"
79-
|> Fake.Testing.XUnit2.xUnit2 (fun p ->
80-
{p with
81-
TimeOut = TimeSpan.FromMinutes 5.
82-
HtmlOutputPath = Some "xunit.html"})
83-
)
84-
85-
FinalTarget "CloseTestRunner" (fun _ ->
86-
ProcessHelper.killProcess "nunit-agent.exe"
101+
Fake.Core.Target.create "BuildNetCore" (fun _ ->
102+
let workingDir = Path.getFullName "src/IfSharpNetCore"
103+
let result =
104+
DotNet.exec (DotNet.Options.withWorkingDirectory __SOURCE_DIRECTORY__) "build" "IfSharpNetCore.sln"
105+
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s messages: %A" "build" workingDir result.Messages
87106
)
88107

89-
90-
Target "Release" DoNothing
91-
92108
// --------------------------------------------------------------------------------------
93109
// Run all targets by default. Invoke 'build <Target>' to override
94110

95-
Target "All" DoNothing
111+
Fake.Core.Target.create "All" ignore
96112

97113
"Clean"
98-
==> "AssemblyInfo"
99-
==> "Build"
114+
==> "BuildNetCore"
115+
116+
"Clean"
117+
==> "BuildNetFramework"
118+
119+
"BuildNetCore"
100120
==> "All"
101121

102-
"All"
103-
==> "xUnit"
104-
==> "Release"
122+
"BuildNetFramework"
123+
==> "All"
105124

106125

107-
RunTargetOrDefault "All"
126+
Fake.Core.Target.runOrDefault "All"

0 commit comments

Comments
 (0)