researchgate / gradle-release

gradle-release is a plugin for providing a Maven-like release process for projects using Gradle
MIT License
865 stars 223 forks source link

Un-snapshot and update project version and other version properties independently #198

Open kernanj opened 7 years ago

kernanj commented 7 years ago

From what I understand, the versionProperties property in ReleaseExtension is used for updating extra properties but those properties are always given a value of project.version.

Would it be more suitable to update properties by getting their next version independently?

Consider the following example:

gradle.properties

version=1.0.0.1-SNAPSHOT
componentVersion1=2.1.0.1-SNAPSHOT
componentVersion2=7.1.3.1-SNAPSHOT
release {
    versionProperties = ['componentVersion1','componentVersion2']
}

From looking at the code, it looks like all properties in versionProperties will get updated to project.version

For the unsnapshot, gradle.properties now becomes

gradle.properties

version=1.0.0.1
componentVersion1=1.0.0.1
componentVersion2=1.0.0.1

Would it be more suitable to just unsnapshot these versionProperties so you're left with

gradle.properties

version=1.0.0.1
componentVersion1=2.1.0.1
componentVersion2=7.1.3.1

The updateVersion could also be changed to get the next version of each property rather than just update project.version and setting that version on all other properties.

The result of the updateVersion would then be this:

gradle.properties

version=1.0.0.2-SNAPSHOT
componentVersion1=2.1.0.2-SNAPSHOT
componentVersion2=7.1.3.2-SNAPSHOT

I'm happy to help out with this if you think it's a valid enhancement.

Hillkorn commented 7 years ago

For what you want to use it? Do you want to unsnapshot dependencies you project has or subprojects?

kernanj commented 7 years ago

I want to unsnapshot dependencies specifically but it would be pretty neat to version subprojects independently too

Hillkorn commented 7 years ago

Okay. I like that idea. And the tests will check against the unsnapshot versions. Would fit good into my workflow too.

Jonathan Kernan notifications@github.com schrieb am Mi., 19. Okt. 2016, 18:07:

I want to unsnapshot dependencies specifically but it would be pretty neat to version subprojects independently too

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/researchgate/gradle-release/issues/198#issuecomment-254860504, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsepDnvkMv-BAhQBTx0n4PaadYgbsQOks5q1kBPgaJpZM4Kauyh .