Add visibility parameters to control scope of generated extension
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2025-07-18 11:53:46 +02:00
parent beca2c6b2b
commit 7162f13166
61 changed files with 1511 additions and 791 deletions

View File

@ -10,6 +10,11 @@ import Foundation
extension AnalyticsConfiguration: Runnable {
func run(projectDirectory: String, force: Bool) {
let args = getArguments(projectDirectory: projectDirectory, force: force)
Analytics.main(args)
}
func getArguments(projectDirectory: String, force: Bool) -> [String] {
var args = [String]()
if force {
@ -20,25 +25,23 @@ extension AnalyticsConfiguration: Runnable {
inputFile.prependIfRelativePath(projectDirectory),
"--target",
target,
"--extension-output-path",
extensionOutputPath.prependIfRelativePath(projectDirectory),
"--static-members",
"\(staticMembersOptions)"
"--output-file",
outputFile.prependIfRelativePath(projectDirectory)
]
if let extensionName {
args += [
"--extension-name",
extensionName
]
}
if let extensionSuffix {
args += [
"--extension-suffix",
extensionSuffix
]
// Add optional parameters
[
("--visibility", visibility),
("--static-members", staticMembers?.description)
].forEach { argumentName, argumentValue in
if let argumentValue {
args += [
argumentName,
argumentValue
]
}
}
Analytics.main(args)
return args
}
}