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

gradle: Use dependency's jars for compilation #3642

Merged
merged 2 commits into from
Dec 9, 2019
Merged

gradle: Use dependency's jars for compilation #3642

merged 2 commits into from
Dec 9, 2019

Conversation

bjhargrave
Copy link
Member

If the java-library plugin is applied, Gradle will compile against
the dependency's classes dir instead of building the jar and compiling
against the jar. This is not good for bundles since Bnd can pull in code
from other places and also set the package metadata.

So we configure the sourceSet's compileClasspath configuration to use
jars for compilation.

This support requires Gradle 5.6 or later.

See https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_classes_usage

@bjhargrave
Copy link
Member Author

bjhargrave commented Dec 7, 2019

If the `java-library` plugin is applied, Gradle will compile against
the dependency's classes dir instead of building the jar and compiling
against the jar. This is not good for bundles since Bnd can pull in code
from other places and also set the package metadata.

So we configure the sourceSet's compileClasspath configuration to use
jars for compilation.

This support requires Gradle 5.6 or later.

See https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_classes_usage

Signed-off-by: BJ Hargrave <[email protected]>
@bjhargrave bjhargrave merged commit ac3fc84 into bndtools:master Dec 9, 2019
@bjhargrave bjhargrave deleted the jar-for-compilation branch December 9, 2019 16:09
@rotty3000
Copy link
Contributor

@bjhargrave sorry I didn't get a chance to look at this yet, but I will try sometime later this week with the junit5 project. Thanks for tackling this.

@rotty3000
Copy link
Contributor

@bjhargrave is this too heavy a change for inclusion into the discussed 4.3.2 maintenance release?

@bjhargrave
Copy link
Member Author

is this too heavy a change for inclusion into the discussed 4.3.2 maintenance release?

It is fairly safe, but the commit may not merge easily due to lots of changes in the gradle plugin code for Bnd 5.0.

@rotty3000
Copy link
Contributor

got it!

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

Successfully merging this pull request may close these issues.

2 participants