Closed hatavan83 closed 4 years ago
Here is an example of simple java app with groovy dsl
buildscript {
repositories {
mavenCentral()
}
//Dependency to release plugin for build script
dependencies {
classpath "ru.fix:gradle-release-plugin:1.3.6"
}
}
plugins {
id "java"
}
//Applying plugin for the project
apply plugin : "ru.fix.gradle.release"
//configure plugin if required
'ru.fix.gradle.release' {
mainBranch = "master"
releaseBranchPrefix = "releases/release-"
}
group "gradle-release-usage"
version "1.0-SNAPSHOT"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}
after applying config you can run gradle createBranchRelease
Let us know if there will be any problems with configuration. Also it will be very helpful if you provide gradle error logs
Project documentation updated, added groovy dsl example to project readme
@swarmshine
Can I customize that repo has only 1 release branch as production
without x.y
?
I think the plugin was tag as release, the hot fix just for lasted release, so that I don't need many branch as production/release-x.y
@hatavan83
Could you please clarify the release scheme that you are suggesting:
└master
└production <-- here we will maintain our release branch and we will tag our releases there, e.g. 1.0, 1.1 etc
we expect that gradle createRelease
command will
gradle.properties
file with updated version=1.2
.
as a result we will have same branch structure
└master
└production
but now there will be tags 1.0, 1.1 and 1.2 that was made based on production branch.
Am I understood you correctly? @swarmshine
@hatavan83 Could you please clarify the release scheme that you are suggesting: └master └production <-- here we will maintain our release branch and we will tag our releases there, e.g. 1.0, 1.1 etc we expect that
gradle createRelease
command will
- look for existing tags, found that there already exist tags 1.0 and 1.1
- bases on current production branch plugin will create new tag 1.2 that will contain updated
gradle.properties
file with updatedversion=1.2
. as a result we will have same branch structure └master └production but now there will be tags 1.0, 1.1 and 1.2 that was made based on production branch. Am I understood you correctly?
Yes, I just need 1 branch as production
I want a PR from master
to production
if PR success, I will release this branch as tag x.x.x
Current behavior of createRelease
task is following:
ru.fix.gradle.release.releaseBranchVersion
property. If so - use x.y
major part of version from this property, checkout branch release/x.y
and build new release based on that branch. if there is no such property provided, createRelease
will try to detect x.y
prefix from current branch name. In order to implement suggested functionality createRelease
can work in a same way, except final step: it could check whether branch has x.y
suffix, if branch does not have that, e.g. branch called production
, then it can try to scan all possible tags and use major version x.y
from that latest tag.
I will create separate issue for this functionality, since it does not have anything to do with groovy DSL. https://github.com/ru-fix/gradle-release-plugin/issues/5
@hatavan83 single release branch flow implemented in 1.3.16 release. You can check out documentation and examples.
I cannot apply this plugin with gradle 5+ and groovy dsl, could you please give me more guideline detail