Hi. I would like to have a task that defines some properties, that are then used as attribute values in the jar.manifest.attributes. I am failing, here is what I have:
task dynprop << {
someprop = ‘some dynamic value’ }
jar {
dependsOn dynprop
manifest {
attributes(
someprop: dynprop.someprop
)
} }
It fails saying that: > Could not find property ‘someprop’ on task ‘:scm’.
Which is true, because at the time the attributes are configured, the dynprop task hasn’t run yet. If I change it to this:
task dynprop {
someprop = ‘some dynamic value’ }
it works, but is not really what I would like - it will run every time the build script is executed, not only when needed.
How to achieve what I would like?