Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.gradle.plugins.ide.eclipse
[Groovy] Class GenerateEclipseProject

    java.lang.Object
      org.gradle.api.internal.AbstractTask
          org.gradle.api.DefaultTask
              org.gradle.api.internal.ConventionTask
                  org.gradle.plugins.ide.api.GeneratorTask
                      org.gradle.plugins.ide.api.XmlGeneratorTask
                          org.gradle.plugins.ide.eclipse.GenerateEclipseProject

    class GenerateEclipseProject
    extends XmlGeneratorTask

Generates an Eclipse `.project` file.

Example how to configure eclipse project generation:

     apply plugin: 'java'
     apply plugin: 'eclipse'

     eclipseProject {
       //...
     }

Authors:
  Hans Dockter

Field Summary

Fields inherited from class GeneratorTask
afterConfigured, beforeConfigured, domainObject, generator

Fields inherited from class org.gradle.api.internal.ConventionTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Fields inherited from class DefaultTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Fields inherited from class org.gradle.api.internal.AbstractTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Property Summary
`EclipseProject` | `projectModel` model for eclipse project (.project) generation

Constructor Summary
`GenerateEclipseProject()`

Method Summary
`void` | `buildCommand(java.util.Map args, java.lang.String buildCommand)` Adds a build command with arguments to the eclipse project.
`void` | `buildCommand(java.lang.String buildCommand)` Adds a build command to the eclipse project.
`protected void` | `configure(Project project)`
`protected Project` | `create()`
`java.util.List` | `getBuildCommands()` The build commands to be added to this Eclipse project.
`java.lang.String` | `getComment()` A comment used for the eclipse project
`java.util.Set` | `getLinks()` The linked resources to be added to this Eclipse project.
`java.util.List` | `getNatures()` The natures to be added to this Eclipse project.
`java.lang.String` | `getProjectName()` Configures eclipse project name.
`java.util.Set` | `getReferencedProjects()` The referenced projects of this Eclipse project.
`void` | `link(java.util.Map args)` Adds a link to the eclipse project.
`void` | `natures(java.lang.String natures)` Adds natures entries to the eclipse project.
`void` | `referencedProjects(java.lang.String referencedProjects)` Adds project references to the eclipse project.
`void` | `setBuildCommands(java.util.List buildCommands)`
`void` | `setComment(java.lang.String comment)`
`void` | `setLinks(java.util.Set links)`
`void` | `setNatures(java.util.List natures)`
`void` | `setProjectName(java.lang.String projectName)`
`void` | `setReferencedProjects(java.util.Set referencedProjects)`

Methods inherited from class XmlGeneratorTask
configure, create, getXmlTransformer, withXml, withXml

Methods inherited from class GeneratorTask
beforeConfigured, beforeConfigured, getInputFile, getOutputFile, setInputFile, setOutputFile, whenConfigured, whenConfigured

Methods inherited from class org.gradle.api.internal.ConventionTask
org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, org.gradle.api.tasks.ConventionValue), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setConventionMapping(org.gradle.api.internal.ConventionMapping), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#captureStandardOutput(org.gradle.api.logging.LogLevel), org.gradle.api.internal.ConventionTask#disableStandardOutputCapture(), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAdditionalProperties(), org.gradle.api.internal.ConventionTask#getDynamicObjectHelper(), org.gradle.api.internal.ConventionTask#setConvention(org.gradle.api.plugins.Convention), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()

Methods inherited from class DefaultTask
setProperty, toString, compareTo, compareTo, getName, getActions, getState, setName, getPath, getLogger, execute, isEnabled, configure, configure, property, getDescription, captureStandardOutput, disableStandardOutputCapture, setEnabled, setDescription, getProject, getGroup, setGroup, dependsOn, getAnt, getConvention, hasProperty, getLogging, setActions, getTaskDependencies, getTaskDependencies, getDependsOn, setDependsOn, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, leftShift, deleteAllActions, getEnabled, dependsOnTaskDidWork, getInputs, getOutputs, getOutputs, getTemporaryDir, setProject, getStandardOutputCapture, getAdditionalProperties, getDynamicObjectHelper, setConvention, getAsDynamicObject, addValidator, getValidators, getExecuter, setExecuter, getOnlyIf, injectIntoNewInstance, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll

