diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d8b32891..0ae703946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/ ## Next +### Fixed + +- Fix example framework template not being generated https://github.com/tuist/tuist/pull/1149 by @fortmarek + ## 1.5.0 ### Added diff --git a/Templates/default/ExampleProject.stencil b/Templates/default/ExampleProject.stencil new file mode 100644 index 000000000..94ab0b8da --- /dev/null +++ b/Templates/default/ExampleProject.stencil @@ -0,0 +1,12 @@ +import ProjectDescription +let project = Project(name: "{{ name }}", + targets: [ + Target(name: "{{ name }}", + platform: .{{ platform }}, + product: .framework, + productName: "{{ name }}", + bundleId: "io.tuist.{{ name }}", + infoPlist: .default, + sources: "Sources/**", + dependencies: []), +]) diff --git a/Templates/default/ExampleTemplate.stencil b/Templates/default/ExampleTemplate.stencil new file mode 100644 index 000000000..375990cfa --- /dev/null +++ b/Templates/default/ExampleTemplate.stencil @@ -0,0 +1,15 @@ +import ProjectDescription +let nameAttribute: Template.Attribute = .required("name") +let exampleContents = """ +struct \(nameAttribute) { } +""" +let template = Template( + description: "Framework template", + attributes: [ + nameAttribute, + ], + files: [ + .string(path: "\(nameAttribute)/Sources/\(nameAttribute).swift", contents: exampleContents), + .file(path: "\(nameAttribute)/Project.swift", templatePath: "project.stencil"), + ] +) diff --git a/Templates/default/Template.swift b/Templates/default/Template.swift index be176013f..c1c8938f0 100644 --- a/Templates/default/Template.swift +++ b/Templates/default/Template.swift @@ -106,5 +106,9 @@ let template = Template( contents: configContent), .file(path: ".gitignore", templatePath: "Gitignore.stencil"), + .file(path: "Tuist/Templates/framework/Template.swift", + templatePath: "ExampleTemplate.stencil"), + .file(path: "Tuist/Templates/framework/project.stencil", + templatePath: "ExampleProject.stencil") ] )