-
Notifications
You must be signed in to change notification settings - Fork 66
[jextract] Propagate build plugin config to command #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ktoso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix but we should approach this differently,
make all CLI options optional and only "override" the config values if they were set. This way we don't have to go to the plugin and pass strings anywhere, and it more models what we actually want:
func configure<T>(_ setting: inout T, overrideWith value: T?) {
if let value {
setting = value
}
}
and
config.outputJavaDirectory = outputJava
config.outputSwiftDirectory = outputSwift
configure(&config.unsignedNumbersMode, overrideWith: unsignedNumbers) <<<<
config.minimumInputAccessLevelMode = minimumInputAccessLevel
config.memoryManagementMode = memoryManagementMode
The problem is @Flag which does not support Bool? huh... so we need to figure that one out 🤔 Perhaps by manually parsing the command line arguments to see if it was passed or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for adjusting how we do this :)
|
We're having CI issues... I'll see what I can do about that, sadly 6.2 didn't get the fix yet we're waiting on |
Correctly propagates any configuration from
swift-java.configto the command line tool, when using the build plugin.Also fixes the docs to correctly specify the values of enum options, as they use camelCase and not kebab-case.