Browse Source

| 统一依赖版本号

drake 5 years ago
parent
commit
c9aa4bf45d
4 changed files with 54 additions and 52 deletions
  1. 9 3
      build.gradle
  2. 19 19
      net/build.gradle
  3. 25 28
      sample/build.gradle
  4. 1 2
      sample/src/main/java/com/drake/net/sample/Model.kt

+ 9 - 3
build.gradle

@@ -1,7 +1,14 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 
 buildscript {
-    ext.kotlin_version = '1.3.61'
+
+    ext {
+        kotlin_version = '1.3.61'
+        brv_version = '1.2.1'
+        coroutine_version = '1.3.0'
+        glide_version = '4.9.0'
+    }
+
     repositories {
         google()
         jcenter()
@@ -11,8 +18,6 @@ buildscript {
         classpath 'com.android.tools.build:gradle:3.5.3'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
-        // NOTE: Do not place your application dependencies here; they belong
-        // in the individual module build.gradle files
     }
 }
 
@@ -24,6 +29,7 @@ allprojects {
     }
 }
 
+
 task clean(type: Delete) {
     delete rootProject.buildDir
 }

+ 19 - 19
net/build.gradle

@@ -1,10 +1,10 @@
-apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
-apply plugin: 'kotlin-kapt'
+apply plugin: "com.android.library"
+apply plugin: "kotlin-android"
+apply plugin: "kotlin-android-extensions"
+apply plugin: "kotlin-kapt"
 
-apply plugin: 'com.github.dcendents.android-maven'
-group = 'com.gitlab.liangjingkanji'
+apply plugin: "com.github.dcendents.android-maven"
+group = "com.gitlab.liangjingkanji"
 
 android {
     compileSdkVersion 29
@@ -18,34 +18,34 @@ android {
         versionName "1.0"
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
-        consumerProguardFiles 'consumer-rules.pro'
+        consumerProguardFiles "consumer-rules.pro"
     }
 
     buildTypes {
         release {
             minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
         }
     }
 
 }
 
 dependencies {
-    implementation fileTree(dir: 'libs', include: ['*.jar'])
-    implementation 'androidx.appcompat:appcompat:1.1.0'
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+    implementation "androidx.appcompat:appcompat:1.1.0"
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-    testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'androidx.test:runner:1.2.0'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+    testImplementation "junit:junit:4.12"
+    androidTestImplementation "androidx.test:runner:1.2.0"
+    androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
 
-    api 'com.yanzhenjie:okalle:0.1.7'
+    api "com.yanzhenjie:okalle:0.1.7"
+    implementation "com.github.liangjingkanji:Tooltip:1.0.3"
 
-    compileOnly 'com.github.liangjingkanji:BRV:1.2.1'
-    compileOnly 'com.github.bumptech.glide:glide:4.9.0'
+    compileOnly "com.github.liangjingkanji:BRV:$brv_version"
+    compileOnly "com.github.bumptech.glide:glide:$glide_version"
 
-    implementation 'com.github.liangjingkanji:Tooltip:1.0.3'
 
-    compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
-    compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'
+    compileOnly "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
+    compileOnly "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
 
 }

+ 25 - 28
sample/build.gradle

@@ -1,10 +1,10 @@
-apply plugin: 'com.android.application'
+apply plugin: "com.android.application"
 
-apply plugin: 'kotlin-android'
+apply plugin: "kotlin-android"
 
-apply plugin: 'kotlin-android-extensions'
+apply plugin: "kotlin-android-extensions"
 
-apply plugin: 'kotlin-kapt'
+apply plugin: "kotlin-kapt"
 
 android {
     compileSdkVersion 29
@@ -20,42 +20,39 @@ android {
     buildTypes {
         release {
             minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
         }
     }
 
 }
 
 dependencies {
-    implementation fileTree(dir: 'libs', include: ['*.jar'])
+    implementation fileTree(dir: "libs", include: ["*.jar"])
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-    implementation 'androidx.appcompat:appcompat:1.1.0'
-    implementation 'androidx.core:core-ktx:1.1.0'
-    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
-    testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'androidx.test:runner:1.2.0'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
-    implementation project(path: ':net')
+    implementation "androidx.appcompat:appcompat:1.1.0"
+    implementation "androidx.core:core-ktx:1.1.0"
+    implementation "androidx.constraintlayout:constraintlayout:1.1.3"
+    testImplementation "junit:junit:4.12"
+    androidTestImplementation "androidx.test:runner:1.2.0"
+    androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
+    implementation project(path: ":net")
 
-    implementation 'com.squareup.moshi:moshi-kotlin:1.8.0'
-    kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.8.0'
+    implementation "androidx.recyclerview:recyclerview:1.1.0"
+    implementation "com.google.android.material:material:1.0.0"
 
-    implementation 'com.github.liangjingkanji:BRV:1.2.1'
 
-    implementation 'com.scwang.smart:refresh-header-classics:2.0.0-alpha-1'
-    implementation 'com.scwang.smart:refresh-footer-classics:2.0.0-alpha-1'
+    implementation "com.github.liangjingkanji:BRV:$brv_version"
+    implementation "com.github.bumptech.glide:glide:$glide_version"
+    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
+    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
 
-    implementation 'com.github.liangjingkanji:debugkit:1.2.9'
 
-    implementation 'com.github.bumptech.glide:glide:4.9.0'
-
-    implementation 'com.github.liangjingkanji:LogCat:1.0'
-
-    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
-    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'
-
-    implementation 'androidx.recyclerview:recyclerview:1.1.0'
-    implementation 'com.google.android.material:material:1.0.0'
+    implementation "com.squareup.moshi:moshi-kotlin:1.8.0"
+    kapt "com.squareup.moshi:moshi-kotlin-codegen:1.8.0"
 
+    implementation "com.scwang.smart:refresh-header-classics:2.0.0-alpha-1"
+    implementation "com.scwang.smart:refresh-footer-classics:2.0.0-alpha-1"
 
+    implementation "com.github.liangjingkanji:debugkit:1.2.9"
+    implementation "com.github.liangjingkanji:LogCat:1.0"
 }

+ 1 - 2
sample/src/main/java/com/drake/net/sample/Model.kt

@@ -1,4 +1,3 @@
 package com.drake.net.sample
 
-class Model {
-}
+class Model