feat(RES-57): Add visibility to control scope of generated code (#18)
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good

Add visibility parameter: public, package, internal, private
Impacted command: analytics, colors, fonts, images, strings, tags

Reviewed-on: #18
This commit is contained in:
2025-07-21 16:56:05 +02:00
parent beca2c6b2b
commit 5ad219ae89
62 changed files with 1526 additions and 794 deletions

View File

@@ -6,6 +6,7 @@
//
import Foundation
import ToolCore
enum ImageExtension: String {
@@ -129,16 +130,16 @@ struct ParsedImage {
// MARK: - Extension property
func getImageProperty(isStatic: Bool, isSwiftUI: Bool) -> String {
func getImageProperty(isStatic: Bool, isSwiftUI: Bool, visibility: ExtensionVisibility) -> String {
if isSwiftUI {
return """
\(isStatic ? "static " : "")var \(name): Image {
\(visibility) \(isStatic ? "static " : "")var \(name): Image {
Image("\(name)")
}
"""
}
return """
\(isStatic ? "static " : "")var \(name): UIImage {
\(visibility) \(isStatic ? "static " : "")var \(name): UIImage {
UIImage(named: "\(name)")!
}
"""