git - Gradle: Can I place one root project within another? -
question: can following or lead problems?
myandroidgradleproject |-- settings.gradle |-- build.gradle |-- app | +-- build.gradle +-- somelibraryandroidgradleproject |-- settings.gradle // root project within root project! |-- build.gradle |-- app | +-- build.gradle +-- library +-- build.gradle where myandroidgradleproject/settings.gradle looks this:
include ':app' include ':library' project(':library').projectdir = new file('./somelibraryandroidgradleproject/library') as far can tell, seems fine, don't want run problems later on... can confirm fits gradle's design?
why that?
the reason directory structure want have somelibraryandroidgradleproject git submodule within git repository of myandroidgradleproject. have both projects sitting side side in same parent directory this
androidstudioprojects |-- myandroidgradleproject +-- somelibraryandroidgradleproject but way of course cannot have 1 submodule of other. of course have third git repository in common parent folder has both other repositories submodules seems both overly complicated , semantically wrong.
based on structure, removed second settings.gradle:
myandroidgradleproject |-- settings.gradle |-- build.gradle |-- app | +-- build.gradle +-- somelibraryandroidgradleproject |-- app | +-- build.gradle +-- library +-- build.gradle settings.gradle
rootproject.name = "myandroidgradleproject" include ":app" include ":somelibraryandroidgradleproject" include ":somelibraryandroidgradleproject:app" include ":somelibraryandroidgradleproject:library" build.gradle
// apply common plugins here
app/build.gradle
apply plugin: "com.android.application" somelibraryandroidgradleproject
a build.gradle , settings.gradle not needed here
somelibraryandroidgradleproject/app/build.gradle
apply plugin: "com.android.application" dependencies { compile project(":somelibraryandroidgradleproject:library") } somelibraryandroidgradleproject/app/build.gradle
apply plugin: "com.android.library" this setup allow have , compile 2 different apps in same git repo. ideally when compiling, want compile 1 @ time, make sure select tasks accordingly.
Comments
Post a Comment