Renaming errors property: localizedDescription -> description
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:
2022-11-22 17:37:24 +01:00
parent fc427733ee
commit 9ab7e74991
7 changed files with 18 additions and 18 deletions

View File

@ -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")
}