eed3si9n / jarjar-abrams

an experimental Scala extension of Jar Jar Links
27 stars 21 forks source link

Support for service providers #21

Closed gabrielrussoc closed 3 years ago

gabrielrussoc commented 3 years ago

I believe this has been a known issue since 2009: https://code.google.com/archive/p/jarjar/issues/30

This seems to be the only actively maintained fork of jarjar I could find, so I decided to contribute here.

I added some tests to the ResourceProcessor.


Since we are only using the jarjar cli, I also added the assembly plugin in order to build an uber jar. There were some module-info.class clashes so I simply ignored them since we will build it with jdk 8 (and they are most likely useless):

[error] 1 error was encountered during merge
[error] stack trace is suppressed; run last assembly for the full output
[error] (assembly) deduplicate: different file contents found in the following:
[error] /Users/gabriel.russo/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar:module-info.class
[error] /Users/gabriel.russo/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar:module-info.class
[error] /Users/gabriel.russo/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar:module-info.class
[error] /Users/gabriel.russo/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm/9.2/asm-9.2.jar:module-info.class
[error] Total time: 2 s, completed 21 Oct 2021, 15:12:28
eed3si9n commented 3 years ago

Thanks for the contribution!

er1c commented 3 years ago

For the failure, I htink you just need .linesIterator although maybe I'm thinking about the scala method and not the java one

[error] /home/runner/work/jarjar-abrams/jarjar-abrams/jarjar/src/main/java/com/eed3si9n/jarjar/ResourceProcessor.java:59:1: cannot find symbol
[error]   symbol:   method lines()
[error]   location: variable s of type java.lang.String
[error] s.lines
er1c commented 3 years ago

@gabrielrussoc thanks again for the contribution! Going to add an uber assembly on the next published version via: https://github.com/eed3si9n/jarjar-abrams/pull/23