variant filter affects an input (commonSourceSet) of KotlinCompile task
// root build.gradle
subprojects { project ->
project.plugins.withId('com.android.application') {
boolean ide = System.getProperty('idea.platform.prefix') != null
if (ide) {
android {
variantFilter { variant ->
variant.ignore = variant.buildType.name != 'debug'
}
}
}
}
}
- Build the project using cmd
./gradlew app:assembleDebug // 28 actionable tasks: 28 executed
- Clean
./gradlew clean
- Build the project in Android Studio
28 actionable tasks: 3 executed, 25 from cache
28 actionable tasks: 4 executed, 24 from cache