Skip to content

Commit ea73e4e

Browse files
author
Juri
committed
Removed Paket and Fake-CLI, migrated to Packages.props, updated to .NET 6 and F# 6
1 parent 2955486 commit ea73e4e

File tree

50 files changed

+347
-2323
lines changed

Some content is hidden

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

50 files changed

+347
-2323
lines changed

.config/dotnet-tools.json

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
{
2-
"version": 1,
3-
"isRoot": true,
4-
"tools": {
5-
"paket": {
6-
"version": "5.257.0",
7-
"commands": [
8-
"paket"
9-
]
10-
},
11-
"fake-cli": {
12-
"version": "5.20.4",
13-
"commands": [
14-
"fake"
15-
]
16-
},
17-
"fsharp.formatting.commandtool": {
18-
"version": "11.1.0",
19-
"commands": [
20-
"fsdocs"
21-
]
22-
}
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fsharp.formatting.commandtool": {
6+
"version": "11.1.0",
7+
"commands": [
8+
"fsdocs"
9+
]
2310
}
11+
}
2412
}

.github/workflows/dotnetcore.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macOS-latest]
23-
dotnet: [5.0.100]
23+
dotnet: [6.0.400]
2424
runs-on: ${{ matrix.os }}
2525

2626
steps:
@@ -31,7 +31,5 @@ jobs:
3131
dotnet-version: ${{ matrix.dotnet }}
3232
- name: Install local tools
3333
run: dotnet tool restore
34-
- name: Paket Restore
35-
run: dotnet paket restore
3634
- name: Build and Test
37-
run: dotnet fake run build.fsx
35+
run: dotnet fsi build.fsx

.paket/Paket.Restore.targets

Lines changed: 0 additions & 494 deletions
This file was deleted.

Directory.Build.targets

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project>
2+
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.1.3" />
3+
4+
<PropertyGroup>
5+
<LangVersion>6.0</LangVersion>
6+
<!--<NoWarn>$(NoWarn)</NoWarn>-->
7+
<TreatWarningsAsErrors Condition="'$(Configuration)' != 'Debug'">true</TreatWarningsAsErrors>
8+
</PropertyGroup>
9+
10+
<PropertyGroup Label="NuGet">
11+
<Authors>John Bazinga, Andrii Chebukin, </Authors>
12+
<Product>FSharp.Data.GraphQL</Product>
13+
<Summary>F# implementation of Facebook GraphQL query language</Summary>
14+
15+
<PackageVersion>1.1.0</PackageVersion>
16+
<PackageTags>FSharp GraphQL Relay React Middleware</PackageTags>
17+
<PackageReadmeFile>README.md</PackageReadmeFile>
18+
<!--<PackageIcon>packageIcon.png</PackageIcon>-->
19+
<!--<PackageIconUrl>https://www.newtonsoft.com/content/images/nugeticon.png</PackageIconUrl>-->
20+
<PackageProjectUrl>https://fsprojects.github.io/FSharp.Data.GraphQL</PackageProjectUrl>
21+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
22+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
23+
<IncludeSymbols>true</IncludeSymbols>
24+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
25+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
26+
27+
<MinVerTagPrefix>v</MinVerTagPrefix>
28+
</PropertyGroup>
29+
</Project>

