Add new Flag to every command to choose if we want to generate static members or not
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -44,6 +44,7 @@ struct Generate: ParsableCommand {
|
||||
configuration.runnableConfigurations
|
||||
.forEach {
|
||||
$0.run(force: options.forceGeneration)
|
||||
print("\n")
|
||||
}
|
||||
|
||||
print("[\(Self.toolName)] Resgen ended")
|
||||
|
@@ -46,6 +46,14 @@ struct ColorsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
|
||||
var staticMembersOptions: Bool {
|
||||
if let staticMembers = staticMembers {
|
||||
return staticMembers
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
@@ -65,6 +73,14 @@ struct FontsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
|
||||
var staticMembersOptions: Bool {
|
||||
if let staticMembers = staticMembers {
|
||||
return staticMembers
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
@@ -83,6 +99,14 @@ struct ImagesConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
|
||||
var staticMembersOptions: Bool {
|
||||
if let staticMembers = staticMembers {
|
||||
return staticMembers
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
@@ -104,6 +128,14 @@ struct StringsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
|
||||
var staticMembersOptions: Bool {
|
||||
if let staticMembers = staticMembers {
|
||||
return staticMembers
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
@@ -125,6 +157,14 @@ struct TagsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
|
||||
var staticMembersOptions: Bool {
|
||||
if let staticMembers = staticMembers {
|
||||
return staticMembers
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
|
@@ -22,7 +22,9 @@ extension ColorsConfiguration: Runnable {
|
||||
"--xcassets-path",
|
||||
xcassetsPath,
|
||||
"--extension-output-path",
|
||||
extensionOutputPath
|
||||
extensionOutputPath,
|
||||
"--static-members",
|
||||
"\(staticMembersOptions)"
|
||||
]
|
||||
|
||||
if let extensionName = extensionName {
|
@@ -18,7 +18,9 @@ extension FontsConfiguration: Runnable {
|
||||
args += [
|
||||
inputFile,
|
||||
"--extension-output-path",
|
||||
extensionOutputPath
|
||||
extensionOutputPath,
|
||||
"--static-members",
|
||||
"\(staticMembersOptions)"
|
||||
]
|
||||
|
||||
if let extensionName = extensionName {
|
@@ -12,7 +12,7 @@ extension ImagesConfiguration: Runnable {
|
||||
var args = [String]()
|
||||
|
||||
if force {
|
||||
args += ["-f"]
|
||||
args += ["-F"] // Images has a -f and -F options
|
||||
}
|
||||
|
||||
args += [
|
||||
@@ -20,7 +20,9 @@ extension ImagesConfiguration: Runnable {
|
||||
"--xcassets-path",
|
||||
xcassetsPath,
|
||||
"--extension-output-path",
|
||||
extensionOutputPath
|
||||
extensionOutputPath,
|
||||
"--static-members",
|
||||
"\(staticMembersOptions)"
|
||||
]
|
||||
|
||||
if let extensionName = extensionName {
|
@@ -24,7 +24,9 @@ extension StringsConfiguration: Runnable {
|
||||
"--default-lang",
|
||||
defaultLang,
|
||||
"--extension-output-path",
|
||||
extensionOutputPath
|
||||
extensionOutputPath,
|
||||
"--static-members",
|
||||
"\(staticMembersOptions)"
|
||||
]
|
||||
|
||||
if let extensionName = extensionName {
|
@@ -20,7 +20,9 @@ extension TagsConfiguration: Runnable {
|
||||
"--lang",
|
||||
lang,
|
||||
"--extension-output-path",
|
||||
extensionOutputPath
|
||||
extensionOutputPath,
|
||||
"--static-members",
|
||||
"\(staticMembersOptions)"
|
||||
]
|
||||
|
||||
if let extensionName = extensionName {
|
Reference in New Issue
Block a user