Groovy Documentation

org.gradle.plugins.ide.idea
[Groovy] Class GenerateIdeaModule

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.idea.GenerateIdeaModule

class GenerateIdeaModule
extends XmlGeneratorTask

Generates an IDEA module file. If you want to fine tune the idea configuration

Please refer to interesting examples on idea configuration in IdeaModule.

At this moment nearly all configuration is done via IdeaModule.

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
 
Property Summary
IdeaModule module

Idea module model

 
Method Summary
protected void configure(Module xmlModule)

protected Module create()

boolean getDownloadJavadoc()

Deprecated.

boolean getDownloadSources()

Deprecated.

java.util.Set getExcludeDirs()

Deprecated.

java.lang.Boolean getInheritOutputDirs()

Deprecated.

java.lang.String getJavaVersion()

Deprecated.

java.io.File getModuleDir()

Deprecated.

java.lang.String getModuleName()

Deprecated.

java.io.File getOutputDir()

Deprecated.

java.io.File getOutputFile()

Configures output *.iml file.

java.util.Map getScopes()

Deprecated.

java.util.Set getSourceDirs()

Deprecated.

java.io.File getTestOutputDir()

Deprecated.

java.util.Set getTestSourceDirs()

Deprecated.

java.util.Map getVariables()

Deprecated.

void setDownloadJavadoc(boolean downloadJavadoc)

void setDownloadSources(boolean downloadSources)

void setExcludeDirs(java.util.Set excludeDirs)

void setInheritOutputDirs(java.lang.Boolean inheritOutputDirs)

void setJavaVersion(java.lang.String jdkName)

void setModuleDir(java.io.File contentRoot)

void setModuleName(java.lang.String moduleName)

void setOutputDir(java.io.File outputDir)

void setOutputFile(java.io.File newOutputFile)

void setScopes(java.util.Map scopes)

void setSourceDirs(java.util.Set sourceDirs)

void setTestOutputDir(java.io.File testOutputDir)

void setTestSourceDirs(java.util.Set testSourceDirs)

void setVariables(java.util.Map variables)

 
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#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#isEnabled(), 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#property(java.lang.String), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getProject(), 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#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), 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#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#getAdditionalProperties(), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#executeWithoutThrowingTaskFailure(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#getDynamicObjectHelper(), 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#getTemporaryDirFactory(), 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(), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(long, int), 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()
 

Property Detail

module

IdeaModule module
Idea module model


 
Method Detail

configure

@Override
protected void configure(Module xmlModule)


create

@Override
protected Module create()


getDownloadJavadoc

@Deprecated
boolean getDownloadJavadoc()
Deprecated. Please use #idea.module.downloadJavadoc. See examples in IdeaModule.

Whether to download and add javadoc associated with the dependency jars.


getDownloadSources

@Deprecated
boolean getDownloadSources()
Deprecated. Please use #idea.module.downloadSources. See examples in IdeaModule.

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


getExcludeDirs

@Deprecated
java.util.Set getExcludeDirs()
Deprecated. Please use #idea.module.excludeDirs. See examples in IdeaModule.

The directories to be excluded.


getInheritOutputDirs

@Deprecated
java.lang.Boolean getInheritOutputDirs()
Deprecated. Please use #idea.module.inheritOutputDirs. See examples in IdeaModule.

If true, output directories for this module will be located below the output directory for the project; otherwise, they will be set to the directories specified by #outputDir and #testOutputDir.


getJavaVersion

@Deprecated
java.lang.String getJavaVersion()
Deprecated. Please use #idea.module.jdkName. See examples in IdeaModule.

The JDK to use for this module. If null, the value of the existing or default ipr XML (inherited) is used. If it is set to inherited, the project SDK is used. Otherwise the SDK for the corresponding value of java version is used for this module


getModuleDir

@Deprecated
java.io.File getModuleDir()
Deprecated. Please use #idea.module.contentRoot. See examples in IdeaModule.

The content root directory of the module.


getModuleName

@Deprecated
java.lang.String getModuleName()
Deprecated. Please use #idea.module.name. See examples in IdeaModule.

Configures module name. It's 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 IntelliJ IDEA and the task will make sure the name is unique. See example below...

moduleName is a synthethic property that actually modifies the outputFile property value. This means that you should not configure both moduleName and outputFile at the same time. moduleName is recommended.

However, in case you really need to override the default moduleName this is the way to go:

 apply plugin: 'idea'

 ideaModule {
   moduleName = 'some-important-project'
 }
 

since 1.0-milestone-2


getOutputDir

@Deprecated
java.io.File getOutputDir()
Deprecated. Please use #idea.module.outputDir. See examples in IdeaModule.

The output directory for production classes. If null, no entry will be created.


getOutputFile

java.io.File getOutputFile()
Configures output *.iml file. It's optional because the task should configure it correctly for you (including making sure it is unique in the multi-module build). If you really need to change the output file name it is much easier to do it via the idea.module.name property.

Please refer to documentation in IdeaModule name property. In IntelliJ IDEA the module name is the same as the name of the *.iml file.


getScopes

@Deprecated
java.util.Map getScopes()
Deprecated. Please use #idea.module.scopes. See examples in IdeaModule.

The keys of this map are the IDEA scopes. Each key points to another map that has two keys, plus and minus. The values of those keys are collections of Configuration objects. The files of the plus configurations are added minus the files from the minus configurations. See example below...

Example how to use scopes property to enable 'provided' dependencies in the output *.iml file:

 apply plugin: 'java'
 apply plugin: 'idea'

 configurations {
   provided
   provided.extendsFrom(compile)
 }

 dependencies {
   //provided "some.interesting:dependency:1.0"
 }

 ideaModule {
   scopes.PROVIDED.plus += configurations.provided
 }
 


getSourceDirs

@Deprecated
java.util.Set getSourceDirs()
Deprecated. Please use #idea.module.sourceDirs. See examples in IdeaModule.

The directories containing the production sources.


getTestOutputDir

@Deprecated
java.io.File getTestOutputDir()
Deprecated. Please use #idea.module.testOutputDir. See examples in IdeaModule.

The output directory for test classes. If null, no entry will be created.


getTestSourceDirs

@Deprecated
java.util.Set getTestSourceDirs()
Deprecated. Please use #idea.module.testSourceDirs. See examples in IdeaModule.

The directories containing the test sources.


getVariables

@Deprecated
java.util.Map getVariables()
Deprecated. Please use #idea.pathVariables. See examples in IdeaModule.

The variables to be used for replacing absolute paths in the iml entries. For example, you might add a GRADLE_USER_HOME variable to point to the Gradle user home dir.


setDownloadJavadoc

@Deprecated
void setDownloadJavadoc(boolean downloadJavadoc)


setDownloadSources

@Deprecated
void setDownloadSources(boolean downloadSources)


setExcludeDirs

@Deprecated
void setExcludeDirs(java.util.Set excludeDirs)


setInheritOutputDirs

@Deprecated
void setInheritOutputDirs(java.lang.Boolean inheritOutputDirs)


setJavaVersion

@Deprecated
void setJavaVersion(java.lang.String jdkName)


setModuleDir

@Deprecated
void setModuleDir(java.io.File contentRoot)


setModuleName

@Deprecated
void setModuleName(java.lang.String moduleName)


setOutputDir

@Deprecated
void setOutputDir(java.io.File outputDir)


setOutputFile

void setOutputFile(java.io.File newOutputFile)


setScopes

@Deprecated
void setScopes(java.util.Map scopes)


setSourceDirs

@Deprecated
void setSourceDirs(java.util.Set sourceDirs)


setTestOutputDir

@Deprecated
void setTestOutputDir(java.io.File testOutputDir)


setTestSourceDirs

@Deprecated
void setTestSourceDirs(java.util.Set testSourceDirs)


setVariables

@Deprecated
void setVariables(java.util.Map variables)


 

Groovy Documentation