Merge pull request #1149 from tuist/scaffold_example_template
Generate example template.
This commit is contained in:
commit
a92bff3d97
|
@ -4,6 +4,10 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
|
||||||
|
|
||||||
## Next
|
## Next
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix example framework template not being generated https://github.com/tuist/tuist/pull/1149 by @fortmarek
|
||||||
|
|
||||||
## 1.5.0
|
## 1.5.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -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: []),
|
||||||
|
])
|
|
@ -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"),
|
||||||
|
]
|
||||||
|
)
|
|
@ -106,5 +106,9 @@ let template = Template(
|
||||||
contents: configContent),
|
contents: configContent),
|
||||||
.file(path: ".gitignore",
|
.file(path: ".gitignore",
|
||||||
templatePath: "Gitignore.stencil"),
|
templatePath: "Gitignore.stencil"),
|
||||||
|
.file(path: "Tuist/Templates/framework/Template.swift",
|
||||||
|
templatePath: "ExampleTemplate.stencil"),
|
||||||
|
.file(path: "Tuist/Templates/framework/project.stencil",
|
||||||
|
templatePath: "ExampleProject.stencil")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue