Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
52 lines
1.1 KiB
Swift
52 lines
1.1 KiB
Swift
//
|
|
// StringsConfiguration+Runnable.swift
|
|
//
|
|
//
|
|
// Created by Thibaut Schmitt on 30/08/2022.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension StringsConfiguration: Runnable {
|
|
|
|
func run(projectDirectory: String, force: Bool) {
|
|
var args = [String]()
|
|
|
|
if force {
|
|
args += ["-f"]
|
|
}
|
|
|
|
args += [
|
|
inputFile.prependIfRelativePath(projectDirectory),
|
|
"--output-path",
|
|
outputPath.prependIfRelativePath(projectDirectory),
|
|
"--langs",
|
|
langs,
|
|
"--default-lang",
|
|
defaultLang,
|
|
"--extension-output-path",
|
|
extensionOutputPath.prependIfRelativePath(projectDirectory),
|
|
"--static-members",
|
|
"\(staticMembersOptions)",
|
|
"--xc-strings",
|
|
"\(xcStringsOptions)"
|
|
]
|
|
|
|
if let extensionName {
|
|
args += [
|
|
"--extension-name",
|
|
extensionName
|
|
]
|
|
}
|
|
|
|
if let extensionSuffix {
|
|
args += [
|
|
"--extension-suffix",
|
|
extensionSuffix
|
|
]
|
|
}
|
|
|
|
Stringium.main(args)
|
|
}
|
|
}
|