Last active
June 9, 2017 15:21
-
-
Save dulimarta/86cca9995186e4fb12de97d01297ef9b to your computer and use it in GitHub Desktop.
Gradle productFlavors for Java+Kotline Coexistence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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