# GenerateEclipseClasspath

API Documentation: | `GenerateEclipseClasspath`

Generates an Eclipse `.classpath` file.

### Properties

Property | Description
`containers` | Containers to be added to the classpath
`defaultOutputDir` | The default output directory for eclipse generated files, eg classes.
`downloadJavadoc` | Whether to download and add javadocs associated with the dependency jars. Defaults to false.
`downloadSources` | Whether to download and add sources associated with the dependency jars. Defaults to true.
`inputFile` | The input file to load the initial configuration from. Defaults to the output file. If the specified input file does not exist, this task uses some default initial configuration.
`minusConfigurations` | The configurations which files are to be excluded from the classpath entries.
`outputFile` | The output file to write the final configuration to.
`plusConfigurations` | The configurations which files are to be transformed into classpath entries.
`sourceSets` | The source sets to be added to the classpath.
`variables` | Adds path variables to be used for replacing absolute paths in classpath entries.

### Property details

#### ``Set`<`String`>` `containers`

Containers to be added to the classpath

Default with `eclipse` and `java` plugins:
  [JRE container]

#### `File` `defaultOutputDir`

The default output directory for eclipse generated files, eg classes.

Default with `eclipse` and `java` plugins:
  ``${project.projectDir}`/bin`

#### `boolean` `downloadJavadoc`

Whether to download and add javadocs associated with the dependency jars. Defaults to false.

Default with `eclipse` and `java` plugins:
  `false`

#### `boolean` `downloadSources`

Whether to download and add sources associated with the dependency jars. Defaults to true.

Default with `eclipse` and `java` plugins:
  `true`

#### `File` `inputFile`

The input file to load the initial configuration from. Defaults to the output file. If the specified input file does not exist, this task uses some default initial configuration.

#### ``Collection`<`Configuration`>` `minusConfigurations`

The configurations which files are to be excluded from the classpath entries.

Default with `eclipse` and `java` plugins:
  `[]`

#### `File` `outputFile`

The output file to write the final configuration to.

Default with `eclipse` and `java` plugins:
  ``${project.projectDir}`/.classpath`

#### ``Collection`<`Configuration`>` `plusConfigurations`

The configurations which files are to be transformed into classpath entries.

Default with `eclipse` and `java` plugins:
  `project.configurations.testRuntime`

#### ``Iterable`<`SourceSet`>` `sourceSets`

The source sets to be added to the classpath.

Default with `eclipse` and `java` plugins:
  `project.sourceSets`

#### ``Map`<`String`, `File`>` `variables`

Adds path variables to be used for replacing absolute paths in classpath entries.

Default with `eclipse` and `java` plugins:
  `[:]`

### Script blocks

No script blocks

### Methods

Method | Description
`beforeConfigured(closure)` | Adds a closure to be called before the domain object is configured by this task. The domain object is passed as a parameter to the closure.
`beforeConfigured(action)` | Adds an action to be called before the domain object is configured by this task. The domain object is passed as a parameter to the action.
`containers(containers)` | Adds containers to the .classpath.
`variables(variables)` | Adds variables to be used for replacing absolute paths in classpath entries.
`whenConfigured(closure)` | Adds a closure to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the closure.
`whenConfigured(action)` | Adds an action to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the action.
`withXml(closure)` | Adds a closure to be called when the XML document has been created. The XML is passed to the closure as a parameter in form of a `XmlProvider`. The closure can modify the XML before it is written to the output file.
`withXml(action)` | Adds an action to be called when the XML document has been created. The XML is passed to the action as a parameter in form of a `XmlProvider`. The action can modify the XML before it is written to the output file.

### Method details

#### `void` `beforeConfigured`(`Closure` closure)

Adds a closure to be called before the domain object is configured by this task. The domain object is passed as a parameter to the closure.

The closure is executed after the domain object has been loaded from the input file. Using this method allows you to change the domain object in some way before the task configures it.

#### `void` `beforeConfigured`(``Action`<? super `T`>` action)

Adds an action to be called before the domain object is configured by this task. The domain object is passed as a parameter to the action.

The action is executed after the domain object has been loaded from the input file. Using this method allows you to change the domain object in some way before the task configures it.

#### `void` `containers`(``String`...` containers)

Adds containers to the .classpath.

#### `void` `variables`(``Map`<`String`, `File`>` variables)

Adds variables to be used for replacing absolute paths in classpath entries.

#### `void` `whenConfigured`(`Closure` closure)

Adds a closure to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the closure.

The closure is executed just before the domain object is written to the output file. Using this method allows you to override the configuration applied by this task.

#### `void` `whenConfigured`(``Action`<? super `T`>` action)

Adds an action to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the action.

The action is executed just before the domain object is written to the output file. Using this method allows you to override the configuration applied by this task.

#### `void` `withXml`(`Closure` closure)

Adds a closure to be called when the XML document has been created. The XML is passed to the closure as a parameter in form of a `XmlProvider`. The closure can modify the XML before it is written to the output file.

#### `void` `withXml`(``Action`<? super `XmlProvider`>` action)

Adds an action to be called when the XML document has been created. The XML is passed to the action as a parameter in form of a `XmlProvider`. The action can modify the XML before it is written to the output file.