✅ Add custom template for testing stencil filters
This commit is contained in:
parent
d45a8ed757
commit
b75ba22c60
|
@ -18,4 +18,11 @@ Feature: Scaffold a project using Tuist
|
|||
"""
|
||||
// Generated file with platform: ios and name: TemplateProject
|
||||
|
||||
"""
|
||||
Then tuist scaffolds a custom_using_filters template to TemplateProject named TemplateProject
|
||||
Then content of a file named TemplateProject/custom.swift in a directory TemplateProject should be equal to // this is test TemplateProject content
|
||||
Then content of a file named TemplateProject/generated.swift in a directory TemplateProject should be equal to:
|
||||
"""
|
||||
// Generated file with platform: iOS and snake case name: template_project
|
||||
|
||||
"""
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
import ProjectDescription
|
||||
|
||||
let nameAttributeThree: Template.Attribute = .required("name")
|
||||
let platformAttributeThree: Template.Attribute = .optional("platform", default: "IOS")
|
||||
|
||||
let testContentsThree = """
|
||||
// this is test \(nameAttributeThree) content
|
||||
"""
|
||||
|
||||
let templateThree = Template(
|
||||
description: "Custom template",
|
||||
attributes: [
|
||||
nameAttributeThree,
|
||||
platformAttributeThree
|
||||
],
|
||||
files: [
|
||||
.string(path: "\(nameAttributeThree)/custom.swift", contents: testContentsThree),
|
||||
.file(path: "\(nameAttributeThree)/generated.swift", templatePath: "filters.stencil"),
|
||||
]
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
// Generated file with platform: {{ platform|lowerFirstLetter }} and snake case name: {{ name|camelToSnakeCase }}
|
Loading…
Reference in New Issue