Package: org.gradle.plugins.ide.idea.model

## [Java] Class IdeaProject

- org.gradle.plugins.ide.idea.model.IdeaProject

- Enables fine-tuning project details (*.ipr file) of the IDEA plugin.

  Example of use with a blend of all possible properties. Typically you don't have to configure IDEA module directly because Gradle configures it for you.

       import org.gradle.plugins.ide.idea.model.*

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

       idea {
         project {
           //if you want to set specific jdk and language level
           jdkName = '1.6'
           languageLevel = '1.5'

           //you can update the source wildcards
           wildcards += '!?*.ruby'

           //you can configure the VCS used by the project
           vcs = 'Git'

           //you can change the modules of the *.ipr
           //modules = project(':someProject').idea.module

           //you can change the output file
           outputFile = new File(outputFile.parentFile, 'someBetterName.ipr')

           //you can add project-level libraries
           projectLibraries << new ProjectLibrary(name: "my-library", classes: [new File("path/to/library")])
         }
       }

  For tackling edge cases users can perform advanced configuration on resulting XML file. It is also possible to affect the way IDEA plugin merges the existing configuration via beforeMerged and whenMerged closures.

  beforeMerged and whenMerged closures receive Project object

  Examples of advanced configuration:

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

       idea {
         project {
           ipr {
             //you can tinker with the output *.ipr file before it's written out
             withXml {
               def node = it.asNode()
               node.appendNode('iLove', 'tinkering with the output *.ipr file!')
             }

             //closure executed after *.ipr content is loaded from existing file
             //but before gradle build information is merged
             beforeMerged { project ->
               //you can tinker with Project
             }

             //closure executed after *.ipr content is loaded from existing file
             //and after gradle build information is merged
             whenMerged { project ->
               //you can tinker with Project
             }
           }
         }
       }

- - ### Constructor Summary

    Constructors
    Constructor and description
    `IdeaProject (Project project, XmlFileContentMerger ipr)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `XmlFileContentMerger` | `getIpr()` See ipr(Closure)
    `String` | `getJdkName()` The java version used for defining the project sdk.
    `IdeaLanguageLevel` | `getLanguageLevel()` The default Java language Level to use for this project.
    `List<IdeaModule>` | `getModules()` A ConventionProperty that holds modules for the ipr file.
    `String` | `getName()` The name of the IDEA project.
    `File` | `getOutputFile()` Output *.ipr
    `PathFactory` | `getPathFactory()`
    `Project` | `getProject()` An owner of this IDEA project.
    `Set<ProjectLibrary>` | `getProjectLibraries()` The project-level libraries to be added to the IDEA project.
    `JavaVersion` | `getTargetBytecodeVersion()` The target bytecode version to use for this project.
    `String` | `getVcs()` The vcs for the project.
    `Set<String>` | `getWildcards()` The wildcard resource patterns.
    `void` | `ipr(groovy.lang.Closure<XmlFileContentMerger> closure)` Enables advanced configuration like tinkering with the output XML or affecting the way existing *.ipr content is merged with Gradle build information.
    `void` | `mergeXmlProject(Project xmlProject)`
    `void` | `setJdkName(String jdkName)`
    `void` | `setLanguageLevel(Object languageLevel)` Sets the java language level for the project.
    `void` | `setModules(List<IdeaModule> modules)`
    `void` | `setOutputFile(File outputFile)`
    `void` | `setPathFactory(PathFactory pathFactory)`
    `void` | `setProjectLibraries(Set<ProjectLibrary> projectLibraries)`
    `void` | `setTargetBytecodeVersion(JavaVersion targetBytecodeVersion)`
    `void` | `setVcs(String vcs)`
    `void` | `setWildcards(Set<String> wildcards)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class groovy.lang.GroovyObjectSupport` | `groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### public IdeaProject(Project project, XmlFileContentMerger ipr)

  - ### Method Detail

    - #### public XmlFileContentMerger getIpr()

      See ipr(Closure)

    - #### public String getJdkName()

      The java version used for defining the project sdk.

      See the examples in the docs for IdeaProject

    - #### public IdeaLanguageLevel getLanguageLevel()

      The default Java language Level to use for this project.

      Generally, it isn't recommended to change this value. Instead, you are encouraged to set `sourceCompatibility` and `targetCompatibility` for your Gradle projects which allows you to have full control over language levels in Gradle projects, and means that Gradle and IDEA will use the same settings when compiling.

      When not explicitly set, this is calculated as the maximum language level for the Idea modules of this Idea project.

    - #### public List<IdeaModule> getModules()

      A ConventionProperty that holds modules for the ipr file.

      See the examples in the docs for IdeaProject

    - #### public String getName()

      The name of the IDEA project. It is a convenience property that returns the name of the output file (without the file extension). In IDEA, the project name is driven by the name of the 'ipr' file.

    - #### public File getOutputFile()

      Output *.ipr

      See the examples in the docs for IdeaProject.

    - #### public PathFactory getPathFactory()

    - #### public Project getProject()

      An owner of this IDEA project.

      If IdeaProject requires some information from gradle this field should not be used for this purpose.

    - #### @Incubating public Set<ProjectLibrary> getProjectLibraries()

      The project-level libraries to be added to the IDEA project.

    - #### @Incubating public JavaVersion getTargetBytecodeVersion()

      The target bytecode version to use for this project.

      Generally, it isn't recommended to change this value. Instead, you are encouraged to set `sourceCompatibility` and `targetCompatibility` for your Gradle projects which allows you to have full control over language levels in Gradle projects, and means that Gradle and IDEA will use the same settings when compiling.

      When `languageLevel` is not explicitly set, this is calculated as the maximum target bytecode version for the Idea modules of this Idea project.

    - #### @Incubating public String getVcs()

      The vcs for the project.

      Values are the same as used in IDEA's “Version Control” preference window (e.g. 'Git', 'Subversion').

      See the examples in the docs for IdeaProject.

    - #### public Set<String> getWildcards()

      The wildcard resource patterns.

      See the examples in the docs for IdeaProject.

    - #### public void ipr(groovy.lang.Closure<XmlFileContentMerger> closure)

      Enables advanced configuration like tinkering with the output XML or affecting the way existing *.ipr content is merged with Gradle build information.

      See the examples in the docs for IdeaProject

    - #### public void mergeXmlProject(Project xmlProject)

    - #### public void setJdkName(String jdkName)

    - #### public void setLanguageLevel(Object languageLevel)

      Sets the java language level for the project. Pass a valid Java version number (e.g. '1.5') or IDEA language level (e.g. 'JDK_1_5').

      See the examples in the docs for IdeaProject.

      When explicitly set in the build script, this setting overrides any calculated values for Idea project and Idea module.

    - #### public void setModules(List<IdeaModule> modules)

    - #### public void setOutputFile(File outputFile)

    - #### public void setPathFactory(PathFactory pathFactory)

    - #### @Incubating public void setProjectLibraries(Set<ProjectLibrary> projectLibraries)

    - #### @Incubating public void setTargetBytecodeVersion(JavaVersion targetBytecodeVersion)

    - #### @Incubating public void setVcs(String vcs)

    - #### public void setWildcards(Set<String> wildcards)