All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.fix.gradle.release.plugin.GradleUserInteractor.kt Maven / Gradle / Ivy

Go to download

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.Project
import org.gradle.api.internal.tasks.userinput.UserInputHandler
import org.gradle.api.logging.LogLevel


class GradleUserInteractor(project: Project, private val gradleUserInputHandler: UserInputHandler) : UserInteractor {

    private val logger = project.logger

    override fun promptQuestion(prompt: String, default: String?): String {
        return gradleUserInputHandler.askQuestion(prompt, default)
    }

    override fun promptPassword(prompt: String): CharArray {
        val input = gradleUserInputHandler.askQuestion(prompt, "")
        return input.toCharArray()
    }

    override fun info(msg: String) {
        logger.log(LogLevel.LIFECYCLE, msg)
    }

    override fun error(msg: String) {
        logger.log(LogLevel.ERROR, msg)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy