Skip to content

Comments

gradle: Use dependency's jars for compilation#3642

Merged
bjhargrave merged 2 commits intobndtools:masterfrom
bjhargrave:jar-for-compilation
Dec 9, 2019
Merged

gradle: Use dependency's jars for compilation#3642
bjhargrave merged 2 commits intobndtools:masterfrom
bjhargrave:jar-for-compilation

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 bjhargrave requested a review from rotty3000 December 7, 2019 18:10
@bjhargrave
Copy link
Member Author

bjhargrave commented Dec 7, 2019

We now use the newer strictly DSL.

See https://docs.gradle.org/6.0.1/userguide/rich_versions.html

Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
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 <bj@bjhargrave.com>
@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

@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

@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

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