-
Notifications
You must be signed in to change notification settings - Fork 155
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
Need to be able to force increment a release #325
Comments
Our setup currently doesn't have this issue, as our repository is split into independent builds, which don't reference each other and are only connected through a composite build configuration. But in another build I have the requirement to build and publish only JARs of those modules, that actually changed. I think the key to achieve this is, to have all inputs of the jar task unchanged, so that it's skipped with 'UP-TO-DATE'. In my opinion, this feature cannot be accomplished with the axion-release plugin, as long as it is focused on changes in git. This feature needs some sort of dynamic version calculation, where the decision, if the version needs to be incremented, is based on the jar task's inputs. I recently started a discussion with gradle about my requirement. If there are any suggestions, they can provide, I am going to share them with you. |
I've gone through what the Java plugin does to resolve this and I think we can at least support incrementing the version across dependent modules. Here's what I propose, covering this issue and #314 . For this issue:
For #314, follow the approach taken by the Gradle core Java plugin:
This proposal would result in no breaking changes to any existing project. Only if the new tasks ( Does anyone have any objections to this approach and are you happy for me to put together a PR for people to have a look at? |
I have managed to come up with a working implementation. It differs in implementation somewhat from the description above, in that I discovered that the version incrementing is performed by |
…ent-release' into maiatechio
@john-tipper Was this ever resolved as I have the same issue |
With the new support for monorepos, there is an issue when a submodule depends on another module but there are no code changes within the dependent module, in that the dependent module does not have its version incremented.
For example, given a project with modules
mod_a
andmod_b
, where bothmod_a
andmod_b
are to be published as artifacts and also wheremod_b
is dependent onproject(":mod_a")
, then a change withinmod_a
will result in the version ofmod_a
being incremented, but the version ofmod_b
will not.Within the
Releaser
class (https://github.com/allegro/axion-release-plugin/blob/master/src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java#L31), there is a check to see if there are changes and if not (i.e. the version is not a snapshot) then the version will not increment. There does not appear to me to be an easy way to request thatmod_b
's version be incremented too (as opposed to forcing it to be a specific version via-Prelease.forceVersion=x.y.z
).Gradle has a
buildNeeded
andbuildDependents
task (c.g. docs here), where, for the example above, I could call:mod_a:buildDependents
and:mod_a:build
and:mod_b:build
would be called.Ideally, I think under CI/CD it would be nice to just call
./gradlew release
and have the version(s) of the modules that changed be incremented (where we count a dependency between the modules as being a material change in the dependent module), even if there were no code changes to the code actually within the dependent modules.I think this is loosely related to #314.
Whilst this sort of logic does not necessarily need to reside inside this plugin, it would be nice to document within the project how this sort of functionality could be achieved.
@adamdubiel, @kboom and @sradi, what are your thoughts here please?
The text was updated successfully, but these errors were encountered: