Skip to content
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

feature/markNextVersionTask-creates-next-version-with-incrementer #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

jplucinski
Copy link
Owner

  • markNextVersionTask can create next version with incrementer

* markNextVersionTask can create next version with incrementer
@jplucinski jplucinski self-assigned this May 14, 2018
def version = nextVersionRules.nextVersion
def currentVersion = Version.valueOf(versionConfig.version)

if (nextVersionRules.versionIncrementer){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after )

@@ -64,7 +64,7 @@ enum PredefinedVersionIncrementer {
PredefinedVersionIncrementer creator = values().find { it.name == name }
if (creator == null) {
throw new IllegalArgumentException("There is no predefined version incrementer with $name name. " +
"You can choose from: ${values().collect { it.name }}");
Copy link

@pun-ky pun-ky May 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crucial changes ;) that semicolons...

@@ -47,6 +47,10 @@ class ScmService {
}
}

ScmPosition position(){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after ()

# ./gradlew cV
2.0.0-SNAPSHOT

To create next version marker use ``markNextVersion`` task along with obligatory command line option ``release.version``.
To create next version marker use ``markNextVersion``. Without parameters next version will be created with default version incrementer - incrementMinor,
witch can be overwritten with ``release.incrementer`` parameter.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Burn her, burn her!

# ./gradlew cV
2.0.0-SNAPSHOT

To create next version marker use ``markNextVersion`` task along with obligatory command line option ``release.version``.
To create next version marker use ``markNextVersion``. Without parameters next version will be created with default version incrementer - incrementMinor,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``incrementMinor``

?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def version = nextVersionRules.nextVersion
def currentVersion = Version.valueOf(versionConfig.version)

if (nextVersionRules.versionIncrementer){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting :)

@@ -47,6 +47,10 @@ class ScmService {
}
}

ScmPosition position(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting

if (nextVersion == null && project.hasProperty(DEPRECATED_NEXT_VERSION_PROPERTY)) {
project.logger.warn("Using deprecated parameter: $DEPRECATED_NEXT_VERSION_PROPERTY! Use $NEXT_VERSION_PROPERTY instead.")
nextVersion = project.property(DEPRECATED_NEXT_VERSION_PROPERTY)
}

return new NextVersionProperties(nextVersion: nextVersion, suffix: config.suffix, separator: config.separator,
return new NextVersionProperties(nextVersion: nextVersion, versionIncrementer: nextVersionIncrementer, suffix: config.suffix, separator: config.separator,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically a public constructor. How will it behave if we omit this parameter?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated all references, moreover in project instances of NextVersionfactory are created with builder NextVersionPropertiesBuilder.

jplucinski and others added 13 commits May 15, 2018 11:40
* added examples in doc
* fixed formatting
* using undecorated version for incrementer
* more explicit logic
* services clean up
* move incrementer resolving to nextversionmaker
* fix for unit test
Bug in integration tests setup code caused project.version
to be assigned before adding custom code. This means that
no version reading customizations were active in integraiton tests.
This enables better testing and isolation for
pretty sophisticated version sorting logic.
Specifies precedence of tags when multiple tags on single commit:

* when on head: use highest normal; if no normal - first alpha
* otherwise: use highest of all
*  remove VersionConfig dependencies from NextVersionPropertiesFactory
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.

5 participants