Gradle plugin to launch custom and gradle task in sequential order
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.tgirard12:gradle-step-release-plugin:VERSION"
}
}
apply plugin: "com.tgirard12.gradle-step-release-plugin"
releaseStep {
githubGroup = "tgirard12"
githubProject = "gradle-step-release-plugin"
def gradleFile = "gradle.properties"
def props = ["project_version"]
def releaseVersion = setProperties(props, gradleFile)
steps = [message { "Releasing a new version" },
gitCheckChanges(),
gitCheckBranch { "master" },
// Set new Release version
releaseVersion,
checkProperties(props, gradleFile),
// Commit and create release version
gitAdd { [gradleFile] },
gitCommit { "v" + releaseVersion.stepResult },
task(":clean"),
task(":test"),
// Publish on bintray
task(":bintrayUpload"),
question {
"Publish artifact on jcenter ? \n\n" +
"https://bintray.com/tgirard12/kotlin/gradle-step-release-plugin ?"
},
gitPush("origin", "master"),
githubRelease(),
githubMilestone(),
message { "Release v" + releaseVersion.stepResult + " OK :-)" }
]
}
message { "Simple message" }
question { "Release a new version ?" }
read { "Read a value" }: String
step { println("Custom step") }
task(":clean")
task(":project:build")
-
checkProperties(propsKeys: List<String>, propFile: String = gradle.properties)
- Show properties in a file
propsKeys
: Properties list to showpropFile
: Properties file
-
setProperties(propsKeys: List<String>, propFile: String = gradle.properties)
- Modify properties in propFile without modify the order of any line
propsKeys
: Properties list to modifypropFile
: Properties file
gitCheckout { "branch" }
gitAdd { ["files"] }
gitCommit { "message" }
gitMerge("origin", "master")
gitPull("origin", "master")
gitPush("origin", "master")
gitTag { "name" } message: String? = null)
gitCheckChanges()
: Check if the repository is cleangitCheckBranch()
: Check the current branch
GitHub properties must be set :
githubUrl: String = "https://github.com"
githubGroup: String
githubProject: String
Open Github Web UI :
githubPullRequest("sourceBranch", "targetBranch")
- Create Pull request
githubRelease()
- Create new release
githubMilestone()
- Create new Milestone
Gitlab properties must be set :
gitlabUrl: String = "https://gitlab.com"
gitlabGroup: String?
gitlabProject: String?
Open GitLab Web UI :
gitlabMergeRequest("sourceBranch", "targetBranch")
- Create Merge request
gitlabTag( { "tagName" }, "branch")
- Create new tag
gitlabMilestone()
- Create new Milestone