Grease icon indicating copy to clipboard operation
Grease copied to clipboard

add dependencies from grease configuration to compileOnly

Open 0xera opened this issue 1 year ago • 4 comments

0xera avatar Sep 23 '24 15:09 0xera

Were you able to reproduce #11? As I remember using compileClasspath already makes compilation work. And compileOnly creates problem downstream because it adds the dependency to the POM. I think we should have a reproducer for #11 first

natario1 avatar Sep 23 '24 17:09 natario1

I tried to publish the library with compileOnly and the dependency did not appear in the pom file. I also found this discussion https://discuss.gradle.org/t/publishing-plugin-should-respect-compileonly-configuration/22903 And checked old fat aar plugins - they also add dependencies with compileOnly. This trick seems to work

0xera avatar Sep 23 '24 17:09 0xera

No, i could not reproduce #11. Also author says first crash does not happen anymore

0xera avatar Sep 23 '24 17:09 0xera

I have found why there is a problem with META-INF. It is because shadow jar uses Gradle Api from 8.3 version, so building a library with lower version than 8.3 will led to the crash. We could write about these limitations in the README

Снимок экрана 2024-09-29 в 12 50 36 Снимок экрана 2024-09-29 в 12 50 46

0xera avatar Sep 29 '24 10:09 0xera

Hi, @natario1 I have added a functional test and you can run it to make sure that compileOnly dependencies are not in a pom file

0xera avatar Oct 08 '24 09:10 0xera

@0xera I approved it, my doubt is whether this really fixes anything. compileClasspath always worked well regarding adding deps to the compilation classpath, so if it works we shouldn't change it. But feel free to merge if you reproduced issues with compileClasspath that are solved by compileOnly.

natario1 avatar Oct 08 '24 12:10 natario1