简体   繁体   English

如何使用gradle idea任务设置Intellij的默认设置?

[英]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.

相关问题 IntelliJ IDEA + Gradle-如何记录从IDE运行的长时间运行的Gradle任务? - IntelliJ IDEA + Gradle - How can I log a long running Gradle task run from the IDE? 如何在 IntelliJ IDEA 13 gradle 任务中设置系统属性? - How to set system properties in IntelliJ IDEA 13 gradle task? 如何以编程方式在intellij idea中设置全局gradle设置(gradle vm选项)? - How to set global gradle settings (gradle vm options) in intellij idea programmatically? 我如何使用Gradle的CreateStartScripts任务 - How can I use Gradle's CreateStartScripts Task 如何在 Intellij IDEA 中使用 gradle run? - How to use gradle run with Intellij IDEA? 如何在IntelliJ IDEA插件项目中使用Gradle? - How to use gradle in intellij idea plugin project? 如何在 gradle、intellij IDEA 中使用 JPA 元模型? - How to use JPA metamodel with gradle, intellij IDEA? 如何修复“任务 'compileJava' 执行失败”错误。 (使用 Intellij Idea 和 Gradle) - How do I fix “Execution failed for task 'compileJava'” error. (Using Intellij Idea and Gradle) 如何在 Intellij Idea 中的项目导入期间执行 gradle 任务 - How to execute gradle task during project import in Intellij Idea IntelliJ IDEA:如何使用 --args 运行 gradle 应用程序插件运行任务 - IntelliJ IDEA: How to run gradle application plugin run task with --args
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM