Support manual versioning by avoiding relying on git tags #32
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.
Description
Currently, this plugin is setup in a way where it always calculates the version based on the current Git tag. If you haven't checked out that tag, it will produce a
SNAPSHOT
set of jars.With our new way of releasing SDKs using Ship CLI and Circle CI's Ship Orb, we need to modify the process a bit.
Projects should contain their own version property, which will be bumped by the Ship CLI, which then will be published by the Ship Orb.
To support that, we need to avoid using
Semver.current()
in the above use-case, which typically is when an explicit version is defined. Instead, we use theSemver
constructor which takes theversion
and aboolean
indicating whether or not it's a snapshot.We will default to using a snapshot, avoiding the need to provide any arguments when building a SNAPSHOT. If you dont want to build a snapshot, the
isSnapshot
value needs to be set tofalse
, which we will do in the Orb by passing-PisSnapshot
to the Gradle CLI.We are using a global project property because it seems that Library properties (defined on the plugin's Library class) are not initialized when running the plugins
apply
method.Testing
Checklist
master