[英]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? 如何使用gradle idea任务在Intellij的default.xml文件中设置值?
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. 背景:我正在创建一个用于重新配置Intellij的工具,有些用户将使用IDE的全局配置,而另一些用户将使用项目的配置,因此我需要同时更改它们。 The global configuration is stored in the default.xml file, and the project settings are stored in the projects ipr file.
全局配置存储在default.xml文件中,项目设置存储在项目ipr文件中。
I can make the necessary changes to the ipr file, but not the default.xml file. 我可以对ipr文件进行必要的更改,但不能对default.xml文件进行更改。
There is a plugin which generates IDEA project configuration and allows you to modify it Gradle IDEA Plugin . 有一个插件可以生成IDEA项目配置,并允许您修改它Gradle IDEA插件 。
Set JDK and language level: 设置JDK和语言级别:
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
. 当您运行
idea
任务: gradle idea
时,将生成项目文件。
The only one catch: the plugin does not support the IDEA directory based project configuration layout , only the file based. 唯一的问题:该插件不支持基于IDEA目录的项目配置布局 ,仅基于文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.