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

Include full semver version in version.properties #4

Merged
merged 2 commits into from
Apr 11, 2019

Conversation

ronaldvaneede
Copy link
Contributor

So it could be interpreted by other (build) scripting for example.

@ethauvin ethauvin added this to the 1.0.0 milestone Apr 11, 2019
@ethauvin
Copy link
Owner

@rveede Not a bad idea either. Can you resolve the conflicts with what I just pushed? Thanks.

@ronaldvaneede
Copy link
Contributor Author

Done.

./gradlew -Dversion.prerelease=betaaa -Dversion.major=22 run will create this version.properties file:

#Thu Apr 11 16:58:14 CEST 2019
version.major=22
version.meta=
version.minor=0
version.patch=0
version.prerelease=betaaa
version.semver=22.0.0-betaaa

@ethauvin ethauvin merged commit e2c0110 into ethauvin:master Apr 11, 2019
@ethauvin
Copy link
Owner

@rveede I've added the ability to set the semver key.

semver {
    semverKey = fullversion
}
#version.properties
version.fullversion=1.0.10

I haven't incorporated it in the tests yet, so if you have a chance to play with it. I'd appreciate it.

I'm actually thinking of allowing the semver version to be set directly via the command line:

./gradlew --Dversion.semver=1.2.1-beta+sha256 ...

Thoughts?

Thanks.

@ronaldvaneede ronaldvaneede deleted the full-version branch April 12, 2019 06:41
@ronaldvaneede
Copy link
Contributor Author

@rveede I've added the ability to set the semver key.

semver {
    semverKey = fullversion
}
#version.properties
version.fullversion=1.0.10

nice :)

I haven't incorporated it in the tests yet, so if you have a chance to play with it. I'd appreciate it.

I will see what I can do.

I'm actually thinking of allowing the semver version to be set directly via the command line:

./gradlew --Dversion.semver=1.2.1-beta+sha256 ...

Thoughts?

I didn't include that because version.semver was calculated from the other variables.
I guess you could do that and then split on the . - and + characters but then you should also taken into account that the prerelease value could also include - characters etc.

@ethauvin
Copy link
Owner

@rveede I did it. Give it a shot. I'm pretty pleased with the parser.

I also converted major, minor and patch to Int internally, which has the added benefit of doing a bit of validation on the properties file.

Let me know what you think.

@ethauvin
Copy link
Owner

@rveede Have you been able to break the semver parser?

@ronaldvaneede
Copy link
Contributor Author

haven't been able to test yet but will do asap.

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.

2 participants