Eclipse and IDEA plugin in the same script? Gradle?

I am trying to understand how Gradle applies IDE plugins. If I wanted a build.gradle

script that hosted both Eclipse and IDEA, can I declare both plugins in the script? Will it try to create metadata for both? Or is the Gradle IDE implementation running to pick the right one?

apply plugin: 'eclipse'
apply plugin: 'idea'

      

I just want to make sure that when I put any project source files into the GIT repository with the build.gradle

script, the import and build experience will be good for these IDEs.

+3


source to share


2 answers


Applying the eclipse plugin just adds eclipse tasks to the build, allowing you to create an eclipse project from a gradle project.

Applying the idea plugin simply adds the task tasks to the build, allowing you to generate an IDEA project from a gradle project.



I see no reason why you couldn't do both.

+2


source


Just adding plugins to your file build.gradle

does nothing until you run one or more tasks that insert those plugins. It won't generate metadata for the IDE until you run certain tasks.

For a list of tasks added by each plugin, see the following links:



ref:
http://gradle.org/docs/current/userguide/idea_plugin.html
http://gradle.org/docs/current/userguide/eclipse_plugin.html

+1


source







All Articles