Skip to content

Instantly share code, notes, and snippets.

@Stickerbox
Created January 2, 2018 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stickerbox/4b6641bb1ddd8aa8495d8607e6ce35b8 to your computer and use it in GitHub Desktop.
Save Stickerbox/4b6641bb1ddd8aa8495d8607e6ce35b8 to your computer and use it in GitHub Desktop.
ext.internalProject = { code ->
dependencies {
implementation project(":$code")
}
}
ext.exposedProject = { code ->
dependencies {
api project(":$code")
}
}
ext.internalLib = { codes ->
dependencies {
codes.each {
if (it.startsWith("#")) {
compileOnly it.substring(1)
} else if (it.startsWith("*")) {
kapt it.substring(1)
} else {
implementation it
}
}
}
}
ext.exposedLib = { codes ->
dependencies {
codes.each {
if (it.startsWith("#")) {
compileOnly it.substring(1)
} else if (it.startsWith("*")) {
kapt it.substring(1)
} else {
api it
}
}
}
}
ext.test = { codes ->
dependencies {
codes.each {
if (it.startsWith("*")) {
kaptTest it.substring(1)
} else {
testImplementation it
}
}
}
}
ext.androidTest = { codes ->
dependencies {
codes.each {
if (it.startsWith("*")) {
kaptAndroidTest it.substring(1)
} else {
androidTestImplementation it
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment