2
A
回答
6
專爲一個自定義任務:
// create IDEA run configurations from Gradle JavaExec tasks
task createRunConfigurations {
def runConfigurationsDir = new File(".idea/runConfigurations")
runConfigurationsDir.mkdirs()
tasks.withType(JavaExec).each { task ->
def taskName = task.name
def mainClass = task.main
def props = task.systemProperties.collect { k, v -> "-D$k=$v" }.join(' ')
def args = task.args.join(" ")
def writer = new FileWriter(new File(runConfigurationsDir, "${taskName}.xml"))
def xml = new MarkupBuilder(writer)
xml.component(name: "ProjectRunConfigurationManager") {
configuration(default: 'false', name: taskName, type: "Application", factoryName: "Application", singleton: "true") {
option(name: 'MAIN_CLASS_NAME', value: mainClass)
option(name: 'VM_PARAMETERS', value: props)
option(name: 'PROGRAM_PARAMETERS', value: args)
option(name: 'WORKING_DIRECTORY', value: 'file://$PROJECT_DIR$')
module(name: 'module-name')
}
}
}
}
相關問題
- 1. 隱藏IntelliJ的想法運行配置
- 2. intellij想法運行配置備份
- 3. 存儲android運行/調試配置IntelliJ的想法和svn
- 4. 如何配置pycharm/intellij想法來運行tox測試
- 5. 我如何在intellij想法中運行(配置運行).r文件?
- 6. Intellij 14 gradle無法運行bower命令
- 7. IntelliJ變灰運行配置
- 8. IntelliJ的想法:配置存根
- 9. intellij運行配置取決於gradle任務
- 10. Intellij想法apache-tomcat重寫閥配置
- 11. Intellij想法中缺少Gradle Console
- 12. 在intellij想法上更改已加載的運行配置默認值
- 13. IntelliJ - 設置運行配置(出錯)
- 14. Intellij中的Maven運行/調試配置
- 15. IntelliJ IDEA單一運行調試配置
- 16. Intellij Idea運行/調試配置
- 17. IntelliJ在運行Gradle時出現問題
- 18. 如何使用Intellij IDEA運行gradle?
- 19. 配置的IntelliJ運行的Groovy黃瓜蓋布框架
- 20. IntelliJ/MacOSX - 無法查看耙'運行配置'的形式
- 21. Intellij想法縮進換行
- 22. 在Intellji Junit中配置LogLevel在Gradle項目中運行配置?
- 23. IntelliJ IDEA:將Shell腳本作爲運行/調試配置運行
- 24. IntelliJ從Gradle導入項目後如何運行Gradle任務?
- 25. IntelliJ的想法 - 發現碼頭重複配置?
- 26. 從IntelliJ運行時,如何激活Spring Boot配置文件?
- 27. IntelliJ的想法打開gradle文件夾,而不是項目
- 28. 想法tomcat運行配置找不到spring的xml文件
- 29. 如何將特定的Maven配置文件分配給intellij運行配置?
- 30. 使用IntelliJ IDEA中的命令行程序運行配置
可以配置的IntelliJ運行你想 – djodjo
我知道任何gradle這個任務(S),但是這不是我問。 不方便使用插件,如jprofilier –
它更好地添加您的問題的具體示例,否則其難以幫助 – djodjo