-
Notifications
You must be signed in to change notification settings - Fork 78
Fix swift-java.config not being loaded from dependency module directories
#542
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
|
|
||
| guard let javaPackage = configuration?.javaPackage else { | ||
| // throw SwiftJavaPluginError.missingConfiguration(sourceDir: "\(sourceDir)", key: "javaPackage") | ||
| log("Skipping jextract step, no 'javaPackage' configuration in \(getSwiftJavaConfigPath(target: target) ?? "")") |
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.
Removing javaPackage handling to the command as it already accounts for empty values.
swift-java/Sources/JExtractSwiftLib/Swift2Java.swift
Lines 40 to 42 in 8cf1829
| if config.javaPackage == nil || config.javaPackage!.isEmpty { | |
| translator.log.warning("Configured java package is '', consider specifying concrete package for generated sources.") | |
| } |
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.
I'd like to understand what exactly is the usage pattern you're trying to enable using this change?
|
We are maintaining a common Our project structure is as follows: When we set up |
|
Okey I think I get it -- problem being your unusual package structure here... I think that's fine then, we should be able to handle other layouts like that in mixed language projects since you may be not actually using AndroidCore as anything anyone would depend on so it living in not-root may be fine. |
|
Thank you for your review. |
Description
Currently,
swift-java.configis not correctly loaded when placed in a dependency package, unless it is located directly under the/Sources/directory.The following line attempts to scan for the configuration file, but if the file is not found at the inferred path, it returns
niland falls back to the default configuration:swift-java/Sources/SwiftJavaTool/SwiftJavaBaseAsyncParsableCommand.swift
Line 172 in 8cf1829
Observed Behavior
When a dependency is placed in a outer package, the tool fails to locate the config file:
This leads to incorrect behavior where settings defined in the config file are ignored. While
javaPackageworks because it is passed via command-line arguments, other configurations remain at their default values.Changes
I have modified the plugin to ensure that the configuration file path is correctly passed to the underlying
jextractcommand.