Hello everyone! I need to create a project with structure like this:
MainProjectDir
├───... // MainProject build dirs and other stuff
│
├───examples // Directory with example projects
│ ├───case1 // example #1
│ │ └───src
│ │ └───main
│ │ ├───java
│ │ └───resources
│ │
│ ├───case2 // example #2
│ │ └───src
│ │ └───main
│ │ ├───java
│ │ └───resources
│ │
│ └─── ... // etc
│
└───src // MainProject src directory
└───main
├───java
└───resources
Example projects depend on MainProject via compile keyword:
dependencies {
compile project(':MainProject')
}
But I need to run the main project in such a way that the subprojects are added to classpath. I know that i can do this with addind dependency in MainProject’s build.gradle but it will lead to circular dependencies. Ho can i add subprojects compiled classes to classpath when run MainProject?
I really hope for your help, because I have been working on this problem for a very long time and I am very tired. Thanks in advance, comrades, and sorry for my english.