I have an Eclipse workspace that looks like this:
workspace/
ProjectA/
src/
ProjectThatDependsOnA/
src/
In Eclipse, I can go into the Project Properties and edit the java build path of ProjectThatDependsOnA to include "ProjectA". What should I put in my build.gradle in ProjectThatDependsOnA to replicate this behavior in Gradle?
The Gradle eclipse plugin generates the required files that are used by Eclipse IDE. Therefore, it helps to create and import the project in Eclipse.
A multi-project build in Gradle consists of one root project, and one or more subprojects. A basic multi-project build contains a root project and a single subproject. This is a structure of a multi-project build that contains a single subproject called app : Example 1. Basic multi-project build.
The java build path can be seen and modified by using the Java Build Path page of the Java Project properties dialog. To bring up the Java Project properties dialog box, right click on a Java Project in the Package Explorer view and select the Properties menu item. On the left hand side tree select Java Build Path.
Eclipse Gradle support It is available on Buildship on Github. The tooling provides wizards for creating new Java based Gradle projects and options to execute Gradle build from the IDE.
Found the answer to my own question: settings.gradle in ProjectThatDependsOnA should have the line:
includeFlat 'ProjectA'
and then build.gradle should have:
compile project(':ProjectA')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With