-
-
Save lynnfield/555d17460cc3cdfa17bef03d8eda051b to your computer and use it in GitHub Desktop.
subprojects at build.gradle
This file contains 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
subprojects { project -> | |
afterEvaluate { | |
final boolean isAndroidProject = (project.pluginManager.hasPlugin('com.android.application') || project.pluginManager.hasPlugin('com.android.library')) | |
if (isAndroidProject) { | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
apply plugin: 'kotlin-kapt' | |
android { | |
compileSdkVersion rootProject.ext.compileSdkVersion | |
defaultConfig { | |
minSdkVersion rootProject.ext.minSdkVersion | |
targetSdkVersion rootProject.ext.targetSdkVersion | |
vectorDrawables.useSupportLibrary = true | |
} | |
compileOptions { | |
encoding 'UTF-8' | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
androidExtensions { | |
experimental = true | |
} | |
} | |
} | |
dependencies { | |
if (isAndroidProject) { | |
// android dependencies here | |
} | |
// all subprojects dependencies here | |
} | |
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { | |
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment