Renaming errors property: localizedDescription -> description
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
Re enabling generation of ressources on commond Architecture will now generate property of subobject as non-static. It will allow usage like R.sub_object.sub_property.property
This commit is contained in:
parent
fc427733ee
commit
9ab7e74991
@ -14,7 +14,7 @@ enum FontsToolError: Error {
|
||||
case fileNotExists(String)
|
||||
case writeExtension(String, String)
|
||||
|
||||
var localizedDescription: String {
|
||||
var description: String {
|
||||
switch self {
|
||||
case .extensionNamesCollision(let extensionName):
|
||||
return "error: [\(Fonts.toolName)] Error on extension names, extension name and SwiftUI extension name should be different (\(extensionName) is used on both)"
|
||||
|
@ -45,14 +45,14 @@ struct Generate: ParsableCommand {
|
||||
ArchitectureGenerator.writeArchitecture(architecture)
|
||||
}
|
||||
|
||||
// // Execute commands
|
||||
// configuration.runnableConfigurations
|
||||
// .forEach {
|
||||
// let begin = Date()
|
||||
// $0.run(projectDirectory: options.projectDirectory,
|
||||
// force: options.forceGeneration)
|
||||
// print("Took: \(Date().timeIntervalSince(begin))s\n")
|
||||
// }
|
||||
// Execute commands
|
||||
configuration.runnableConfigurations
|
||||
.forEach {
|
||||
let begin = Date()
|
||||
$0.run(projectDirectory: options.projectDirectory,
|
||||
force: options.forceGeneration)
|
||||
print("Took: \(Date().timeIntervalSince(begin))s\n")
|
||||
}
|
||||
|
||||
print("[\(Self.toolName)] Resgen ended")
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ enum GenerateError: Error {
|
||||
case commandError([String], String)
|
||||
case writeFile(String, String)
|
||||
|
||||
var localizedDescription: String {
|
||||
var description: String {
|
||||
switch self {
|
||||
case .fileNotExists(let filename):
|
||||
return "error: [\(Generate.toolName)] File \(filename) does not exists"
|
||||
|
@ -45,18 +45,18 @@ struct ConfigurationArchitecture: Codable {
|
||||
let path: String?
|
||||
let children: [ConfigurationArchitecture]?
|
||||
|
||||
func getProperty() -> String {
|
||||
" static let \(property) = \(classname)()"
|
||||
func getProperty(isStatic: Bool) -> String {
|
||||
" \(isStatic ? "static " : "")let \(property) = \(classname)()"
|
||||
}
|
||||
|
||||
func getClass() -> String {
|
||||
func getClass(generateStaticProperty: Bool = true) -> String {
|
||||
guard children?.isEmpty == false else {
|
||||
return "class \(classname) {}"
|
||||
}
|
||||
|
||||
let classDefinition = [
|
||||
"class \(classname) {",
|
||||
children?.map { $0.getProperty() }.joined(separator: "\n"),
|
||||
children?.map { $0.getProperty(isStatic: generateStaticProperty) }.joined(separator: "\n"),
|
||||
"}"
|
||||
]
|
||||
.compactMap { $0 }
|
||||
@ -70,7 +70,7 @@ struct ConfigurationArchitecture: Codable {
|
||||
func getSubclass() -> String? {
|
||||
guard let children else { return nil }
|
||||
return children.compactMap { arch in
|
||||
arch.getClass()
|
||||
arch.getClass(generateStaticProperty: false)
|
||||
}
|
||||
.joined(separator: "\n\n")
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ enum ImagesError: Error {
|
||||
case createAssetFolder(String)
|
||||
case unknown(String)
|
||||
|
||||
var localizedDescription: String {
|
||||
var description: String {
|
||||
switch self {
|
||||
case .extensionNamesCollision(let extensionName):
|
||||
return "error: [\(Fonts.toolName)] Error on extension names, extension name and SwiftUI extension name should be different (\(extensionName) is used on both)"
|
||||
|
@ -14,7 +14,7 @@ enum StringiumError: Error {
|
||||
case writeFile(String, String)
|
||||
case langNotDefined(String, String, Bool)
|
||||
|
||||
var localizedDescription: String {
|
||||
var description: String {
|
||||
switch self {
|
||||
case .fileNotExists(let filename):
|
||||
return "error: [\(Stringium.toolName)] File \(filename) does not exists "
|
||||
|
@ -12,7 +12,7 @@ enum TwineError: Error {
|
||||
case langsListEmpty
|
||||
case defaultLangsNotInLangs
|
||||
|
||||
var localizedDescription: String {
|
||||
var description: String {
|
||||
switch self {
|
||||
case .fileNotExists(let filename):
|
||||
return "error: [\(Twine.toolName)] File \(filename) does not exists "
|
||||
|
Loading…
x
Reference in New Issue
Block a user