Methods inherited from class org.gradle.api.internal.AbstractTask
org.gradle.api.internal.AbstractTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.AbstractTask#toString(), org.gradle.api.internal.AbstractTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.AbstractTask#compareTo(java.lang.Object), org.gradle.api.internal.AbstractTask#getName(), org.gradle.api.internal.AbstractTask#getActions(), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#setName(java.lang.String), org.gradle.api.internal.AbstractTask#getPath(), org.gradle.api.internal.AbstractTask#getLogger(), org.gradle.api.internal.AbstractTask#execute(), org.gradle.api.internal.AbstractTask#isEnabled(), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#property(java.lang.String), org.gradle.api.internal.AbstractTask#getDescription(), org.gradle.api.internal.AbstractTask#captureStandardOutput(org.gradle.api.logging.LogLevel), org.gradle.api.internal.AbstractTask#disableStandardOutputCapture(), org.gradle.api.internal.AbstractTask#setEnabled(boolean), org.gradle.api.internal.AbstractTask#setDescription(java.lang.String), org.gradle.api.internal.AbstractTask#getProject(), org.gradle.api.internal.AbstractTask#getGroup(), org.gradle.api.internal.AbstractTask#setGroup(java.lang.String), org.gradle.api.internal.AbstractTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#getAnt(), org.gradle.api.internal.AbstractTask#getConvention(), org.gradle.api.internal.AbstractTask#hasProperty(java.lang.String), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#setActions(java.util.List), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getDependsOn(), org.gradle.api.internal.AbstractTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.AbstractTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setDidWork(boolean), org.gradle.api.internal.AbstractTask#getDidWork(), org.gradle.api.internal.AbstractTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doLast(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doLast(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#deleteAllActions(), org.gradle.api.internal.AbstractTask#getEnabled(), org.gradle.api.internal.AbstractTask#dependsOnTaskDidWork(), org.gradle.api.internal.AbstractTask#getInputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getTemporaryDir(), org.gradle.api.internal.AbstractTask#setProject(org.gradle.api.Project), org.gradle.api.internal.AbstractTask#getStandardOutputCapture(), org.gradle.api.internal.AbstractTask#getAdditionalProperties(), org.gradle.api.internal.AbstractTask#getDynamicObjectHelper(), org.gradle.api.internal.AbstractTask#setConvention(org.gradle.api.plugins.Convention), org.gradle.api.internal.AbstractTask#getAsDynamicObject(), org.gradle.api.internal.AbstractTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.AbstractTask#getValidators(), org.gradle.api.internal.AbstractTask#getExecuter(), org.gradle.api.internal.AbstractTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.AbstractTask#getOnlyIf(), org.gradle.api.internal.AbstractTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.AbstractTask#wait(long), org.gradle.api.internal.AbstractTask#wait(long, int), org.gradle.api.internal.AbstractTask#wait(), org.gradle.api.internal.AbstractTask#equals(java.lang.Object), org.gradle.api.internal.AbstractTask#hashCode(), org.gradle.api.internal.AbstractTask#getClass(), org.gradle.api.internal.AbstractTask#notify(), org.gradle.api.internal.AbstractTask#notifyAll()

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), 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

### projectModel

    EclipseProject projectModel

  model for eclipse project (.project) generation

Constructor Detail

### GenerateEclipseProject

    GenerateEclipseProject()

Method Detail

### buildCommand

    void buildCommand(java.util.Map args, java.lang.String buildCommand)

  Adds a build command with arguments to the eclipse project.
  Parameters:
    `args` - A map with arguments, where the key is the name of the argument and the value the value.
    `buildCommand` - The name of the build command.
  See Also:
    buildCommand(String)

### buildCommand

    void buildCommand(java.lang.String buildCommand)

  Adds a build command to the eclipse project.
  Parameters:
    `buildCommand` - The name of the build command
  See Also:
    buildCommand(Map, String)

### configure

    @Override
    protected void configure(Project project)

### create

    @Override
    protected Project create()

### getBuildCommands

    java.util.List getBuildCommands()

  The build commands to be added to this Eclipse project.

### getComment

    java.lang.String getComment()

  A comment used for the eclipse project

### getLinks

    java.util.Set getLinks()

  The linked resources to be added to this Eclipse project.

### getNatures

    java.util.List getNatures()

  The natures to be added to this Eclipse project.

### getProjectName

    java.lang.String getProjectName()

  Configures eclipse project name. It is optional because the task should configure it correctly for you. By default it will try to use the project.name or prefix it with a part of a project.path to make sure the moduleName is unique in the scope of a multi-module build. The 'uniqeness' of a module name is required for correct import into Eclipse and the task will make sure the name is unique.

  The logic that makes sure project names are uniqe is available since 1.0-milestone-2

  In case you need to override the default projectName this is the way to go:

       apply plugin: 'eclipse'

       eclipseProject {
         projectName = 'some-important-project'
       }

### getReferencedProjects

    java.util.Set getReferencedProjects()

  The referenced projects of this Eclipse project.

### link

    void link(java.util.Map args)

  Adds a link to the eclipse project.
  Parameters:
    `args` - A maps with the args for the link. Legal keys for the map are name, type, location and locationUri.

### natures

    void natures(java.lang.String natures)

  Adds natures entries to the eclipse project.
  Parameters:
    `natures` - the nature names

### referencedProjects

    void referencedProjects(java.lang.String referencedProjects)

  Adds project references to the eclipse project.
  Parameters:
    `referencedProjects` - The name of the project references.

### setBuildCommands

    void setBuildCommands(java.util.List buildCommands)

### setComment

    void setComment(java.lang.String comment)

### setLinks

    void setLinks(java.util.Set links)

### setNatures

    void setNatures(java.util.List natures)

### setProjectName

    void setProjectName(java.lang.String projectName)

### setReferencedProjects

    void setReferencedProjects(java.util.Set referencedProjects)

Groovy Documentation