Skip to content

Commit f985d3a

Browse files
author
Jimmy Byrd
committed
Closes #81
This implements the templating hacks in dotnet/templating#1168 (comment) to allow for dashes in names.
1 parent c80966d commit f985d3a

14 files changed

+53
-49
lines changed

Content/.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Describe the big picture of your changes here to communicate to the maintainers
44

55
## Types of changes
66

7-
What types of changes does your code introduce to MyLib?
7+
What types of changes does your code introduce to MyLib.1?
88
_Put an `x` in the boxes that apply_
99

1010
- [ ] Bugfix (non-breaking change which fixes an issue)
+30-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
{
2-
"author": "Jimmy Byrd",
3-
"classifications": [ "Scaffold" ],
4-
"name": "MiniScaffold",
5-
"tags": {
6-
"language": "F#"
7-
},
8-
"identity": "MiniScaffold",
9-
"shortName": "mini-scaffold",
10-
"sourceName": "MyLib",
11-
// This allows using the `-n` option to create a new directory
12-
"preferNameDirectory": true,
13-
"symbols":{
14-
"githubUsername": {
15-
"type": "parameter",
16-
"replaces":"MyGithubUsername"
17-
}
18-
},
19-
"postActions": [{
20-
"condition": "(OS != \"Windows_NT\")",
21-
"description": "Make scripts executable",
22-
"manualInstructions": [ { "text": "Run 'chmod +x *.sh'" } ],
23-
"actionId": "cb9a6cf3-4f5c-4860-b9d2-03a574959774",
24-
"args": {
25-
"+x": "*.sh"
26-
},
27-
"continueOnError": true
28-
}]
29-
}
2+
"author": "Jimmy Byrd",
3+
"classifications": ["Scaffold"],
4+
"name": "MiniScaffold",
5+
"tags": {
6+
"language": "F#"
7+
},
8+
"identity": "MiniScaffold",
9+
"shortName": "mini-scaffold",
10+
"sourceName": "MyLib.1",
11+
// This allows using the `-n` option to create a new directory
12+
"preferNameDirectory": true,
13+
"symbols": {
14+
"githubUsername": {
15+
"type": "parameter",
16+
"replaces": "MyGithubUsername"
17+
}
18+
},
19+
"postActions": [{
20+
"condition": "(OS != \"Windows_NT\")",
21+
"description": "Make scripts executable",
22+
"manualInstructions": [{
23+
"text": "Run 'chmod +x *.sh'"
24+
}],
25+
"actionId": "cb9a6cf3-4f5c-4860-b9d2-03a574959774",
26+
"args": {
27+
"+x": "*.sh"
28+
},
29+
"continueOnError": true
30+
}]
31+
}

Content/MyLib.sln Content/MyLib.1.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ VisualStudioVersion = 15.0.26124.0
55
MinimumVisualStudioVersion = 15.0.26124.0
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C397A34C-84F1-49E7-AEBC-2F9F2B196216}"
77
EndProject
8-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib", "src\MyLib\MyLib.fsproj", "{5D30E174-2538-47AC-8443-318C8C5DC2C9}"
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.1", "src\MyLib.1\MyLib.1.fsproj", "{5D30E174-2538-47AC-8443-318C8C5DC2C9}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ACBEE43C-7A88-4FB1-9B06-DB064D22B29F}"
1111
EndProject
12-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.Tests", "tests\MyLib.Tests\MyLib.Tests.fsproj", "{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}"
12+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.1.Tests", "tests\MyLib.1.Tests\MyLib.1.Tests.fsproj", "{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}"
1313
EndProject
1414
Global
1515
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Content/build.fsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ open Fake.UserInputHelper
77
open System
88

99
let release = LoadReleaseNotes "RELEASE_NOTES.md"
10-
let productName = "MyLib"
11-
let sln = "MyLib.sln"
10+
let productName = "MyLib.1"
11+
let sln = "MyLib.1.sln"
1212
let srcGlob =__SOURCE_DIRECTORY__ @@ "src/**/*.??proj"
1313
let testsGlob = __SOURCE_DIRECTORY__ @@ "tests/**/*.??proj"
1414
let distDir = __SOURCE_DIRECTORY__ @@ "dist"
@@ -18,7 +18,7 @@ let toolsDir = __SOURCE_DIRECTORY__ @@ "tools"
1818
let coverageReportDir = __SOURCE_DIRECTORY__ @@ "docs" @@ "coverage"
1919

2020
let gitOwner = "MyGithubUsername"
21-
let gitRepoName = "MyLib"
21+
let gitRepoName = "MyLib.1"
2222

2323
let configuration =
2424
EnvironmentHelper.environVarOrDefault "CONFIGURATION" "Release"

Content/src/MyLib/AssemblyInfo.fs Content/src/MyLib.1/AssemblyInfo.fs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
namespace System
33
open System.Reflection
44