FSharp.Data.GraphQL.sln

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.28922.388
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32811.315
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{63297B98-5CED-492C-A5B7-A5B4F73CF142}"
7-
ProjectSection(SolutionItems) = preProject
8-
paket.dependencies = paket.dependencies
9-
paket.lock = paket.lock
10-
EndProjectSection
11-
EndProject
126
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}"
137
EndProject
148
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Data.GraphQL.Server", "src\FSharp.Data.GraphQL.Server\FSharp.Data.GraphQL.Server.fsproj", "{474179D3-0090-49E9-88F8-2971C0966077}"
@@ -137,6 +131,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server", "server", "{9D5C46
137131
samples\client-provider\file-upload\server\types.mjs = samples\client-provider\file-upload\server\types.mjs
138132
EndProjectSection
139133
EndProject
134+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E3330910-8B6C-4191-8046-D6D57FBC39B1}"
135+
ProjectSection(SolutionItems) = preProject
136+
Directory.Build.targets = Directory.Build.targets
137+
global.json = global.json
138+
LICENSE.txt = LICENSE.txt
139+
Packages.props = Packages.props
140+
README.md = README.md
141+
RELEASE_NOTES.md = RELEASE_NOTES.md
142+
EndProjectSection
143+
EndProject
144+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6B17B8F2-DD8B-4FA1-BA9C-6FF4F668923C}"
145+
ProjectSection(SolutionItems) = preProject
146+
build.cmd = build.cmd
147+
build.fsx = build.fsx
148+
build.sh = build.sh
149+
EndProjectSection
150+
EndProject
140151
Global
141152
GlobalSection(SolutionConfigurationPlatforms) = preSolution
142153
Debug|Any CPU = Debug|Any CPU

Packages.props

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MicrosoftExtensionsVersion>6.0.*</MicrosoftExtensionsVersion>
5+
<AspNetCoreVersion>6.0.*</AspNetCoreVersion>
6+
<XUnitVersion>2.*</XUnitVersion>
7+
</PropertyGroup>
8+
<ItemGroup Label="Common">
9+
<PackageReference Update="FParsec" Version="1.1.1" />
10+
<!--<PackageReference Update="FSharp.Core" Version="4.7.2">-->
11+
<PackageReference Update="FSharp.Core" Version="6.0.*">
12+
<ExcludeAssets>contentFiles</ExcludeAssets>
13+
</PackageReference>
14+
<PackageReference Update="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsVersion)" />
15+
<PackageReference Update="NuGet.CommandLine" Version="1.*" />
16+
<PackageReference Update="System.Reactive" Version="5.*" />
17+
</ItemGroup>
18+
<ItemGroup Label="Tests and Samples">
19+
<PackageReference Update="BenchmarkDotNet" Version="0.*" />
20+
<PackageReference Update="EntityFramework" Version="1.*" />
21+
<PackageReference Update="FSharp.Data.TypeProviders" Version="1.*" />
22+
<PackageReference Update="Giraffe" Version="6.*" />
23+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.*" />
24+
<PackageReference Update="Newtonsoft.Json" Version="13.*" />
25+
<PackageReference Update="Suave" Version="2.*" />
26+
<PackageReference Update="System.Net.Http" Version="4.3.4" />
27+
<PackageReference Update="xunit" Version="$(XUnitVersion)" />
28+
<PackageReference Update="xunit.runner.utility" Version="$(XUnitVersion)" />
29+
<PackageReference Update="xunit.runner.console" Version="$(XUnitVersion)" />
30+
<PackageReference Update="xunit.runner.visualstudio" Version="$(XUnitVersion)" />
31+
</ItemGroup>
32+
</Project>

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
dotnet tool restore
2-
dotnet fake run build.fsx %*
2+
dotnet fsi build.fsx %*

build.fsx

Lines changed: 41 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
#r "paket:
2-
nuget Fake.Core.Target
3-
nuget Fake.DotNet.Cli
4-
nuget Fake.Tools.Git
5-
nuget Fake.DotNet.AssemblyInfoFile
6-
nuget Fake.Core.ReleaseNotes
7-
nuget Fake.Core.UserInput
8-
nuget Fake.DotNet.MSBuild
9-
nuget Fake.IO.FileSystem
10-
nuget Fake.DotNet.Fsc
11-
nuget Fake.Api.GitHub
12-
nuget Fake.DotNet.Paket
13-
nuget Octokit
14-
nuget FSharp.Core //"
15-
16-
#if !FAKE
17-
#load ".fake/build.fsx/intellisense.fsx"
18-
#endif
1+
#r "nuget: Fake.Api.GitHub"
2+
#r "nuget: Fake.Core.ReleaseNotes"
3+
#r "nuget: Fake.Core.Target"
4+
#r "nuget: Fake.Core.UserInput"
5+
#r "nuget: Fake.DotNet.AssemblyInfoFile"
6+
#r "nuget: Fake.DotNet.Cli"
7+
#r "nuget: Fake.DotNet.Fsc"
8+
#r "nuget: Fake.DotNet.MSBuild"
9+
#r "nuget: Fake.IO.FileSystem"
10+
#r "nuget: Fake.Tools.Git"
11+
#r "nuget: System.Reactive"
12+
#r "nuget: Octokit"
1913

