Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the gradle equivalent of having another project in your Java build path in Eclipse?

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?

like image 300
Thomas Johnson Avatar asked Dec 17 '11 20:12

Thomas Johnson


People also ask

What is Gradle project in Eclipse?

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.

What is multi project build in Gradle?

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.

What is the build path in Eclipse?

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.

Does Eclipse have Gradle?

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.


1 Answers

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')
like image 182
Thomas Johnson Avatar answered Oct 06 '22 00:10

Thomas Johnson