5-
[<assembly: AssemblyTitleAttribute("MyLib")>]
6-
[<assembly: AssemblyProductAttribute("MyLib")>]
5+
[<assembly: AssemblyTitleAttribute("MyLib.1")>]
6+
[<assembly: AssemblyProductAttribute("MyLib.1")>]
77
[<assembly: AssemblyVersionAttribute("0.1.0")>]
88
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2017-03-17T00:00:00.0000000")>]
99
[<assembly: AssemblyFileVersionAttribute("0.1.0")>]
@@ -13,8 +13,8 @@ open System.Reflection
1313
do ()
1414

1515
module internal AssemblyVersionInformation =
16-
let [<Literal>] AssemblyTitle = "MyLib"
17-
let [<Literal>] AssemblyProduct = "MyLib"
16+
let [<Literal>] AssemblyTitle = "MyLib.1"
17+
let [<Literal>] AssemblyProduct = "MyLib.1"
1818
let [<Literal>] AssemblyVersion = "0.1.0"
1919
let [<Literal>] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000"
2020
let [<Literal>] AssemblyFileVersion = "0.1.0"

Content/src/MyLib/Library.fs Content/src/MyLib.1/Library.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace MyLib
1+
namespace MyLib._1
22

33
module Say =
44
let nothing name =

Content/src/MyLib/MyLib.fsproj Content/src/MyLib.1/MyLib.1.fsproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
66
</PropertyGroup>
77
<PropertyGroup>
8-
<Title>MyLib</Title>
9-
<Description>MyLib does the thing!</Description>
8+
<Title>MyLib.1</Title>
9+
<Description>MyLib.1 does the thing!</Description>
1010
<!-- summary is not migrated from project.json, but you can use the <Description> property for that if needed. -->
1111
<PackageTags>f#, fsharp</PackageTags>
12-
<PackageProjectUrl>https://github.com/MyGithubUsername/MyLib</PackageProjectUrl>
12+
<PackageProjectUrl>https://github.com/MyGithubUsername/MyLib.1</PackageProjectUrl>
1313
<PackageLicenseUrl>https://github.com/MyGithubUsername/MyLib/blob/master/LICENSE.md</PackageLicenseUrl>
1414
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1515
<RepositoryType>git</RepositoryType>
1616
<Authors>MyUsername</Authors>
17-
<RepositoryUrl>https://github.com/MyGithubUsername/MyLib</RepositoryUrl>
17+
<RepositoryUrl>https://github.com/MyGithubUsername/MyLib.1</RepositoryUrl>
1818
<!-- owners is not supported in MSBuild -->
1919
</PropertyGroup>
2020
<PropertyGroup Condition="'$(Configuration)'=='Release'">
File renamed without changes.

Content/tests/MyLib.Tests/AssemblyInfo.fs Content/tests/MyLib.1.Tests/AssemblyInfo.fs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
namespace System
33
open System.Reflection
44

5-
[<assembly: AssemblyTitleAttribute("MyLib.Tests")>]
6-
[<assembly: AssemblyProductAttribute("MyLib")>]
5+
[<assembly: AssemblyTitleAttribute("MyLib.1.Tests")>]
6+
[<assembly: AssemblyProductAttribute("MyLib.1")>]
77
[<assembly: AssemblyVersionAttribute("0.1.0")>]
88
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2017-03-17T00:00:00.0000000")>]
99
[<assembly: AssemblyFileVersionAttribute("0.1.0")>]
@@ -13,8 +13,8 @@ open System.Reflection
1313
do ()
1414

1515
module internal AssemblyVersionInformation =
16-
let [<Literal>] AssemblyTitle = "MyLib.Tests"
17-
let [<Literal>] AssemblyProduct = "MyLib"
16+
let [<Literal>] AssemblyTitle = "MyLib.1.Tests"
17+
let [<Literal>] AssemblyProduct = "MyLib.1"
1818
let [<Literal>] AssemblyVersion = "0.1.0"
1919
let [<Literal>] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000"
2020
let [<Literal>] AssemblyFileVersion = "0.1.0"
File renamed without changes.

Content/tests/MyLib.Tests/MyLib.Tests.fsproj Content/tests/MyLib.1.Tests/MyLib.1.Tests.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Compile Include="Main.fs" />
1111
</ItemGroup>
1212
<ItemGroup>
13-
<ProjectReference Include="../../src/MyLib/MyLib.fsproj" />
13+
<ProjectReference Include="../../src/MyLib.1/MyLib.1.fsproj" />
1414
</ItemGroup>
1515
<Import Project="..\..\.paket\Paket.Restore.targets" />
1616
</Project>

Content/tests/MyLib.Tests/Tests.fs Content/tests/MyLib.1.Tests/Tests.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Tests
22

33

44
open Expecto
5-
open MyLib
5+
open MyLib._1
66

77
[<Tests>]
88
let tests =

build.fsx

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Target "IntegrationTests" (fun _ ->
8888

8989
[
9090
"-n MyCoolLib --githubUsername CoolPersonNo2", "DotnetPack"
91+
// test for dashes in name https://github.com/dotnet/templating/issues/1168#issuecomment-364592031
92+
"-n fsharp-data-sample --githubUsername CoolPersonNo2", "DotnetPack"
9193
]
9294
|> Seq.iter(fun (param, testTarget) ->
9395
use directory = DisposableDirectory.Create()

0 commit comments

Comments
 (0)