Movatterモバイル変換


[0]ホーム

URL:


IdeaProject

Table of Contents

Properties
Methods
Script blocks
Property details
Method details
Script block details
API Documentation: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.*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")])  }}

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 configurationvia beforeMerged and whenMerged closures.

beforeMerged and whenMerged closures receiveProject 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      }    }  }}

Properties

PropertyDescription
ipr

SeeIdeaProject.ipr(org.gradle.api.Action)

jdkName

The java version used for defining the project sdk.

languageLevel

The default Java language Level to use for this project.

modules

Modules for the ipr file.

outputFile

Output *.ipr

projectLibraries

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

targetBytecodeVersion

The target bytecode version to use for this project.

vcs

The vcs for the project.

wildcards

The wildcard resource patterns.

Methods

MethodDescription
ipr(action)

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

Script blocks

BlockDescription
ipr

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

Property details

XmlFileContentMergeripr (read-only)

SeeIdeaProject.ipr(org.gradle.api.Action)

StringjdkName

The java version used for defining the project sdk.

See the examples in the docs forIdeaProject

Default withidea plugin:
Java version used to run Gradle, for example'1.6'
Default withidea andjava plugin:
Java version used to run Gradle, for example'1.6'

IdeaLanguageLevellanguageLevel

The default Java language Level to use for this project.

Generally, it isn't recommended to change this value. Instead, you are encouraged to setsourceCompatibility andtargetCompatibilityfor 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 samesettings when compiling.

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

Default withidea plugin:
JavaVersion.JAVA_1_6
Default withidea andjava plugin:
project.sourceCompatibility

Modules for the ipr file.

See the examples in the docs forIdeaProject

Default withidea plugin:
project.allprojects.idea.module

FileoutputFile

Output *.ipr

See the examples in the docs forIdeaProject.

Default withidea plugin:
${project.projectDir}/${project.name}.ipr

Set<ProjectLibrary>projectLibraries

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

Default withidea plugin:
[] ([scala-library] withscala-base plugin)
Default withidea andjava plugin:
[] ([scala-library] withscala-base plugin)

JavaVersiontargetBytecodeVersion

The target bytecode version to use for this project.

Generally, it isn't recommended to change this value. Instead, you are encouraged to setsourceCompatibility andtargetCompatibilityfor 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 samesettings when compiling.

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

Default withidea plugin:
JavaVersion.JAVA_1_6
Default withidea andjava plugin:
Highestproject.targetCompatibility value of all java subprojects orJavaVersion.JAVA_1_6 if no java project found.

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

Set<String>wildcards

The wildcard resource patterns.

See the examples in the docs forIdeaProject.

Default withidea plugin:
['!?*.java', '!?*.groovy']

Method details

voidipr(Action<? superXmlFileContentMerger> action)

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

See the examples in the docs forIdeaProject

Script block details

ipr { }

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

See the examples in the docs forIdeaProject

Delegates to:
XmlFileContentMerger fromipr

[8]ページ先頭

©2009-2025 Movatter.jp