Groovy Documentation

org.gradle.api.invocation
[Java] Interface Gradle


public interface Gradle

A Gradle represents an invocation of Gradle.

You can obtain a Gradle instance by calling Project#getGradle()#getGradle(). In your build file you can use gradle to access it.


Method Summary
void addListener(java.lang.Object listener)

Adds the given listener to this build.

void removeListener(java.lang.Object listener)

Removes the given listener from this build.

void useLogger(java.lang.Object logger)

Uses the given object as a logger.

 

Method Detail

addListener

public void addListener(java.lang.Object listener)
Adds the given listener to this build. The listener may implement any of the given listener interfaces:
Parameters:
listener - The listener to add. Does nothing if this listener has already been added.


removeListener

public void removeListener(java.lang.Object listener)
Removes the given listener from this build.
Parameters:
listener - The listener to remove. Does nothing if this listener has not been added.


useLogger

public void useLogger(java.lang.Object logger)
Uses the given object as a logger. The logger object may implement any of the listener interfaces supported by addListener(Object). Each listener interface has exactly one associated logger. When you call this method with a logger of a given listener type, the new logger will replace whichever logger is currently associated with the listener type. This allows you to selectively replace the standard logging which Gradle provides with your own implementation, for certain types of events.
Parameters:
logger - The logger to use.


 

Groovy Documentation