ru.fix.gradle.release.plugin.CreateReleaseBranchTask.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-release-plugin Show documentation
Show all versions of gradle-release-plugin Show documentation
Plugin automatically creates branches and tags and changes version in project gradle.properties file.
The newest version!
package ru.fix.gradle.release.plugin
import org.gradle.api.DefaultTask
import org.gradle.api.internal.tasks.userinput.UserInputHandler
import org.gradle.api.tasks.TaskAction
open class CreateReleaseBranchTask : DefaultTask() {
@TaskAction
fun createReleaseBranch() {
val userInputHandler = services.get(UserInputHandler::class.java)
val userInteractor = GradleUserInteractor(project, userInputHandler)
try {
BranchGardener(
project,
userInteractor,
ProjectFilesLookup(project, userInteractor)).createReleaseBranch()
} catch (exc: Exception) {
userInteractor.error(exc.message ?: "")
throw exc
}
}
}