Skip to content

Commit f4d02ae

Browse files
committed
Upgrade gradle to 5.1.1 & migrate to kotlin-dsl
1 parent 73cd7e6 commit f4d02ae

File tree

10 files changed

+125
-116
lines changed

10 files changed

+125
-116
lines changed

app/build.gradle

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import org.jetbrains.kotlin.config.KotlinCompilerVersion
2+
3+
plugins {
4+
id("com.android.application")
5+
kotlin("android")
6+
kotlin("android.extensions")
7+
kotlin("kapt")
8+
}
9+
10+
android {
11+
compileSdkVersion(28)
12+
defaultConfig {
13+
applicationId = "cn.nekocode.gank"
14+
minSdkVersion(16)
15+
targetSdkVersion(28)
16+
versionCode = 1
17+
versionName = "1.0"
18+
19+
val SCHEME = "gank"
20+
21+
buildConfigField("String", "SCHEME", "\"${SCHEME}\"")
22+
23+
manifestPlaceholders = mapOf(
24+
"APPLICATION_ID" to applicationId,
25+
"SCHEME" to SCHEME
26+
)
27+
}
28+
buildTypes {
29+
getByName("release") {
30+
isMinifyEnabled = false
31+
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
32+
}
33+
}
34+
}
35+
36+
dependencies {
37+
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
38+
implementation(project(":backend"))
39+
40+
// Kotlin
41+
implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
42+
43+
// Android support libraries
44+
val SUPPORT_VERSION = "28.0.0"
45+
implementation("com.android.support:appcompat-v7:$SUPPORT_VERSION")
46+
implementation("com.android.support:recyclerview-v7:$SUPPORT_VERSION")
47+
implementation("com.android.support:support-annotations:$SUPPORT_VERSION")
48+
implementation("com.android.support.constraint:constraint-layout:1.1.3")
49+
50+
// ReactiveX
51+
implementation("io.reactivex.rxjava2:rxjava:2.2.2")
52+
implementation("io.reactivex.rxjava2:rxandroid:2.1.0")
53+
val AUTO_DISPOSE_VERSION = "0.8.0"
54+
implementation("com.uber.autodispose:autodispose:$AUTO_DISPOSE_VERSION")
55+
implementation("com.uber.autodispose:autodispose-android:$AUTO_DISPOSE_VERSION")
56+
implementation("com.uber.autodispose:autodispose-android-archcomponents:$AUTO_DISPOSE_VERSION")
57+
58+
// Others
59+
implementation("com.squareup.picasso:picasso:2.5.2")
60+
implementation("com.github.nekocode:Meepo:0.3")
61+
val STATE_VERSION = "1.3.1"
62+
implementation("com.evernote:android-state:$STATE_VERSION")
63+
kapt("com.evernote:android-state-processor:$STATE_VERSION")
64+
}

backend/build.gradle

Lines changed: 0 additions & 31 deletions
This file was deleted.

backend/build.gradle.kts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import org.jetbrains.kotlin.config.KotlinCompilerVersion
2+
3+
plugins {
4+
id("com.android.library")
5+
kotlin("android")
6+
}
7+
8+
android {
9+
compileSdkVersion(28)
10+
defaultConfig {
11+
minSdkVersion(16)
12+
targetSdkVersion(28)
13+
consumerProguardFiles("proguard-rules.pro")
14+
}
15+
}
16+
17+
dependencies {
18+
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
19+
testImplementation("junit:junit:4.12")
20+
21+
// Kotlin
22+
implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
23+
24+
// Network
25+
api("com.squareup.okhttp3:okhttp:3.11.0")
26+
api("com.google.code.gson:gson:2.8.4")
27+
val RETROFIT_VERSION = "2.4.0"
28+
implementation("com.squareup.retrofit2:retrofit:$RETROFIT_VERSION")
29+
implementation("com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION")
30+
implementation("com.squareup.retrofit2:adapter-rxjava2:$RETROFIT_VERSION")
31+
32+
// ReactiveX
33+
api("io.reactivex.rxjava2:rxjava:2.2.2")
34+
api("io.reactivex.rxjava2:rxandroid:2.1.0")
35+
}

build.gradle

Lines changed: 0 additions & 22 deletions
This file was deleted.

build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
jcenter()
5+
}
6+
dependencies {
7+
classpath("com.android.tools.build:gradle:3.4.1")
8+
classpath(kotlin("gradle-plugin", version = "1.3.31"))
9+
}
10+
}
11+
12+
allprojects {
13+
repositories {
14+
google()
15+
jcenter()
16+
maven { url = uri("https://jitpack.io") }
17+
}
18+
}
19+
20+
tasks.register("clean", Delete::class.java) {
21+
this.delete(rootProject.buildDir)
22+
}

create-android-kotlin-app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def create(self):
3333
if last_semgnet.endswith('.kt'):
3434
self.kt_file(entry_name)
3535

36-
elif last_semgnet.endswith('.gradle'):
36+
elif last_semgnet.endswith('.gradle.kts'):
3737
self.gradle_file(entry_name)
3838

3939
elif last_semgnet == 'AndroidManifest.xml':
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Jan 27 11:04:57 CST 2019
1+
#Mon May 27 21:57:00 CST 2019
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-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include(":app", ":backend")

0 commit comments

Comments
 (0)