Skip to content

Commit fc19d52

Browse files
Merge pull request #26 from rasmusjp/feature/nuget-build
Create NuGet package
2 parents 1284369 + e16f21f commit fc19d52

File tree

10 files changed

+712
-395
lines changed

10 files changed

+712
-395
lines changed

Our.Umbraco.GraphQL.sln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "samples\Website\
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BE019E17-BF39-443C-8D62-74940D3B6560}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.GraphQL", "src\Our.Umbraco.GraphQL\Our.Umbraco.GraphQL.csproj", "{59294783-3A17-479B-90C5-A3A2967176DE}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Our.Umbraco.GraphQL", "src\Our.Umbraco.GraphQL\Our.Umbraco.GraphQL.csproj", "{59294783-3A17-479B-90C5-A3A2967176DE}"
1313
EndProject
1414
Global
1515
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,7 +20,6 @@ Global
2020
{C2001952-0774-4BFA-AF30-043B3B16D275}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2121
{C2001952-0774-4BFA-AF30-043B3B16D275}.Debug|Any CPU.Build.0 = Debug|Any CPU
2222
{C2001952-0774-4BFA-AF30-043B3B16D275}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{C2001952-0774-4BFA-AF30-043B3B16D275}.Release|Any CPU.Build.0 = Release|Any CPU
2423
{59294783-3A17-479B-90C5-A3A2967176DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2524
{59294783-3A17-479B-90C5-A3A2967176DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
2625
{59294783-3A17-479B-90C5-A3A2967176DE}.Release|Any CPU.ActiveCfg = Release|Any CPU

appveyor.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '{build}'
2+
os: Visual Studio 2017
3+
init:
4+
- git config --global core.autocrlf input
5+
- git config --global core.longpaths true
6+
shallow_clone: true
7+
build_script:
8+
build.cmd package
9+
test: off
10+
artifacts:
11+
- path: artifacts\*.nupkg
12+
name: NuGetPackages
13+
deploy: off

build.cmd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@ECHO OFF
2+
SETLOCAL EnableDelayedExpansion
3+
CLS
4+
5+
SET "buildVersion="
6+
IF DEFINED APPVEYOR_BUILD_NUMBER (
7+
SET buildVersion=%APPVEYOR_BUILD_NUMBER%
8+
SET buildVersion=00000!buildVersion!
9+
SET buildVersion=!buildVersion:~-6!
10+
SET buildVersion=build!buildVersion!
11+
) ELSE (
12+
SET /p versionSuffix="Please enter a version suffix (e.g. alpha001):"
13+
SET buildVersion=!versionSuffix!
14+
)
15+
16+
SET "target=%*"
17+
IF NOT DEFINED target (
18+
SET "target=default"
19+
)
20+
21+
dotnet tool install fake-cli --tool-path tools\bin\ --version 5.*
22+
tools\bin\fake.exe run tools\build.fsx --parallel 3 --target %target% -e buildVersion=!buildVersion!

src/Our.Umbraco.GraphQL/Our.Umbraco.GraphQL.csproj

Lines changed: 37 additions & 310 deletions
Large diffs are not rendered by default.

src/Our.Umbraco.GraphQL/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Umbraco.Core;
2+
using Umbraco.Web;
3+
4+
using Our.Umbraco.GraphQL.Web;
5+
6+
namespace $rootnamespace$
7+
{
8+
public class GraphQLConfig : ApplicationEventHandler
9+
{
10+
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
11+
{
12+
UmbracoDefaultOwinStartup.MiddlewareConfigured += (sender, e) =>
13+
e.AppBuilder.UseUmbracoGraphQL(applicationContext, new GraphQLServerOptions());
14+
}
15+
}
16+
}

src/Our.Umbraco.GraphQL/packages.config

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

tools/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.fake/
2+
.nuget/

tools/build.fsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// include Fake lib
2+
#r "paket:
3+
source nuget/dotnetcore
4+
source https://api.nuget.org/v3/index.json
5+
nuget FSharp.Core ~> 4.1
6+
nuget Fake.Core.Target
7+
nuget Fake.DotNet.Cli
8+
nuget Fake.IO.FileSystem //"
9+
#load "./.fake/build.fsx/intellisense.fsx"
10+
11+
open System
12+
open System.IO
13+
open Fake.Core
14+
open Fake.DotNet
15+
open Fake.IO
16+
17+
// Properties
18+
let currentDirectory = Directory.GetCurrentDirectory()
19+
let solutionFile = Directory.findFirstMatchingFile "*.sln" currentDirectory
20+
let artifactsDir = Path.getFullName "./artifacts/"
21+
22+
let buildVersion = if not BuildServer.isLocalBuild then Some BuildServer.buildVersion else None
23+
24+
// Targets
25+
Target.create "Clean" (fun _ ->
26+
Shell.cleanDirs [artifactsDir]
27+
)
28+
29+
Target.create "Build" (fun _ ->
30+
DotNet.build (fun c ->
31+
{ c with
32+
Configuration = DotNet.BuildConfiguration.Release
33+
OutputPath = Some artifactsDir
34+
}) solutionFile
35+
)
36+
37+
Target.create "Package" (fun _ ->
38+
DotNet.pack (fun c ->
39+
{ c with
40+
Configuration = DotNet.BuildConfiguration.Release
41+
OutputPath = Some artifactsDir
42+
VersionSuffix = buildVersion
43+
}) solutionFile
44+
)
45+
46+
Target.create "Default" ignore
47+
48+
open Fake.Core.TargetOperators
49+
50+
"Clean"
51+
==> "Build"
52+
==> "Default"
53+
54+
"Clean"
55+
==> "Package"
56+
57+
// start build
58+
Target.runOrDefault "Default"

0 commit comments

Comments
 (0)