Merge pull request #1149 from tuist/scaffold_example_template

Generate example template.
This commit is contained in:
Marek Fořt 2020-03-26 07:29:29 +01:00 committed by GitHub
commit a92bff3d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 0 deletions

View File

@ -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

View File

@ -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: []),
])

View File

@ -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"),
]
)

View File

@ -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")
]
)