Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SwiftMetaModelGenerator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ullerich
SwiftMetaModelGenerator
Commits
6ef44ba7
Commit
6ef44ba7
authored
3 years ago
by
Tobias Ullerich
Browse files
Options
Downloads
Patches
Plain Diff
Add template root path parameter
parent
e256b53a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SwiftMetaModelGenerator.xcodeproj/xcshareddata/xcschemes/SwiftMetaModelGenerator.xcscheme
+8
-0
8 additions, 0 deletions
...j/xcshareddata/xcschemes/SwiftMetaModelGenerator.xcscheme
SwiftMetaModelGenerator/main.swift
+4
-1
4 additions, 1 deletion
SwiftMetaModelGenerator/main.swift
with
12 additions
and
1 deletion
SwiftMetaModelGenerator.xcodeproj/xcshareddata/xcschemes/SwiftMetaModelGenerator.xcscheme
+
8
−
0
View file @
6ef44ba7
...
...
@@ -67,6 +67,14 @@
argument =
"/Users/tobias/Documents/Programmieren/Projects/WolfManagement/WolfManagementMobile/WolfManagementMobile/Generated/Metamodel.swift"
isEnabled =
"YES"
>
</CommandLineArgument>
<CommandLineArgument
argument =
"--template-root"
isEnabled =
"YES"
>
</CommandLineArgument>
<CommandLineArgument
argument =
"/Users/tobias/Documents/Programmieren/Projects/SwiftMetaModelGenerator/SwiftMetaModelGenerator/templates"
isEnabled =
"YES"
>
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
...
...
This diff is collapsed.
Click to expand it.
SwiftMetaModelGenerator/main.swift
+
4
−
1
View file @
6ef44ba7
...
...
@@ -19,6 +19,9 @@ struct SwiftMetaModelGenerator: ParsableCommand
@Option
(
name
:
.
shortAndLong
,
help
:
"Output file"
)
var
output
:
String
@Option
(
name
:
.
shortAndLong
,
help
:
"Root folder of templates file"
)
var
templateRoot
:
String
mutating
func
run
()
throws
{
let
inputPath
=
Path
(
input
)
let
classes
:
[
ClassDeclaration
]
...
...
@@ -32,7 +35,7 @@ struct SwiftMetaModelGenerator: ParsableCommand
"classes"
:
classes
]
let
environment
=
Environment
(
loader
:
FileSystemLoader
(
paths
:
[
"/Users/tobias/Documents/Programmieren/Projects/SwiftMetaModelGenerator/SwiftMetaModelGenerator/templates/"
]))
let
environment
=
Environment
(
loader
:
FileSystemLoader
(
paths
:
[
Path
(
templateRoot
)
]))
let
rendered
=
try
environment
.
renderTemplate
(
name
:
"meta_model.stencil"
,
context
:
context
)
try
Path
(
output
)
.
write
(
rendered
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment