researchgate / gradle-release

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

Fix to allow releases on any Git branch #360

Closed mattlong-finocomp closed 2 years ago

mattlong-finocomp commented 2 years ago

requireBranch is always present due to the convention on the property. Even when overriding to empty string or null it is still considered present.

loosebazooka commented 2 years ago

could you just use requireBranch.set(".*") ?

mattlong-finocomp commented 2 years ago

could you just use requireBranch.set(".*") ?

Looks like yes, but I was trying to make the doco suggestion of Set to '' to ignore accurate.

Hillkorn commented 2 years ago

Setting it to null should skip the branch verification that we don't need an empty string.

mattlong-finocomp commented 2 years ago

That doesn't work. See javadoc of Gradle's Property.set method: https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html#set-T- This method can also be used to discard the value of the property, by passing it null. When the value is discarded (or has never been set in the first place), the convention (default value) for this property, if specified, will be used to provide the value instead. So once it's set to null it goes back to using the convention which is master