Optional generation of Colors/Fonts/Images/Stringium extension Fix swiftlint warning
50 lines
1.2 KiB
Swift
50 lines
1.2 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,
|
|
"--static-members",
|
|
"\(staticMembersOptions)",
|
|
"--xc-strings",
|
|
"\(xcStringsOptions)"
|
|
]
|
|
|
|
// Add optional parameters
|
|
[
|
|
("--extension-output-path", extensionOutputPath?.prependIfRelativePath(projectDirectory)),
|
|
("--extension-name", extensionName),
|
|
("--extension-suffix", extensionSuffix)
|
|
].forEach { argumentName, argumentValue in
|
|
if let argumentValue {
|
|
args += [
|
|
argumentName,
|
|
argumentValue
|
|
]
|
|
}
|
|
}
|
|
|
|
Stringium.main(args)
|
|
}
|
|
}
|