Skip to content

Commit 8c07bdc

Browse files
committed
Modifications of dependency
1 parent fe3c95e commit 8c07bdc

File tree

10 files changed

+71
-60
lines changed

10 files changed

+71
-60
lines changed

app/build.gradle.kts

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,46 @@ dependencies {
4949
implementation(project(":backend"))
5050

5151
// Kotlin
52-
implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
52+
implementation(kotlin("stdlib-jdk8", KotlinCompilerVersion.VERSION))
5353

5454
// Androidx
55-
implementation("androidx.appcompat:appcompat:1.1.0-alpha05")
55+
implementation("androidx.appcompat:appcompat:1.1.0-rc01")
5656
implementation("androidx.core:core-ktx:1.0.2")
57-
implementation("androidx.recyclerview:recyclerview:1.1.0-alpha05")
58-
implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta1")
57+
implementation("androidx.recyclerview:recyclerview:1.1.0-beta01")
58+
implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta2")
5959

6060
// Navigation
6161
implementation("android.arch.navigation:navigation-fragment-ktx:1.0.0")
6262
implementation("android.arch.navigation:navigation-ui-ktx:1.0.0")
6363

6464
// ReactiveX
65-
implementation("io.reactivex.rxjava2:rxjava:2.2.6")
66-
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
67-
implementation("com.uber.autodispose:autodispose:0.8.0")
68-
implementation("com.uber.autodispose:autodispose-android:0.8.0")
69-
implementation("com.uber.autodispose:autodispose-android-archcomponents:0.8.0")
65+
implementation("com.uber.autodispose:autodispose:1.3.0")
66+
implementation("com.uber.autodispose:autodispose-android:1.3.0")
67+
implementation("com.uber.autodispose:autodispose-android-archcomponents:1.3.0")
7068

7169
// Others
72-
implementation("com.squareup.picasso:picasso:2.5.2")
73-
implementation("com.github.nekocode:Meepo:0.3")
74-
implementation("com.evernote:android-state:1.3.1")
75-
kapt("com.evernote:android-state-processor:1.3.1")
70+
implementation("com.squareup.picasso:picasso:2.71828")
71+
implementation("com.evernote:android-state:1.4.1")
72+
kapt("com.evernote:android-state-processor:1.4.1")
7673

7774
// For debugging
78-
debugImplementation("com.facebook.flipper:flipper:0.21.1")
79-
debugImplementation("com.facebook.soloader:soloader:0.6.0")
80-
releaseImplementation("com.facebook.flipper:flipper-noop:0.21.1")
75+
debugImplementation("com.facebook.flipper:flipper:0.23.2")
76+
debugImplementation("com.facebook.soloader:soloader:0.6.1")
77+
releaseImplementation("com.facebook.flipper:flipper-noop:0.23.2")
78+
debugImplementation("com.willowtreeapps.hyperion:hyperion-core:0.9.27")
79+
debugImplementation("com.willowtreeapps.hyperion:hyperion-attr:0.9.27")
80+
debugImplementation("com.willowtreeapps.hyperion:hyperion-build-config:0.9.27")
81+
debugImplementation("com.willowtreeapps.hyperion:hyperion-crash:0.9.27")
82+
debugImplementation("com.willowtreeapps.hyperion:hyperion-disk:0.9.27")
83+
debugImplementation("com.willowtreeapps.hyperion:hyperion-geiger-counter:0.9.27")
84+
debugImplementation("com.willowtreeapps.hyperion:hyperion-measurement:0.9.27")
85+
debugImplementation("com.willowtreeapps.hyperion:hyperion-phoenix:0.9.27")
86+
debugImplementation("com.willowtreeapps.hyperion:hyperion-recorder:0.9.27")
87+
debugImplementation("com.willowtreeapps.hyperion:hyperion-shared-preferences:0.9.27")
88+
debugImplementation("com.willowtreeapps.hyperion:hyperion-timber:0.9.27")
89+
releaseImplementation("com.willowtreeapps.hyperion:hyperion-core-no-op:0.9.27")
90+
}
91+
92+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).all {
93+
kotlinOptions.jvmTarget = "1.8"
8194
}

app/proguard-rules.pro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@
1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
2121
#-renamesourcefileattribute SourceFile
22+
23+
# OkHttp
24+
# JSR 305 annotations are for embedding nullability information.
25+
-dontwarn javax.annotation.**
26+
# A resource is loaded with a relative path so the package of this class must be preserved.
27+
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
28+
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
29+
-dontwarn org.codehaus.mojo.animal_sniffer.*
30+
# OkHttp platform used only on JVM and when Conscrypt dependency is available.
31+
-dontwarn okhttp3.internal.platform.ConscryptPlatform

app/src/main/java/cn/nekocode/gank/ActivityRouter.kt

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

app/src/main/java/cn/nekocode/gank/Extensions.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import androidx.fragment.app.Fragment
2323
/**
2424
* @author nekocode ([email protected])
2525
*/
26-
val Context.activityRouter get() = (this.applicationContext as GankApplication).activityRouter
27-
val Fragment.activityRouter get() = this.requireActivity().activityRouter
2826
val Context.apis get() = (this.applicationContext as GankApplication).apis
2927
val Fragment.apis get() = this.requireActivity().apis
3028

app/src/main/java/cn/nekocode/gank/GankApplication.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ package cn.nekocode.gank
1818

