Skip to content
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

If for some reason we're missing java.lang.Object mapping during import, fail eagerly #195

Open
ktoso opened this issue Dec 5, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed Java2Swift

Comments

@ktoso
Copy link
Collaborator

ktoso commented Dec 5, 2024

Due to dependencies behaving weirdly in plugins the JavaKit dependency was not pulled unless more things were spelled out explicitly...

This resulted in a generated file like:

@JavaClass("org.apache.commons.io.FilenameUtils")
open class FilenameUtils {
  @JavaMethod
  @_nonoverride public convenience init(environment: JNIEnvironment? = nil)
}

which will fail to compile because we need the:

@JavaClass("org.apache.commons.io.FilenameUtils")
open class FilenameUtils: JavaObject {
  @JavaMethod
  @_nonoverride public convenience init(environment: JNIEnvironment? = nil)
}

form.

If we're ever generating code and we're missing JavaObject we should just immediately crash rather than hide the error futher along the build as it can be hard to diagnose what actually went wrong -- but it was a missing dependency on the swift-java file that declared java.lang.object.

@ktoso ktoso added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed Java2Swift labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed Java2Swift
Projects
None yet
Development

No branches or pull requests

1 participant