gradle: Use dependency's jars for compilation#3642
Merged
bjhargrave merged 2 commits intobndtools:masterfrom Dec 9, 2019
bjhargrave:jar-for-compilation
Merged
gradle: Use dependency's jars for compilation#3642bjhargrave merged 2 commits intobndtools:masterfrom bjhargrave:jar-for-compilation
bjhargrave merged 2 commits intobndtools:masterfrom
bjhargrave:jar-for-compilation
Conversation
Member
Author
|
@rotty3000 Can you check if this fix removes the need for the following? |
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>
Member
Author
|
For reference, this is how Gradle processes the |
|
@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. |
|
@bjhargrave is this too heavy a change for inclusion into the discussed 4.3.2 maintenance release? |
Member
Author
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. |
|
got it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the
java-libraryplugin is applied, Gradle will compile againstthe 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