Skip to content

Conversation

bjhargrave
Copy link
Member

If Bundle-SymbolicName and/or Bundle-Version are not specified in the
bnd instructions, then BundleTaskExtension will set default values
based upon the Jar task's archiveBaseName, archiveClassifier, and
archiveVersion properties. However, these Jar task properties are not
considered inputs to the Jar task. They are just considered as
parts of the archiveFile property which is an output property.

Setting the defaults as input properties means that Gradle will consider
them as part of the build cache key. This is important since the values
can end up in the build jar's manifest.

Fixes #5279

BundleTaskExtension supports using the Jar manifest property to
set attributes in the manifest main attribute section. However
it did not properly handle the use of a Provider to supply the value.
This fix is now in line with how the Gradle Manifest object handles
converting attribute values to a String.

Signed-off-by: BJ Hargrave <bj@hargrave.dev>
If Bundle-SymbolicName and/or Bundle-Version are not specified in the
bnd instructions, then BundleTaskExtension will set default values
based upon the Jar task's archiveBaseName, archiveClassifier, and
archiveVersion properties. However, these Jar task properties are not
considered inputs to the Jar task. They are just considered as
parts of the archiveFile property which is an output property.

Setting the defaults as input properties means that Gradle will consider
them as part of the build cache key. This is important since the values
can end up in the build jar's manifest.

Fixes bndtools#5279

Signed-off-by: BJ Hargrave <bj@hargrave.dev>
@bjhargrave bjhargrave merged commit 017248d into bndtools:master Jun 14, 2022
@bjhargrave bjhargrave deleted the issues/5279 branch June 14, 2022 17:22
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.

BundleTaskExtension$BuildAction adds undeclared inputs to jar tasks
1 participant