Skip to content

Commit

Permalink
Add Template
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoonahn committed Dec 10, 2023
1 parent d7746b3 commit bf66d6c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Templates/project/Project.stencil
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import ProjectDescription
import TuistUI

let project = {{ name }}().makeModule()

struct {{ name }}: Module {

var body: some Module {
Project {

}
}
}
18 changes: 18 additions & 0 deletions Templates/project/project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ProjectDescription

private let pathAttribute = Template.Attribute.optional("path", default: "Projects")
private let nameAttribute = Template.Attribute.required("name")

private let template = Template(
description: "Project module template",
attributes: [
pathAttribute,
nameAttribute
],
items: [
.file(
path: "\(pathAttribute)/\(nameAttribute)/Project.swift",
templatePath: "Project.stencil"
)
]
)
14 changes: 14 additions & 0 deletions Templates/workspace/Workspace.stencil
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ProjectDescription
import TuistUI

let project = {{ name }}().makeModule()

struct {{ name }}: Module {

var body: some Module {
Workspace {

}
}
}

18 changes: 18 additions & 0 deletions Templates/workspace/workspace.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ProjectDescription

private let pathAttribute = Template.Attribute.optional("path", default: "Projects")
private let nameAttribute = Template.Attribute.required("name")

private let template = Template(
description: "Workspace module template",
attributes: [
pathAttribute,
nameAttribute
],
items: [
.file(
path: "\(pathAttribute)/\(nameAttribute)/Workspace.swift",
templatePath: "Workspace.stencil"
)
]
)

0 comments on commit bf66d6c

Please sign in to comment.