# IdeaProject

abstract class IdeaProject : IdeWorkspace

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.*

    plugins {
        id 'java'
        id '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(':some-project').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")])
      }
    }

Content copied to clipboard
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:

    plugins {
        id 'java'
        id '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
          }
        }
      }
    }

Content copied to clipboard

## Constructors

IdeaProject
Link copied to clipboard
@Inject
constructor(project: Project, ipr: XmlFileContentMerger)

## Properties

ipr
Link copied to clipboard
val ipr: XmlFileContentMerger
jdkName
Link copied to clipboard
open var jdkName: String
modules
Link copied to clipboard
open var modules: List<IdeaModule>
pathFactory
Link copied to clipboard
open var pathFactory: PathFactory
project
Link copied to clipboard
val project: Project
projectLibraries
Link copied to clipboard
open var projectLibraries: Set<ProjectLibrary>
vcs
Link copied to clipboard
open var vcs: String
wildcards
Link copied to clipboard
open var wildcards: Set<String>

## Functions

getDisplayName
Link copied to clipboard
open fun getDisplayName(): String
getLanguageLevel
Link copied to clipboard
open fun getLanguageLevel(): IdeaLanguageLevel
The default Java language Level to use for this project.
getLocation
Link copied to clipboard
open fun getLocation(): Provider<RegularFile>
getName
Link copied to clipboard
open fun getName(): String
The name of the IDEA project.
getOutputFile
Link copied to clipboard
open fun getOutputFile(): File
Output *.
getTargetBytecodeVersion
Link copied to clipboard
open fun getTargetBytecodeVersion(): JavaVersion
The target bytecode version to use for this project.
ipr
Link copied to clipboard
open fun ipr(@DelegatesTo(value = XmlFileContentMerger::class) closure: Closure)
open fun ipr(action: Action<in XmlFileContentMerger>)
Enables advanced configuration like tinkering with the output XML or affecting the way existing *.ipr content is merged with Gradle build information.
mergeXmlProject
Link copied to clipboard
open fun mergeXmlProject(xmlProject: Project)
setLanguageLevel
Link copied to clipboard
open fun setLanguageLevel(languageLevel: Any)
open fun setLanguageLevel(languageLevel: IdeaLanguageLevel)
Sets the java language level for the project.
setOutputFile
Link copied to clipboard
open fun setOutputFile(outputFile: File)
setTargetBytecodeVersion
Link copied to clipboard
open fun setTargetBytecodeVersion(targetBytecodeVersion: JavaVersion)