From d52b84ef842a36e27a6e4b551f5e058cc619fe1f Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Mon, 19 Oct 2020 00:16:18 +0800 Subject: [PATCH] add kotlin library add kotlin library --- app/build.gradle | 13 +++++++++++-- build.gradle | 3 ++- gradle.properties | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2a7d1a0..0ac633a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-android' android { compileSdkVersion rootProject.ext.compileSdkVersion @@ -41,8 +43,12 @@ android { useLibrary "org.apache.http.legacy" compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + packagingOptions { + exclude 'META-INF/proguard/coroutines.pro' } } @@ -52,4 +58,7 @@ dependencies { implementation "androidx.recyclerview:recyclerview:$rootProject.recyclerviewVersion" testImplementation 'junit:junit:4.12' implementation project(':Live') + implementation "androidx.core:core-ktx:$rootProject.core_ktx" + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycle_ktx" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/build.gradle b/build.gradle index 6ddeb0f..43865c2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlin_version = '1.3.50' repositories { jcenter() maven { @@ -10,7 +11,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.0' - + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/gradle.properties b/gradle.properties index 2fd727c..6e33d5c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,6 @@ recyclerviewVersion=1.1.0-rc01 preferenceVersion=1.1.0 annotationVersion=1.1.0 ottoVersion=1.3.8 -ijkVersion=0.8.8 \ No newline at end of file +ijkVersion=0.8.8 +core_ktx=1.3.2 +lifecycle_ktx=2.2.0 \ No newline at end of file