ScriptHandler (Gradle API 8.14) (original) (raw)


public interface ScriptHandler

A ScriptHandler allows you to manage the compilation and execution of a build script. You can declare the classpath used to compile and execute a build script. This classpath is also used to load the plugins which the build script uses.

You can obtain a ScriptHandler instance using Project.getBuildscript() or Script.getBuildscript().

To declare the script classpath, you use the DependencyHandler provided bygetDependencies() to attach dependencies to the "classpath" configuration. These dependencies are resolved just prior to script compilation, and assembled into the classpath for the script.

For most external dependencies you will also need to declare one or more repositories where the dependencies can be found, using the RepositoryHandler provided by getRepositories().

Fields
The name of the configuration used to assemble the script classpath.

void
Configures the configurations for the script.
void
Configures the dependencies for the script.
void
Configures dependency locking
Returns the ClassLoader which contains the classpath for this script.
Returns the configurations of this handler.
Returns the dependencies of the script.
Provides access to configuring dependency locking
Returns a handler to create repositories which are used for retrieving dependencies for the script classpath.
Returns the file containing the source for the script, if any.
Returns the URI for the script source, if any.
void
Configures the repositories for the script dependencies.