Skip to content

Commit

Permalink
Closes #81
Browse files Browse the repository at this point in the history
This implements the templating hacks in dotnet/templating#1168 (comment) to allow for dashes in names.
  • Loading branch information
Jimmy Byrd committed May 15, 2018
1 parent c80966d commit f985d3a
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Content/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
58 changes: 30 additions & 28 deletions Content/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -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
}]
}
4 changes: 2 additions & 2 deletions Content/MyLib.sln → Content/MyLib.1.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Content/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
namespace System
open System.Reflection

[<assembly: AssemblyTitleAttribute("MyLib")>]
[<assembly: AssemblyProductAttribute("MyLib")>]
[<assembly: AssemblyTitleAttribute("MyLib.1")>]
[<assembly: AssemblyProductAttribute("MyLib.1")>]
[<assembly: AssemblyVersionAttribute("0.1.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","2017-03-17T00:00:00.0000000")>]
[<assembly: AssemblyFileVersionAttribute("0.1.0")>]
Expand All @@ -13,8 +13,8 @@ open System.Reflection
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "MyLib"
let [<Literal>] AssemblyProduct = "MyLib"
let [<Literal>] AssemblyTitle = "MyLib.1"
let [<Literal>] AssemblyProduct = "MyLib.1"
let [<Literal>] AssemblyVersion = "0.1.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "0.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MyLib
namespace MyLib._1

module Say =
let nothing name =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<Title>MyLib</Title>
<Description>MyLib does the thing!</Description>
<Title>MyLib.1</Title>
<Description>MyLib.1 does the thing!</Description>
<!-- summary is not migrated from project.json, but you can use the <Description> property for that if needed. -->
<PackageTags>f#, fsharp</PackageTags>
<PackageProjectUrl>https://github.com/MyGithubUsername/MyLib</PackageProjectUrl>
<PackageProjectUrl>https://github.com/MyGithubUsername/MyLib.1</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/MyGithubUsername/MyLib/blob/master/LICENSE.md</PackageLicenseUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<Authors>MyUsername</Authors>
<RepositoryUrl>https://github.com/MyGithubUsername/MyLib</RepositoryUrl>
<RepositoryUrl>https://github.com/MyGithubUsername/MyLib.1</RepositoryUrl>
<!-- owners is not supported in MSBuild -->
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
namespace System
open System.Reflection

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

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "MyLib.Tests"
let [<Literal>] AssemblyProduct = "MyLib"
let [<Literal>] AssemblyTitle = "MyLib.1.Tests"
let [<Literal>] AssemblyProduct = "MyLib.1"
let [<Literal>] AssemblyVersion = "0.1.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "2017-03-17T00:00:00.0000000"
let [<Literal>] AssemblyFileVersion = "0.1.0"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Compile Include="Main.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../src/MyLib/MyLib.fsproj" />
<ProjectReference Include="../../src/MyLib.1/MyLib.1.fsproj" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Tests


open Expecto
open MyLib
open MyLib._1

[<Tests>]
let tests =
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f985d3a

Please sign in to comment.