Skip to content

Instantly share code, notes, and snippets.

@dulimarta
Last active June 9, 2017 15:21
Show Gist options
  • Save dulimarta/86cca9995186e4fb12de97d01297ef9b to your computer and use it in GitHub Desktop.
Save dulimarta/86cca9995186e4fb12de97d01297ef9b to your computer and use it in GitHub Desktop.
Gradle productFlavors for Java+Kotline Coexistence
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
// other settings not shown
flavorDimensions "lang"
// Four build variants: jvDebug, jvRelease, ktDebug, ktRelease
productFlavors {
// Place both flavors under the same 'dimension'
kt.dimension "lang"
jv.dimension "lang"
}
sourceSets {
kt.java.srcDirs += 'src/kt'
jv.java.srcDirs += 'src/jv'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment