将Gradle支持添加到IntelliJ Project的最佳方法 [英] Best way to add Gradle support to IntelliJ Project

查看:107
本文介绍了将Gradle支持添加到IntelliJ Project的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查了很多,并没有找到将现有的IntelliJ项目转换为Gradle的最佳解决方案。我在团队环境中工作,我们目前共享.ipr文件,因为我们有一些跟踪的构建配置。我们将最终摆脱那些赞成Gradle的人,但是我不能把事情搞得太多,直到Gradle转换完成。

另外,我们的Java源文件位于src目录的根目录,而不是标准的src / main / java。



有没有办法将Gradle添加到我的项目中让我删除并重新创建我的IntelliJ项目,并且在他们执行Git pull时不会让所有人都陷入困境?

为什么不要你只需要添加:

  build.gradle 

放入您的根项目文件夹中,然后使用插件:

  apply plugin :'idea'
//和标准
应用插件:'java'



<

  gradle cleanIdea 
p $ p
$ b $ p

之后:

  gradle idea 

之后,一切都应该工作

I have looked around quite a bit and haven't found the best solution to convert an existing IntelliJ project to Gradle. I work in a team environment and we currently share the .ipr file as we have a few build configurations that we track. We will be getting rid of those in favor of Gradle eventually but I can't screw things up too much until the Gradle conversion is done.

Also, our Java source files are located in the root of the src directory instead of src/main/java as is standard.

Is there a way I can add Gradle to my project that won't make me delete and recreate my IntelliJ project and won't screw everyone else up when they do a Git pull?

解决方案

Why don't you just add:

build.gradle 

in your root project folder, and use plugin for example:

apply plugin: 'idea'
//and standard one
apply plugin: 'java'

and with this fire from command line:

gradle cleanIdea 

and after that:

gradle idea

After that everything should work

这篇关于将Gradle支持添加到IntelliJ Project的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