1919
import android.app.Application
2020
import cn.nekocode.gank.backend.Apis
21-
import cn.nekocode.meepo.Meepo
22-
import cn.nekocode.meepo.config.UriConfig
2321
import com.facebook.flipper.android.AndroidFlipperClient
2422
import com.facebook.flipper.android.utils.FlipperUtils
2523
import com.facebook.flipper.plugins.inspector.DescriptorMapping
@@ -34,7 +32,6 @@ import okhttp3.OkHttpClient
3432
* @author nekocode ([email protected])
3533
*/
3634
class GankApplication : Application() {
37-
lateinit var activityRouter: ActivityRouter
3835
lateinit var apis: Apis
3936

4037
override fun onCreate() {
@@ -61,9 +58,6 @@ class GankApplication : Application() {
6158
}
6259

6360
// Components
64-
activityRouter = Meepo.Builder()
65-
.config(UriConfig().scheme(BuildConfig.SCHEME).host(BuildConfig.APPLICATION_ID))
66-
.build().create(ActivityRouter::class.java)
6761
apis = Apis(httpClientBuilder, GsonBuilder())
6862
}
6963
}

app/src/main/java/cn/nekocode/gank/ui/pic/PicFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class PicFragment : BaseFragment() {
6666
.observeOn(AndroidSchedulers.mainThread())
6767
.autoDisposable()
6868
.subscribe({ pic ->
69-
Picasso.with(requireActivity()).load(pic.url).centerCrop().fit().into(imageView)
69+
Picasso.get().load(pic.url).centerCrop().fit().into(imageView)
7070

7171
}, {
7272
Toast.makeText(requireActivity(), R.string.sth_went_wrong, Toast.LENGTH_SHORT).show()

backend/build.gradle.kts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,24 @@ dependencies {
2929
testImplementation("junit:junit:4.12")
3030

3131
// Kotlin
32-
implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
32+
implementation(kotlin("stdlib-jdk8", KotlinCompilerVersion.VERSION))
3333

3434
// Network
35-
api("com.squareup.okhttp3:okhttp:3.14.1")
36-
api("com.google.code.gson:gson:2.8.4")
37-
implementation("com.squareup.retrofit2:retrofit:2.5.0")
35+
api("com.squareup.okhttp3:okhttp:4.0.1")
36+
api("com.google.code.gson:gson:2.8.5")
37+
implementation("com.squareup.retrofit2:retrofit:2.6.0")
3838
implementation("com.squareup.retrofit2:converter-gson:2.5.0")
39-
implementation("com.squareup.retrofit2:adapter-rxjava2:2.5.0")
39+
implementation("com.squareup.retrofit2:adapter-rxjava2:2.6.0")
40+
testImplementation("com.squareup.okhttp3:logging-interceptor:4.0.1")
4041

4142
// ReactiveX
42-
api("io.reactivex.rxjava2:rxjava:2.2.6")
43+
api("io.reactivex.rxjava2:rxjava:2.2.8")
4344
api("io.reactivex.rxjava2:rxandroid:2.1.1")
45+
46+
// Testing
47+
testImplementation(kotlin("test-junit", KotlinCompilerVersion.VERSION))
48+
}
49+
50+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).all {
51+
kotlinOptions.jvmTarget = "1.8"
4452
}

backend/src/main/java/cn/nekocode/gank/backend/Apis.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import retrofit2.converter.gson.GsonConverterFactory
2828
* @author nekocode ([email protected])
2929
*/
3030
class Apis(
31-
clientBuilder: OkHttpClient.Builder = OkHttpClient.Builder(),
31+
httpClientBuilder: OkHttpClient.Builder = OkHttpClient.Builder(),
3232
gsonBuilder: GsonBuilder = GsonBuilder(),
3333
apiEnv: ApiEnv = ApiEnv.PRODUCT
3434
) {
@@ -40,7 +40,7 @@ class Apis(
4040
/**
4141
* OkHttp Client
4242
*/
43-
val client: OkHttpClient = clientBuilder
43+
val client: OkHttpClient = httpClientBuilder
4444
.addInterceptor { chain ->
4545
val oldReq = chain.request()
4646
val newReqBuilder = oldReq.newBuilder()

backend/src/test/java/cn/nekocode/gank/backend/ApisTest.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,26 @@
1616

1717
package cn.nekocode.gank.backend
1818

19+
import okhttp3.OkHttpClient
20+
import okhttp3.logging.HttpLoggingInterceptor
1921
import org.junit.Ignore
2022
import org.junit.Test
2123

2224
/**
2325
* @author nekocode ([email protected])
2426
*/
2527
class ApisTest {
26-
private val apis = Apis()
28+
private val apis = Apis(
29+
OkHttpClient.Builder().addInterceptor(HttpLoggingInterceptor(
30+
logger = object : HttpLoggingInterceptor.Logger {
31+
override fun log(message: String) {
32+
println(message)
33+
}
34+
}
35+
).apply {
36+
level = HttpLoggingInterceptor.Level.BODY
37+
})
38+
)
2739
private val client = apis.client
2840
private val gson = apis.gson
2941

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ buildscript {
44
jcenter()
55
}
66
dependencies {
7-
classpath("com.android.tools.build:gradle:3.4.1")
8-
classpath(kotlin("gradle-plugin", version = "1.3.31"))
7+
classpath("com.android.tools.build:gradle:3.4.2")
8+
classpath(kotlin("gradle-plugin", version = "1.3.41"))
99
classpath("android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0")
1010
classpath("com.akaita.android:easylauncher:1.3.1")
1111
}

0 commit comments

Comments
 (0)