From f985d3a3023a16c58d46c38380b343f62d599fc8 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Mon, 14 May 2018 21:19:50 -0400 Subject: [PATCH] Closes #81 This implements the templating hacks in https://github.com/dotnet/templating/issues/1168#issuecomment-364592031 to allow for dashes in names. --- Content/.github/PULL_REQUEST_TEMPLATE.md | 2 +- Content/.template.config/template.json | 58 ++++++++++--------- Content/{MyLib.sln => MyLib.1.sln} | 4 +- Content/build.fsx | 6 +- .../src/{MyLib => MyLib.1}/AssemblyInfo.fs | 8 +-- Content/src/{MyLib => MyLib.1}/Library.fs | 2 +- .../MyLib.fsproj => MyLib.1/MyLib.1.fsproj} | 8 +-- .../src/{MyLib => MyLib.1}/paket.references | 0 .../AssemblyInfo.fs | 8 +-- .../{MyLib.Tests => MyLib.1.Tests}/Main.fs | 0 .../MyLib.1.Tests.fsproj} | 2 +- .../{MyLib.Tests => MyLib.1.Tests}/Tests.fs | 2 +- .../paket.references | 0 build.fsx | 2 + 14 files changed, 53 insertions(+), 49 deletions(-) rename Content/{MyLib.sln => MyLib.1.sln} (91%) rename Content/src/{MyLib => MyLib.1}/AssemblyInfo.fs (82%) rename Content/src/{MyLib => MyLib.1}/Library.fs (85%) rename Content/src/{MyLib/MyLib.fsproj => MyLib.1/MyLib.1.fsproj} (86%) rename Content/src/{MyLib => MyLib.1}/paket.references (100%) rename Content/tests/{MyLib.Tests => MyLib.1.Tests}/AssemblyInfo.fs (82%) rename Content/tests/{MyLib.Tests => MyLib.1.Tests}/Main.fs (100%) rename Content/tests/{MyLib.Tests/MyLib.Tests.fsproj => MyLib.1.Tests/MyLib.1.Tests.fsproj} (86%) rename Content/tests/{MyLib.Tests => MyLib.1.Tests}/Tests.fs (96%) rename Content/tests/{MyLib.Tests => MyLib.1.Tests}/paket.references (100%) diff --git a/Content/.github/PULL_REQUEST_TEMPLATE.md b/Content/.github/PULL_REQUEST_TEMPLATE.md index a856e1d1..3a188d30 100644 --- a/Content/.github/PULL_REQUEST_TEMPLATE.md +++ b/Content/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,7 @@ Describe the big picture of your changes here to communicate to the maintainers ## Types of changes -What types of changes does your code introduce to MyLib? +What types of changes does your code introduce to MyLib.1? _Put an `x` in the boxes that apply_ - [ ] Bugfix (non-breaking change which fixes an issue) diff --git a/Content/.template.config/template.json b/Content/.template.config/template.json index 7b3e01d3..8bd252fc 100644 --- a/Content/.template.config/template.json +++ b/Content/.template.config/template.json @@ -1,29 +1,31 @@ { - "author": "Jimmy Byrd", - "classifications": [ "Scaffold" ], - "name": "MiniScaffold", - "tags": { - "language": "F#" - }, - "identity": "MiniScaffold", - "shortName": "mini-scaffold", - "sourceName": "MyLib", - // This allows using the `-n` option to create a new directory - "preferNameDirectory": true, - "symbols":{ - "githubUsername": { - "type": "parameter", - "replaces":"MyGithubUsername" - } - }, - "postActions": [{ - "condition": "(OS != \"Windows_NT\")", - "description": "Make scripts executable", - "manualInstructions": [ { "text": "Run 'chmod +x *.sh'" } ], - "actionId": "cb9a6cf3-4f5c-4860-b9d2-03a574959774", - "args": { - "+x": "*.sh" - }, - "continueOnError": true - }] -} + "author": "Jimmy Byrd", + "classifications": ["Scaffold"], + "name": "MiniScaffold", + "tags": { + "language": "F#" + }, + "identity": "MiniScaffold", + "shortName": "mini-scaffold", + "sourceName": "MyLib.1", + // This allows using the `-n` option to create a new directory + "preferNameDirectory": true, + "symbols": { + "githubUsername": { + "type": "parameter", + "replaces": "MyGithubUsername" + } + }, + "postActions": [{ + "condition": "(OS != \"Windows_NT\")", + "description": "Make scripts executable", + "manualInstructions": [{ + "text": "Run 'chmod +x *.sh'" + }], + "actionId": "cb9a6cf3-4f5c-4860-b9d2-03a574959774", + "args": { + "+x": "*.sh" + }, + "continueOnError": true + }] +} \ No newline at end of file diff --git a/Content/MyLib.sln b/Content/MyLib.1.sln similarity index 91% rename from Content/MyLib.sln rename to Content/MyLib.1.sln index e5ed9bb0..c94c2e79 100644 --- a/Content/MyLib.sln +++ b/Content/MyLib.1.sln @@ -5,11 +5,11 @@ VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C397A34C-84F1-49E7-AEBC-2F9F2B196216}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib", "src\MyLib\MyLib.fsproj", "{5D30E174-2538-47AC-8443-318C8C5DC2C9}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.1", "src\MyLib.1\MyLib.1.fsproj", "{5D30E174-2538-47AC-8443-318C8C5DC2C9}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ACBEE43C-7A88-4FB1-9B06-DB064D22B29F}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.Tests", "tests\MyLib.Tests\MyLib.Tests.fsproj", "{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MyLib.1.Tests", "tests\MyLib.1.Tests\MyLib.1.Tests.fsproj", "{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Content/build.fsx b/Content/build.fsx index 22103a7e..cc71aefc 100644 --- a/Content/build.fsx +++ b/Content/build.fsx @@ -7,8 +7,8 @@ open Fake.UserInputHelper open System let release = LoadReleaseNotes "RELEASE_NOTES.md" -let productName = "MyLib" -let sln = "MyLib.sln" +let productName = "MyLib.1" +let sln = "MyLib.1.sln" let srcGlob =__SOURCE_DIRECTORY__ @@ "src/**/*.??proj" let testsGlob = __SOURCE_DIRECTORY__ @@ "tests/**/*.??proj" let distDir = __SOURCE_DIRECTORY__ @@ "dist" @@ -18,7 +18,7 @@ let toolsDir = __SOURCE_DIRECTORY__ @@ "tools" let coverageReportDir = __SOURCE_DIRECTORY__ @@ "docs" @@ "coverage" let gitOwner = "MyGithubUsername" -let gitRepoName = "MyLib" +let gitRepoName = "MyLib.1" let configuration = EnvironmentHelper.environVarOrDefault "CONFIGURATION" "Release" diff --git a/Content/src/MyLib/AssemblyInfo.fs b/Content/src/MyLib.1/AssemblyInfo.fs similarity index 82% rename from Content/src/MyLib/AssemblyInfo.fs rename to Content/src/MyLib.1/AssemblyInfo.fs index 87e608aa..6f273302 100644 --- a/Content/src/MyLib/AssemblyInfo.fs +++ b/Content/src/MyLib.1/AssemblyInfo.fs @@ -2,8 +2,8 @@ namespace System open System.Reflection -[] -[] +[] +[] [] [] [] @@ -13,8 +13,8 @@ open System.Reflection do () module internal AssemblyVersionInformation = - let [] AssemblyTitle = "MyLib" - let [] AssemblyProduct = "MyLib" + let [] AssemblyTitle = "MyLib.1" + let [] AssemblyProduct = "MyLib.1" let [] AssemblyVersion = "0.1.0" let [] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000" let [] AssemblyFileVersion = "0.1.0" diff --git a/Content/src/MyLib/Library.fs b/Content/src/MyLib.1/Library.fs similarity index 85% rename from Content/src/MyLib/Library.fs rename to Content/src/MyLib.1/Library.fs index 96a28af2..a42c9f1e 100755 --- a/Content/src/MyLib/Library.fs +++ b/Content/src/MyLib.1/Library.fs @@ -1,4 +1,4 @@ -namespace MyLib +namespace MyLib._1 module Say = let nothing name = diff --git a/Content/src/MyLib/MyLib.fsproj b/Content/src/MyLib.1/MyLib.1.fsproj similarity index 86% rename from Content/src/MyLib/MyLib.fsproj rename to Content/src/MyLib.1/MyLib.1.fsproj index 431502fb..aa8c1f74 100755 --- a/Content/src/MyLib/MyLib.fsproj +++ b/Content/src/MyLib.1/MyLib.1.fsproj @@ -5,16 +5,16 @@ true - MyLib - MyLib does the thing! + MyLib.1 + MyLib.1 does the thing! f#, fsharp - https://github.com/MyGithubUsername/MyLib + https://github.com/MyGithubUsername/MyLib.1 https://github.com/MyGithubUsername/MyLib/blob/master/LICENSE.md false git MyUsername - https://github.com/MyGithubUsername/MyLib + https://github.com/MyGithubUsername/MyLib.1 diff --git a/Content/src/MyLib/paket.references b/Content/src/MyLib.1/paket.references similarity index 100% rename from Content/src/MyLib/paket.references rename to Content/src/MyLib.1/paket.references diff --git a/Content/tests/MyLib.Tests/AssemblyInfo.fs b/Content/tests/MyLib.1.Tests/AssemblyInfo.fs similarity index 82% rename from Content/tests/MyLib.Tests/AssemblyInfo.fs rename to Content/tests/MyLib.1.Tests/AssemblyInfo.fs index c66d143a..2a82b88f 100644 --- a/Content/tests/MyLib.Tests/AssemblyInfo.fs +++ b/Content/tests/MyLib.1.Tests/AssemblyInfo.fs @@ -2,8 +2,8 @@ namespace System open System.Reflection -[] -[] +[] +[] [] [] [] @@ -13,8 +13,8 @@ open System.Reflection do () module internal AssemblyVersionInformation = - let [] AssemblyTitle = "MyLib.Tests" - let [] AssemblyProduct = "MyLib" + let [] AssemblyTitle = "MyLib.1.Tests" + let [] AssemblyProduct = "MyLib.1" let [] AssemblyVersion = "0.1.0" let [] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000" let [] AssemblyFileVersion = "0.1.0" diff --git a/Content/tests/MyLib.Tests/Main.fs b/Content/tests/MyLib.1.Tests/Main.fs similarity index 100% rename from Content/tests/MyLib.Tests/Main.fs rename to Content/tests/MyLib.1.Tests/Main.fs diff --git a/Content/tests/MyLib.Tests/MyLib.Tests.fsproj b/Content/tests/MyLib.1.Tests/MyLib.1.Tests.fsproj similarity index 86% rename from Content/tests/MyLib.Tests/MyLib.Tests.fsproj rename to Content/tests/MyLib.1.Tests/MyLib.1.Tests.fsproj index 41f6efc6..ec142fa2 100755 --- a/Content/tests/MyLib.Tests/MyLib.Tests.fsproj +++ b/Content/tests/MyLib.1.Tests/MyLib.1.Tests.fsproj @@ -10,7 +10,7 @@ - + diff --git a/Content/tests/MyLib.Tests/Tests.fs b/Content/tests/MyLib.1.Tests/Tests.fs similarity index 96% rename from Content/tests/MyLib.Tests/Tests.fs rename to Content/tests/MyLib.1.Tests/Tests.fs index 616b8641..7a36e81c 100755 --- a/Content/tests/MyLib.Tests/Tests.fs +++ b/Content/tests/MyLib.1.Tests/Tests.fs @@ -2,7 +2,7 @@ module Tests open Expecto -open MyLib +open MyLib._1 [] let tests = diff --git a/Content/tests/MyLib.Tests/paket.references b/Content/tests/MyLib.1.Tests/paket.references similarity index 100% rename from Content/tests/MyLib.Tests/paket.references rename to Content/tests/MyLib.1.Tests/paket.references diff --git a/build.fsx b/build.fsx index 1de48459..7d236764 100644 --- a/build.fsx +++ b/build.fsx @@ -88,6 +88,8 @@ Target "IntegrationTests" (fun _ -> [ "-n MyCoolLib --githubUsername CoolPersonNo2", "DotnetPack" + // test for dashes in name https://github.com/dotnet/templating/issues/1168#issuecomment-364592031 + "-n fsharp-data-sample --githubUsername CoolPersonNo2", "DotnetPack" ] |> Seq.iter(fun (param, testTarget) -> use directory = DisposableDirectory.Create()