I don’t know how common this situation is but here’s what worked for me. The question is: Is this sane, or is there a better way?
tl;dr:
dependencies {
// remove trailing ':Lib'
ppath = project.path
ppath = ppath.substring(0, ppath.length() - 4)
compile project(ppath + ":jsoup:Lib")
}
Main project OpenKeychain (https://github.com/open-keychain/open-keychain)
|-Git submodule KeybaseLib (https://github.com/timbray/KeybaseLib)
|- Git submodule jsoup (https://github.com/timbray/jsoup)
Directory structure is set up for Android Studio & Gradle, for all three projects. This means that there’s an idiosyncratically-named directory under the project root (I like to use “Lib” for library type projects), and source starts at root/Lib/src/main/...
open-keychain
|- settings.gradle [1]
|- OpenKeychain
|- build.gradle [2]
|- extern
|- KeybaseLib
|- settings.gradle [3]
|- Lib
|- build.gradle [4]
|- jsoup
OK, the problem is, what goes in [1], [2], [3], and [4] so that I can gradle-build KeybaseLib & also jsoup both from the open-keychain root and the KeybaseLib root?
[1]
include ':extern:KeybaseLib:Lib'
include ':extern:KeybaseLib:jsoup:Lib'
[2]
dependencies {
compile project(':extern:KeybaseLib:Lib')
...
}
[3]
include 'Lib'
include ':jsoup:Lib'
[4]
dependencies {
// remove trailing ':Lib'
ppath = project.path
ppath = ppath.substring(0, ppath.length() - 4)
compile project(ppath + ":jsoup:Lib")
}