Skip to content

Commit e52972b

Browse files
committed
Merge branch 'develop'
2 parents 0c74843 + 69a6400 commit e52972b

File tree

36 files changed

+5604
-16
lines changed

36 files changed

+5604
-16
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Giraffe web application template for the `dotnet new` command.
1313
- [Optional parameters](#optional-parameters)
1414
- [--ViewEngine](#--viewengine)
1515
- [--IncludeTests](#--includetests)
16+
- [--UsePaket](#--usepaket)
1617
- [Updating the template](#updating-the-template)
1718
- [Nightly builds and NuGet feed](#nightly-builds-and-nuget-feed)
1819
- [More information](#more-information)
@@ -49,6 +50,7 @@ The Giraffe template supports three different view engines:
4950
- `giraffe` (default)
5051
- `razor`
5152
- `dotliquid`
53+
- `none`
5254

5355
You can optionally specify the `--ViewEngine` parameter (short `-V`) to pass in one of the supported values:
5456

@@ -78,6 +80,20 @@ This parameter can also be combined with other parameters:
7880
dotnet new giraffe --ViewEngine razor --IncludeTests
7981
```
8082

83+
### --UsePaket
84+
85+
If you prefer [Paket](https://fsprojects.github.io/) for managing your project dependencies then you can specify `--UsePaket` (`-U` for short):
86+
87+
```
88+
dotnet new giraffe --UsePaket
89+
```
90+
91+
This will exclude the package references from the *fsproj* file and include the needed *paket.dependencies* and *paket.references* files.
92+
93+
> If you do not run *build.bat* (or *build.sh* on **nix) before running `dotnet restore` you need to manually run `./.paket/paket.exe install` (or `mono ./.paket/paket.exe install`).
94+
95+
See the [Paket documentation](https://fsprojects.github.io/) for more details.
96+
8197
## Updating the template
8298

8399
Whenever there is a new version of the Giraffe template you can update it by re-running the [instructions from the installation](#installation).
@@ -106,4 +122,4 @@ For more information about Giraffe, how to set up a development environment, con
106122

107123
## License
108124

109-
[Apache 2.0](https://raw.githubusercontent.com/giraffe-fsharp/Giraffe.DotLiquid/master/LICENSE)
125+
[Apache 2.0](https://raw.githubusercontent.com/giraffe-fsharp/giraffe-template/master/LICENSE)

RELEASE_NOTES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Release Notes
22
=============
33

4+
## 0.12.0
5+
6+
#### New features
7+
8+
- Added `none` as a new option to the `--ViewEngine` parameter, which will create a Giraffe web application without any view engine (Web API only).
9+
- Added a new parameter called `--UsePaket` which will use Paket instead of NuGet as the package manager for the Giraffe web application.
10+
11+
#### Enhancements
12+
13+
- Updated the default Giraffe template to the latest version of Giraffe and made use of the new HTML attributes from the `GiraffeViewEngine`.
14+
415
## 0.11.0
516

617
#### New features

build.ps1

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ function Invoke-Cmd ($cmd)
2121
if ($LastExitCode -ne 0) { Write-Error "An error occured when executing '$cmd'."; return }
2222
}
2323

24+
function dotnet-restore ($project, $argv) { Invoke-Cmd "dotnet restore $project $argv" }
25+
function dotnet-build ($project, $argv) { Invoke-Cmd "dotnet build $project $argv" }
26+
function dotnet-run ($project, $argv) { Invoke-Cmd "dotnet run --project $project $argv" }
27+
function dotnet-test ($project, $argv) { Invoke-Cmd "dotnet test $project $argv" }
28+
function dotnet-pack ($project, $argv) { Invoke-Cmd "dotnet pack $project $argv" }
29+
2430
function Test-Version ($project)
2531
{
2632
if ($env:APPVEYOR_REPO_TAG -eq $true)
@@ -55,6 +61,18 @@ function Update-AppVeyorBuildVersion ($project)
5561
}
5662
}
5763

64+
function Remove-BuildArtifacts
65+
{
66+
Write-Host "Deleting build artifacts..." -ForegroundColor Magenta
67+
68+
Get-ChildItem -Include "bin", "obj" -Recurse -Directory `
69+
| ForEach-Object {
70+
Write-Host "Removing folder $_" -ForegroundColor DarkGray
71+
Remove-Item $_ -Recurse -Force }
72+
73+
Remove-Item -Path "giraffe-template.*.nupkg" -Force
74+
}
75+
5876
# ----------------------------------------------
5977
# Main
6078
# ----------------------------------------------
@@ -66,4 +84,48 @@ Test-Version $nuspec
6684

6785
Write-Host "Building giraffe-template package..." -ForegroundColor Magenta
6886

87+
Remove-BuildArtifacts
88+
89+
# Test Giraffe template
90+
$giraffeApp = "src/content/Giraffe/src/AppNamePlaceholder/AppNamePlaceholder.fsproj"
91+
$giraffeTests = "src/content/Giraffe/tests/AppNamePlaceholder.Tests/AppNamePlaceholder.Tests.fsproj"
92+
93+
dotnet-restore $giraffeApp
94+
dotnet-build $giraffeApp
95+
dotnet-restore $giraffeTests
96+
dotnet-build $giraffeTests
97+
dotnet-test $giraffeTests
98+
99+
# Test Razor template
100+
$razorApp = "src/content/Razor/src/AppNamePlaceholder/AppNamePlaceholder.fsproj"
101+
$razorTests = "src/content/Razor/tests/AppNamePlaceholder.Tests/AppNamePlaceholder.Tests.fsproj"
102+
103+
dotnet-restore $razorApp
104+
dotnet-build $razorApp
105+
dotnet-restore $razorTests
106+
dotnet-build $razorTests
107+
dotnet-test $razorTests
108+
109+
# Test DotLiquid template
110+
$dotLiquidApp = "src/content/DotLiquid/src/AppNamePlaceholder/AppNamePlaceholder.fsproj"
111+
$dotLiquidTests = "src/content/DotLiquid/tests/AppNamePlaceholder.Tests/AppNamePlaceholder.Tests.fsproj"
112+
113+
dotnet-restore $dotLiquidApp
114+
dotnet-build $dotLiquidApp
115+
dotnet-restore $dotLiquidTests
116+
dotnet-build $dotLiquidTests
117+
dotnet-test $dotLiquidTests
118+
119+
# Test None template
120+
$noneApp = "src/content/None/src/AppNamePlaceholder/AppNamePlaceholder.fsproj"
121+
$noneTests = "src/content/None/tests/AppNamePlaceholder.Tests/AppNamePlaceholder.Tests.fsproj"
122+
123+
dotnet-restore $noneApp
124+
dotnet-build $noneApp
125+
dotnet-restore $noneTests
126+
dotnet-build $noneTests
127+
dotnet-test $noneTests
128+
129+
# Create template NuGet package
130+
Remove-BuildArtifacts
69131
Invoke-Cmd "nuget pack src/giraffe-template.nuspec"

src/content/.template.config/template.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,22 @@
2525
{
2626
"choice": "dotliquid",
2727
"description": "DotLiquid template engine"
28+
},
29+
{
30+
"choice": "none",
31+
"description": "No template engine (API only)"
2832
}
2933
]
3034
},
3135
"IncludeTests": {
3236
"type": "parameter",
3337
"dataType": "bool",
3438
"defaultValue": "false"
39+
},
40+
"UsePaket": {
41+
"type": "parameter",
42+
"dataType": "bool",
43+
"defaultValue": "false"
3544
}
3645
},
3746
"sources": [
@@ -43,6 +52,10 @@
4352
{
4453
"condition": "(!IncludeTests)",
4554
"exclude": [ "**/AppNamePlaceholder.Tests/**/*" ]
55+
},
56+
{
57+
"condition": "(!UsePaket)",
58+
"exclude": [ "**/paket.*" ]
4659
}
4760
]
4861
},
@@ -54,13 +67,43 @@
5467
{
5568
"condition": "(!IncludeTests)",
5669
"exclude": [ "**/AppNamePlaceholder.Tests/**/*" ]
70+
},
71+
{
72+
"condition": "(!UsePaket)",
73+
"exclude": [ "**/paket.*" ]
5774
}
5875
]
5976
},
6077
{
6178
"source": "./DotLiquid/",
6279
"target": "./",
6380
"condition": "(ViewEngine == \"dotliquid\")",
81+
"modifiers": [
82+
{
83+
"condition": "(!IncludeTests)",
84+
"exclude": [ "**/AppNamePlaceholder.Tests/**/*" ]
85+
},
86+
{
87+
"condition": "(!UsePaket)",
88+
"exclude": [ "**/paket.*" ]
89+
}
90+
]
91+
},
92+
{
93+
"source": "./Paket/",
94+
"target": "./",
95+
"condition": "(UsePaket)",
96+
"modifiers": [
97+
{
98+
"condition": "(!IncludeTests)",
99+
"exclude": [ "**/AppNamePlaceholder.Tests/**/*" ]
100+
}
101+
]
102+
},
103+
{
104+
"source": "./None/",
105+
"target": "./",
106+
"condition": "(ViewEngine == \"none\")",
64107
"modifiers": [
65108
{
66109
"condition": "(!IncludeTests)",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
storage: none
2+
source https://api.nuget.org/v3/index.json
3+
4+
clitool dotnet-xunit
5+
clitool Microsoft.DotNet.Watcher.Tools
6+
nuget Microsoft.AspNetCore.Cors
7+
nuget Microsoft.AspNetCore.Hosting
8+
nuget Microsoft.AspNetCore.Diagnostics
9+
nuget Microsoft.AspNetCore.Server.Kestrel
10+
nuget Microsoft.AspNetCore.Server.IISIntegration
11+
nuget Microsoft.AspNetCore.StaticFiles
12+
nuget Microsoft.Extensions.Logging.Console
13+
nuget Microsoft.Extensions.Logging.Debug
14+
nuget Microsoft.AspNetCore.Authentication.Cookies
15+
nuget Microsoft.Extensions.DependencyInjection
16+
nuget Giraffe
17+
nuget Microsoft.NET.Test.Sdk
18+
nuget xunit
19+
nuget xunit.runner.visualstudio
20+
nuget Microsoft.AspNetCore.TestHost
21+
nuget Giraffe.DotLiquid

0 commit comments

Comments
 (0)