Skip to content

Commit 161f3b5

Browse files
committed
添加kotlin配置,升级targetSDK
1 parent 65b2399 commit 161f3b5

File tree

8 files changed

+101
-29
lines changed

8 files changed

+101
-29
lines changed

app/build.gradle

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
23

34
//获取时间戳
45
def getDate() {
@@ -8,14 +9,14 @@ def getDate() {
89
}
910

1011
android {
11-
compileSdkVersion rootProject.ext.compileSdkVersion
12-
buildToolsVersion rootProject.ext.buildToolsVersion
12+
compileSdkVersion App.compileSdkVersion
13+
buildToolsVersion App.buildToolsVersion
1314
defaultConfig {
14-
applicationId "org.ninetripods.mq.study"
15-
minSdkVersion rootProject.ext.minSdkVersion
16-
targetSdkVersion rootProject.ext.targetSdkVersion
17-
versionCode rootProject.ext.versionCode
18-
versionName rootProject.ext.versionName
15+
applicationId App.appId
16+
minSdkVersion App.minSdkVersion
17+
targetSdkVersion App.targetSdkVersion
18+
versionCode App.versionCode
19+
versionName App.versionName
1920
vectorDrawables.useSupportLibrary = true
2021
buildConfigField "boolean", "IS_SHOW_LOG", "false"
2122
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
@@ -96,10 +97,11 @@ android {
9697
}
9798

9899
dependencies {
99-
implementation 'com.google.android.material:material:1.0.0'
100-
implementation 'androidx.appcompat:appcompat:1.2.0'
101-
implementation 'androidx.recyclerview:recyclerview:1.0.0'
102-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
100+
implementation Deps.kotlinStdlib
101+
implementation Deps.androidx_material
102+
implementation Deps.androidx_appcompat
103+
implementation Deps.androidx_recyclerView
104+
implementation Deps.androidx_constraintLayout
103105
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
104106

105107
//汉字转拼音,通讯录 https://github.com/promeG/TinyPinyin
@@ -108,5 +110,6 @@ dependencies {
108110
implementation 'com.github.promeg:tinypinyin:2.0.3'
109111
implementation 'com.github.promeg:tinypinyin-lexicons-android-cncity:2.0.3'
110112
api project(':lib_dialog')
113+
// implementation 'com.ninetripods:lib-dialog:1.1.0'
111114
implementation fileTree(dir: 'libs', include: ['*.jar'])
112115
}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apply from: 'config.gradle'
22

3-
43
buildscript {
54
repositories {
65
maven {
@@ -14,7 +13,8 @@ buildscript {
1413
}
1514
}
1615
dependencies {
17-
classpath 'com.android.tools.build:gradle:3.6.1'
16+
classpath 'com.android.tools.build:gradle:4.1.2'
17+
classpath Deps.kotlinPlugin
1818
classpath 'com.novoda:bintray-release:0.9.1'
1919
// classpath 'com.fastgo:plugin:1.0-test'
2020
}

buildSrc/build.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repositories {
2+
google()
3+
jcenter()
4+
mavenCentral()
5+
maven {
6+
url = uri("$rootDir/spi_repo")
7+
}
8+
}
9+
10+
allprojects {
11+
repositories {
12+
// mavenCentral()
13+
// google()
14+
// jcenter()
15+
}
16+
}
17+
18+
plugins {
19+
`kotlin-dsl`
20+
}

buildSrc/src/main/java/Deps.kt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import LibsVersion.Companion.appcompat_version
2+
import LibsVersion.Companion.arouter_api_version
3+
import LibsVersion.Companion.arouter_compiler_version
4+
import LibsVersion.Companion.constraintlayout_version
5+
import LibsVersion.Companion.kotlin_version
6+
import LibsVersion.Companion.material_version
7+
import LibsVersion.Companion.recyclerview_version
8+
9+
/**
10+
* Created by mq on 2021/8/22
11+
12+
*/
13+
object App {
14+
const val targetSdkVersion = 30
15+
const val compileSdkVersion = 30
16+
const val buildToolsVersion = "30.0.0"
17+
const val minSdkVersion = 19
18+
const val appId = "org.ninetripods.mq.study"
19+
const val versionCode = 20210506
20+
const val versionName = "1.3.0"
21+
}
22+
23+
object Deps {
24+
//Kotlin
25+
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
26+
const val kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
27+
28+
//AndroidX相关
29+
const val androidx_material = "com.google.android.material:material:$material_version"
30+
const val androidx_appcompat = "androidx.appcompat:appcompat:$appcompat_version"
31+
const val androidx_recyclerView = "androidx.recyclerview:recyclerview:$recyclerview_version"
32+
const val androidx_constraintLayout = "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
33+
34+
//ARouter
35+
const val arouter_api = "com.alibaba:arouter-api:$arouter_api_version"
36+
const val arouter_compiler = "com.alibaba:arouter-compiler:$arouter_compiler_version"
37+
}
38+
39+
internal class LibsVersion {
40+
41+
companion object {
42+
const val kotlin_version = "1.4.32"
43+
const val arouter_api_version = "1.5.1"
44+
const val arouter_compiler_version = "1.5.1"
45+
const val material_version = "1.2.1"
46+
const val appcompat_version = "1.3.0"
47+
const val recyclerview_version = "1.1.0"
48+
const val constraintlayout_version = "1.1.3"
49+
}
50+
}

config.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ext {
2-
compileSdkVersion = 28
3-
buildToolsVersion = '28.0.2'
2+
compileSdkVersion = 30
3+
buildToolsVersion = '30.0.0'
44
minSdkVersion = 16
5-
targetSdkVersion = 28
5+
targetSdkVersion = 30
66
versionCode = 3
77
versionName = "1.3"
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Feb 13 17:22:19 CST 2021
1+
#Sun Aug 22 01:02:22 CST 2021
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip

lib_dialog/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.novoda.bintray-release'//添加
2+
//apply plugin: 'com.novoda.bintray-release'//添加
33

44
android {
55
compileSdkVersion rootProject.ext.compileSdkVersion
@@ -31,11 +31,11 @@ dependencies {
3131
implementation 'androidx.appcompat:appcompat:1.2.0'
3232
}
3333

34-
publish {
35-
userOrg = 'crazyqiang'//bintray.com用户名
36-
groupId = 'com.ninetripods'//jCenter上的路径
37-
artifactId = 'lib-dialog'//项目名称
38-
publishVersion = '1.2.0'//修改版本号
39-
desc = 'a common dialog library'//描述,不重要
40-
website = 'https://github.com/crazyqiang/AndroidStudy/tree/master/sydialoglib'
41-
}
34+
//publish {
35+
// userOrg = 'crazyqiang'//bintray.com用户名
36+
// groupId = 'com.ninetripods'//jCenter上的路径
37+
// artifactId = 'lib-dialog'//项目名称
38+
// publishVersion = '1.2.0'//修改版本号
39+
// desc = 'a common dialog library'//描述,不重要
40+
// website = 'https://github.com/crazyqiang/AndroidStudy/tree/master/sydialoglib'
41+
//}

settings.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
include ':app', ':multiprocess_sever'
22
include ':lib_dialog'
3-
include ':plugin'
4-
//include ':buildSrc'
3+
include ':plugin'

0 commit comments

Comments
 (0)