Groovy Documentation

release
[Groovy] Class PluginHelper

java.lang.Object
  release.PluginHelper

class PluginHelper

Helper object extended by plugins.

Authors:
evgenyg


Property Summary
Project project

 
Method Summary
java.lang.String capitalize(java.lang.String s)

Capitalizes first letter of the String specified.

java.lang.Object convention(java.lang.String pluginName, java.lang.Class conventionType)

Retrieves plugin convention of the type specified.

java.lang.String exec(boolean failOnStderr = true, java.util.Map env = [:], java.io.File directory = null, java.lang.String... commands)

Executes command specified and retrieves its "stdout" output.

void exec(java.util.List commands, java.lang.String errorMessage, java.lang.String... errorPattern)

Executes command specified and verifies neither "stdout" or "stderr" contain an error pattern specified.

java.io.File findPropertiesFile()

java.lang.String findProperty(java.lang.String key, java.lang.String defaultVal = "")

Logger getLog()

Retrieves SLF4J Logger instance.

boolean promptYesOrNo(java.lang.String message, boolean defaultValue = false)

java.lang.String readLine(java.lang.String message, java.lang.String defaultValue = null)

Reads user input from the console.

ReleasePluginConvention releaseConvention()

Gets current ReleasePluginConvention.

java.lang.Object setConvention(java.lang.String pluginName, java.lang.Object convention)

Sets convention specified under the plugin name provided.

java.lang.String tagName()

void updateVersionProperty(java.lang.String newVersion)

Updates properties file (gradle.properties by default) with new version specified.

boolean useAutomaticVersion()

void warnOrThrow(boolean doThrow, java.lang.String message)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

project

@SuppressWarnings('StatelessClass')
Project project


 
Method Detail

capitalize

java.lang.String capitalize(java.lang.String s)
Capitalizes first letter of the String specified.
Parameters:
s - String to capitalize
Returns:
String specified with first letter capitalized


convention

@SuppressWarnings('UnnecessaryPublicModifier')
java.lang.Object convention(java.lang.String pluginName, java.lang.Class conventionType)
Retrieves plugin convention of the type specified.
Parameters:
project - current Gradle project
pluginName - plugin name
conventionType - convention type
Returns:
plugin convention of the type specified


exec

java.lang.String exec(boolean failOnStderr = true, java.util.Map env = [:], java.io.File directory = null, java.lang.String... commands)
Executes command specified and retrieves its "stdout" output.
Parameters:
failOnStderr - whether execution should fail if there's any "stderr" output produced, "true" by default.
commands - commands to execute
Returns:
command "stdout" output


exec

void exec(java.util.List commands, java.lang.String errorMessage, java.lang.String... errorPattern)
Executes command specified and verifies neither "stdout" or "stderr" contain an error pattern specified.
Parameters:
commands - commands to execute
errorMessage - error message to throw, optional
errorPattern - error patterns to look for, optional


findPropertiesFile

java.io.File findPropertiesFile()


findProperty

java.lang.String findProperty(java.lang.String key, java.lang.String defaultVal = "")


getLog

Logger getLog()
Retrieves SLF4J Logger instance. The logger is taken from the Project instance if it's initialized already or from SLF4J LoggerFactory if it's not.
Returns:
SLF4J Logger instance


promptYesOrNo

boolean promptYesOrNo(java.lang.String message, boolean defaultValue = false)


readLine

java.lang.String readLine(java.lang.String message, java.lang.String defaultValue = null)
Reads user input from the console.
Parameters:
message - Message to display
defaultValue - (optional) default value to display
Returns:
User input entered or default value if user enters no data


releaseConvention

ReleasePluginConvention releaseConvention()
Gets current ReleasePluginConvention.
Parameters:
project - current Gradle project
Returns:
current ReleasePluginConvention.


setConvention

java.lang.Object setConvention(java.lang.String pluginName, java.lang.Object convention)
Sets convention specified under the plugin name provided.
Parameters:
pluginName - name of the plugin
convention - convention object to set
Returns:
convention instance set


tagName

java.lang.String tagName()


updateVersionProperty

void updateVersionProperty(java.lang.String newVersion)
Updates properties file (gradle.properties by default) with new version specified. If configured in plugin convention then updates other properties in file additionally to version property
Parameters:
newVersion - new version to store in the file


useAutomaticVersion

boolean useAutomaticVersion()


warnOrThrow

void warnOrThrow(boolean doThrow, java.lang.String message)


 

Groovy Documentation