2014
open System
2115
open System.IO
@@ -24,6 +18,7 @@ open System.Threading
2418
open Fake
2519
open Fake.Tools.Git
2620
open Fake.DotNet
21+
open Fake.DotNet.NuGet
2722
open Fake.IO
2823
open Fake.IO.FileSystemOperators
2924
open Fake.IO.Globbing.Operators
@@ -33,57 +28,32 @@ open Fake.Core
3328
open Fake.Api
3429
open Octokit
3530

31+
// https://github.com/fsprojects/FAKE/issues/2517
32+
// Regular header and `#load ".fake/build.fsx/intellisense.fsx"`
33+
34+
#if !FAKE
35+
let execContext =
36+
System.Environment.GetCommandLineArgs()
37+
|> Array.skip 2 // skip fsi.exe; build.fsx
38+
|> Array.toList
39+
|> Fake.Core.Context.FakeExecutionContext.Create false __SOURCE_FILE__
40+
execContext
41+
|> Fake.Core.Context.RuntimeContext.Fake
42+
|> Fake.Core.Context.setExecutionContext
43+
#endif
44+
3645
// --------------------------------------------------------------------------------------
3746
// Information about the project are used
3847
// --------------------------------------------------------------------------------------
39-
// - for version and project name in generated AssemblyInfo file
4048
// - by the generated NuGet package
4149
// - to run tests and to publish documentation on GitHub gh-pages
4250
// - for documentation, you also need to edit info in "docs/tools/generate.fsx"
4351

44-
52+
let [<Literal>] DotNetMoniker = "net6.0"
4553
let project = "FSharp.Data.GraphQL"
46-
let summary = "FSharp implementation of Facebook GraphQL query language"
47-
let gitName = "FSharp.Data.GraphQL"
4854
let release = ReleaseNotes.load "RELEASE_NOTES.md"
4955
let projectRepo = "https://github.com/fsprojects/FSharp.Data.GraphQL.git"
5056

51-
// Generate assembly info files with the right version & up-to-date information
52-
Target.create "AssemblyInfo" (fun _ ->
53-
let getAssemblyInfoAttributes projectName =
54-
[ AssemblyInfo.Title projectName
55-
AssemblyInfo.Product project
56-
AssemblyInfo.Description summary
57-
AssemblyInfo.Version release.AssemblyVersion
58-
AssemblyInfo.FileVersion release.AssemblyVersion ]
59-
let internalsVisibility (fsproj: string) =
60-
match fsproj with
61-
| f when f.EndsWith "FSharp.Data.GraphQL.Shared.fsproj" ->
62-
[ AssemblyInfo.InternalsVisibleTo "FSharp.Data.GraphQL.Server"
63-
AssemblyInfo.InternalsVisibleTo "FSharp.Data.GraphQL.Client"
64-
AssemblyInfo.InternalsVisibleTo "FSharp.Data.GraphQL.Client.DesignTime"
65-
AssemblyInfo.InternalsVisibleTo "FSharp.Data.GraphQL.Tests" ]
66-
| f when f.EndsWith "FSharp.Data.GraphQL.Server.fsproj" ->
67-
[ AssemblyInfo.InternalsVisibleTo "FSharp.Data.GraphQL.Benchmarks"
68-
AssemblyInfo.InternalsVisibleTo "FSharp.Data.GraphQL.Tests" ]
69-
| _ -> []
70-
71-
let getProjectDetails (projectPath:string) =
72-
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
73-
( projectPath,
74-
projectName,
75-
System.IO.Path.GetDirectoryName(projectPath),
76-
(getAssemblyInfoAttributes projectName)
77-
)
78-
79-
!! "src/**/*.fsproj"
80-
//-- "src/FSharp.Data.GraphQL.Client.DesignTime/FSharp.Data.GraphQL.Client.DesignTime.fsproj"
81-
|> Seq.map getProjectDetails
82-
|> Seq.iter (fun (projFileName, _, folderName, attributes) ->
83-
AssemblyInfoFile.createFSharp (folderName </> "AssemblyInfo.fs") (attributes @ internalsVisibility projFileName)
84-
)
85-
)
86-
8757
// --------------------------------------------------------------------------------------
8858
// Clean build results
8959

