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

support scala jars better #32

Open
johnynek opened this issue Feb 8, 2023 · 1 comment
Open

support scala jars better #32

johnynek opened this issue Feb 8, 2023 · 1 comment

Comments

@johnynek
Copy link
Collaborator

johnynek commented Feb 8, 2023

see the code here:

https://github.com/eed3si9n/jarjar-abrams/blob/develop/core/src/main/scala/com/eed3si9n/jarjarabrams/scalasig/EntryTable.scala#L38

these rules aren't currently touching scala signatures (and I don't know if kotlin has something similar).

cc @eed3si9n

@sheilahu
Copy link

Hi @johnynek I'm trying to use the rule for shading java and scala dependencies to build a fat scala jar.
I first use java_binary to get the implicit <name>_deploy.jar as a fat jar, then use bazel_jar_jar to shade dependencies.

For a simple rule like this:

 inline_rules = [
        "rule com.typesafe.** shaded.@0",
        "zap scala.**",
        "zap java.**",
    ],

once imported it's still asking for the unshaded version of the library.

error: Symbol 'type com.typesafe.scalalogging.LazyLogging' is missing from the classpath.
This symbol is required by 'class MyClass'.
Make sure that type LazyLogging is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'MyClass.class' was compiled against an incompatible version of com.typesafe.scalalogging.

I tried this with another Java library, similar error.

Once I decompiled the bytecode into Java file, it's showing me correctly that the dependency was shaded inside MyClass.

Wonder if this has anything to do with the scala signature and reflection?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants