Optional generation of Strings extension (stringium command)
This commit is contained in:
@@ -280,7 +280,7 @@ struct StringsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let outputPath: String
|
||||
let langs: String
|
||||
let defaultLang: String
|
||||
let extensionOutputPath: String
|
||||
let extensionOutputPath: String?
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
@@ -305,7 +305,7 @@ struct StringsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
outputPath: String,
|
||||
langs: String,
|
||||
defaultLang: String,
|
||||
extensionOutputPath: String,
|
||||
extensionOutputPath: String?,
|
||||
extensionName: String?,
|
||||
extensionSuffix: String?,
|
||||
staticMembers: Bool?,
|
||||
@@ -329,7 +329,7 @@ struct StringsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
- Output path: \(outputPath)
|
||||
- Langs: \(langs)
|
||||
- Default lang: \(defaultLang)
|
||||
- Extension output path: \(extensionOutputPath)
|
||||
- Extension output path: \(extensionOutputPath ?? "-")
|
||||
- Extension name: \(extensionName ?? "-")
|
||||
- Extension suffix: \(extensionSuffix ?? "-")
|
||||
"""
|
||||
|
@@ -24,26 +24,24 @@ extension StringsConfiguration: Runnable {
|
||||
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
|
||||
]
|
||||
// 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)
|
||||
|
Reference in New Issue
Block a user