@@ -98,16 +68,10 @@ Target.create "CleanDocs" (fun _ ->
9868
// --------------------------------------------------------------------------------------
9969
// Build library & test project
10070

101-
// We need to disable parallel restoring of projects to because running paket in parallel from Mono
102-
// is giving errors in Unix based operating systems.
10371
Target.create "Restore" (fun _ ->
10472
!! "src/**/*.??proj"
10573
-- "src/**/*.shproj"
106-
|> Seq.iter (fun pattern ->
107-
DotNet.restore (fun options ->
108-
{ options with MSBuildParams = { options.MSBuildParams with DisableInternalBinLog = true } }
109-
) pattern
110-
))
74+
|> Seq.iter (fun pattern -> DotNet.restore id pattern))
11175

11276

11377
Target.create "Build" <| fun _ ->
@@ -123,7 +87,7 @@ let startGraphQLServer (project: string) (streamRef: DataRef<Stream>) =
12387

12488
let projectName = Path.GetFileNameWithoutExtension(project)
12589
let projectPath = Path.GetDirectoryName(project)
126-
let serverExe = projectPath </> "bin" </> "Release" </> "net5.0" </> (projectName + ".dll")
90+
let serverExe = projectPath </> "bin" </> "Release" </> DotNetMoniker </> (projectName + ".dll")
12791

12892
CreateProcess.fromRawCommandLine "dotnet" serverExe
12993
|> CreateProcess.withStandardInput (CreatePipe streamRef)
@@ -215,22 +179,19 @@ Target.create "ReleaseDocs" (fun _ ->
215179

216180
let pack id =
217181
Shell.cleanDir <| sprintf "nuget/%s.%s" project id
218-
Paket.pack(fun p ->
182+
id
183+
|> NuGet.NuGetPack(fun p ->
219184
{ p with
220-
ToolType = ToolType.CreateLocalTool()
221185
Version = release.NugetVersion
222186
OutputPath = sprintf "nuget/%s.%s" project id
223-
TemplateFile = sprintf "src/%s.%s/%s.%s.fsproj.paket.template" project id project id
224-
MinimumFromLockFile = true
225-
IncludeReferencedProjects = false })
187+
//IncludeReferencedProjects = false
188+
})
226189

227190
let publishPackage id =
228191
pack id
229-
Paket.push(fun p ->
192+
NuGet.NuGetPublish(fun p ->
230193
{ p with
231-
ToolType = ToolType.CreateLocalTool()
232-
WorkingDir = sprintf "nuget/%s.%s" project id
233-
PublishUrl = "https://www.nuget.org/api/v2/package" })
194+
WorkingDir = sprintf "nuget/%s.%s" project id })
234195

235196
Target.create "PublishServer" (fun _ ->
236197
publishPackage "Server"
@@ -269,7 +230,6 @@ Target.create "PackAll" ignore
269230

270231
"Clean"
271232
==> "Restore"
272-
=?> ("AssemblyInfo", BuildServer.isLocalBuild)
273233
==> "Build"
274234
==> "RunUnitTests"
275235
==> "StartStarWarsServer"
@@ -287,4 +247,8 @@ Target.create "PackAll" ignore
287247
==> "PackMiddleware"
288248
==> "PackAll"
289249

290-
Target.runOrDefault "All"
250+
Target.runOrDefaultWithArguments "All"
251+
252+
#if !FAKE
253+
execContext.Context.Clear()
254+
#endif

0 commit comments

Comments
 (0)