Hello I am new to gradle and it is a little bit confusing for me. How should I add a dependency in my gradle configuration to have access to B1.java in projectA1? Project B is gradle project and project A is just a folder with another gradle projects.
Here is my structure:
I tried to read gradle documentation, but it is not clear for me. Any help appreciated. Thanks!
You should have a structure like this:
ProjectA
|--projectA1
|----build.gradle
|--projectA2
|----build.gradle
|--settings.gradle
|--build.gradle
ProjectB
|--projectB1
|----build.gradle
|--projectB2
|----build.gradle
|--settings.gradle
|--build.gradle
You can link an external module in your project.
1) In your project projectA/settings.gradle
include ':projectA1',':projectA2',':projectB1'
project(':projectB1').projectDir = new File("/workspace/projectB/projectB1")
2) Add dependency in build.gradle
of projectA1
module
dependencies {
compile project(':projectB1')
}