E.D.
E.D.

Reputation: 667

How can I use the gradle idea task to set Intellij's default settings?

How can I use the gradle idea task to set values in Intellij's default.xml file?

Background: I'm creating a tool to reconfigure Intellij, and some users will be using the IDE's global configuration, and other will be using the project's configuration, so I need to change both of them. The global configuration is stored in the default.xml file, and the project settings are stored in the projects ipr file.

I can make the necessary changes to the ipr file, but not the default.xml file.

Upvotes: 1

Views: 1013

Answers (1)

Eduard Wirch
Eduard Wirch

Reputation: 9912

There is a plugin which generates IDEA project configuration and allows you to modify it Gradle IDEA Plugin.

Set JDK and language level:

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

 idea {
   project {
     jdkName = '1.6'
     languageLevel = '1.5'
   }
 } 

The project files will be generated, when you run the idea task: gradle idea.

The only one catch: the plugin does not support the IDEA directory based project configuration layout, only the file based.

Upvotes: 2

Related Questions