1
- apply plugin : ' com.android.application'
2
- apply plugin : ' kotlin-android'
3
- apply plugin : ' kotlin-android-extensions'
4
- apply plugin : ' kotlin-kapt'
5
-
6
- android {
7
- compileSdkVersion 28
8
- defaultConfig {
9
- applicationId " com.weike.education"
10
- minSdkVersion 19
11
- targetSdkVersion 28
12
- versionCode 2
13
- versionName " 1.5"
14
- testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
15
- }
16
-
17
- signingConfigs {
18
- release {
19
- storeFile file(" I:/resource/Education/education.jks" )
20
- storePassword " aa123456"
21
- keyAlias " key0"
22
- keyPassword " aa123456"
23
- }
24
- }
25
-
26
- buildTypes {
27
- release {
28
- minifyEnabled true
29
- signingConfig signingConfigs. release
30
- proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
31
- }
32
- }
33
-
34
- compileOptions {
35
- targetCompatibility 1.8
36
- sourceCompatibility 1.8
37
- }
38
- androidExtensions {
39
- experimental = true
40
- }
41
-
42
- sourceSets { main { assets. srcDirs = [' src/main/assets' , ' src/main/assets/' ] } }
43
-
44
- configurations {
45
- ktlint
46
- }
47
- }
48
-
49
- dependencies {
50
- implementation fileTree(include : [' *.jar' ], dir : ' libs' )
51
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
52
- implementation ' com.android.support:appcompat-v7:28.0.0'
53
- implementation ' com.android.support.constraint:constraint-layout:1.1.3'
54
- testImplementation ' junit:junit:4.12'
55
- implementation ' com.android.support:design:28.0.0'
56
- implementation ' com.android.support:recyclerview-v7:28.0.0'
57
- implementation ' com.android.support:cardview-v7:28.0.0'
58
- androidTestImplementation ' com.android.support.test:runner:1.0.2'
59
- androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
60
- // rxjava2
61
- implementation ' io.reactivex.rxjava2:rxandroid:2.1.0'
62
- implementation ' io.reactivex.rxjava2:rxjava:2.2.1'
63
- // permissions
64
- implementation ' com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
65
- // dagger2
66
- implementation ' com.google.dagger:dagger:2.16'
67
- kapt ' com.google.dagger:dagger-compiler:2.16'
68
- // glide
69
- implementation ' com.github.bumptech.glide:glide:3.7.0'
70
- implementation ' jp.wasabeef:glide-transformations:2.0.2'
71
- // network
72
- implementation ' com.squareup.okhttp3:okhttp:3.11.0'
73
- implementation ' com.squareup.okhttp3:logging-interceptor:3.11.0'
74
- implementation ' com.squareup.retrofit2:retrofit:2.4.0'
75
- implementation ' com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
76
- implementation ' com.squareup.retrofit2:converter-gson:2.4.0'
77
- // rxbinding
78
- implementation ' com.jakewharton.rxbinding2:rxbinding:2.1.1'
79
- // rxlifecycle
80
- implementation ' com.trello.rxlifecycle2:rxlifecycle:2.1.0'
81
- implementation ' com.trello.rxlifecycle2:rxlifecycle-components:2.1.0'
82
- // Flycotablayout
83
- implementation ' com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
84
- implementation ' com.github.hymanme.tagflowlayout:tagflowlayout:0.2.2'
85
- // 轮播图
86
- implementation ' com.github.pinguo-zhouwei:MZBannerView:v2.0.2'
87
- // BaseRecyclerViewAdapterHelper
88
- implementation ' com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.40'
89
- // ijkplayer
90
- implementation ' tv.danmaku.ijk.media:ijkplayer-java:0.8.4'
91
- implementation ' tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.4'
92
- implementation ' tv.danmaku.ijk.media:ijkplayer-armv5:0.8.4'
93
- implementation ' tv.danmaku.ijk.media:ijkplayer-x86:0.8.4'
94
- // flowlayout
95
- implementation ' com.zhy:flowlayout-lib:1.0.3'
96
- // kotlin编码规约
97
- ktlint " com.github.shyiko:ktlint:0.29.0"
98
- }
99
-
100
-
101
- task ktlint (type : JavaExec , group : " verification" ) {
102
- description = " Check Kotlin code style."
103
- classpath = configurations. ktlint
104
- main = " com.github.shyiko.ktlint.Main"
105
- args " -a" , " src/**/*.kt" // -a 表示代码规范使用 Android Kotlin Style Guide,不需要可以去掉,即改为 args "src/**/*.kt"
106
- // to generate report in checkstyle format prepend following args:
107
- // "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
108
- // see https://github.com/shyiko/ktlint#usage for more
109
- }
110
- check. dependsOn ktlint
111
-
112
- task ktlintFormat (type : JavaExec , group : " formatting" ) {
113
- description = " Fix Kotlin code style deviations."
114
- classpath = configurations. ktlint
115
- main = " com.github.shyiko.ktlint.Main"
116
- args " -F" , " src/**/*.kt"
1
+ apply plugin : ' com.android.application'
2
+ apply plugin : ' kotlin-android'
3
+ apply plugin : ' kotlin-android-extensions'
4
+ apply plugin : ' kotlin-kapt'
5
+
6
+ android {
7
+ compileSdkVersion 28
8
+ defaultConfig {
9
+ applicationId " com.weike.education"
10
+ minSdkVersion 19
11
+ targetSdkVersion 28
12
+ versionCode 2
13
+ versionName " 1.5"
14
+ testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
15
+ }
16
+
17
+ buildTypes {
18
+ release {
19
+ minifyEnabled true
20
+ proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
21
+ }
22
+ }
23
+
24
+ compileOptions {
25
+ targetCompatibility 1.8
26
+ sourceCompatibility 1.8
27
+ }
28
+ androidExtensions {
29
+ experimental = true
30
+ }
31
+
32
+ sourceSets { main { assets. srcDirs = [' src/main/assets' , ' src/main/assets/' ] } }
33
+
34
+ configurations {
35
+ ktlint
36
+ }
37
+ }
38
+
39
+ dependencies {
40
+ implementation fileTree(include : [' *.jar' ], dir : ' libs' )
41
+ implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
42
+ implementation ' com.android.support:appcompat-v7:28.0.0'
43
+ implementation ' com.android.support.constraint:constraint-layout:1.1.3'
44
+ testImplementation ' junit:junit:4.12'
45
+ implementation ' com.android.support:design:28.0.0'
46
+ implementation ' com.android.support:recyclerview-v7:28.0.0'
47
+ implementation ' com.android.support:cardview-v7:28.0.0'
48
+ androidTestImplementation ' com.android.support.test:runner:1.0.2'
49
+ androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
50
+ // rxjava2
51
+ implementation ' io.reactivex.rxjava2:rxandroid:2.1.0'
52
+ implementation ' io.reactivex.rxjava2:rxjava:2.2.1'
53
+ // permissions
54
+ implementation ' com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
55
+ // dagger2
56
+ implementation ' com.google.dagger:dagger:2.16'
57
+ kapt ' com.google.dagger:dagger-compiler:2.16'
58
+ // glide
59
+ implementation ' com.github.bumptech.glide:glide:3.7.0'
60
+ implementation ' jp.wasabeef:glide-transformations:2.0.2'
61
+ // network
62
+ implementation ' com.squareup.okhttp3:okhttp:3.11.0'
63
+ implementation ' com.squareup.okhttp3:logging-interceptor:3.11.0'
64
+ implementation ' com.squareup.retrofit2:retrofit:2.4.0'
65
+ implementation ' com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
66
+ implementation ' com.squareup.retrofit2:converter-gson:2.4.0'
67
+ // rxbinding
68
+ implementation ' com.jakewharton.rxbinding2:rxbinding:2.1.1'
69
+ // rxlifecycle
70
+ implementation ' com.trello.rxlifecycle2:rxlifecycle:2.1.0'
71
+ implementation ' com.trello.rxlifecycle2:rxlifecycle-components:2.1.0'
72
+ // Flycotablayout
73
+ implementation ' com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
74
+ implementation ' com.github.hymanme.tagflowlayout:tagflowlayout:0.2.2'
75
+ // 轮播图
76
+ implementation ' com.github.pinguo-zhouwei:MZBannerView:v2.0.2'
77
+ // BaseRecyclerViewAdapterHelper
78
+ implementation ' com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.40'
79
+ // ijkplayer
80
+ implementation ' tv.danmaku.ijk.media:ijkplayer-java:0.8.4'
81
+ implementation ' tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.4'
82
+ implementation ' tv.danmaku.ijk.media:ijkplayer-armv5:0.8.4'
83
+ implementation ' tv.danmaku.ijk.media:ijkplayer-x86:0.8.4'
84
+ // flowlayout
85
+ implementation ' com.zhy:flowlayout-lib:1.0.3'
86
+ // kotlin编码规约
87
+ ktlint " com.github.shyiko:ktlint:0.29.0"
88
+ }
89
+
90
+
91
+ task ktlint (type : JavaExec , group : " verification" ) {
92
+ description = " Check Kotlin code style."
93
+ classpath = configurations. ktlint
94
+ main = " com.github.shyiko.ktlint.Main"
95
+ args " -a" , " src/**/*.kt" // -a 表示代码规范使用 Android Kotlin Style Guide,不需要可以去掉,即改为 args "src/**/*.kt"
96
+ // to generate report in checkstyle format prepend following args:
97
+ // "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
98
+ // see https://github.com/shyiko/ktlint#usage for more
99
+ }
100
+ check. dependsOn ktlint
101
+
102
+ task ktlintFormat (type : JavaExec , group : " formatting" ) {
103
+ description = " Fix Kotlin code style deviations."
104
+ classpath = configurations. ktlint
105
+ main = " com.github.shyiko.ktlint.Main"
106
+ args " -F" , " src/**/*.kt"
117
107
}
0 commit comments