From 29c1dcbe413c09317763000931c07355775573ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Wed, 20 Jan 2021 16:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=9D=E8=B5=96=E5=85=B3?= =?UTF-8?q?=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 5 ++++ config.gradle | 12 ++++++---- foudations/mogo-commons/build.gradle | 13 +++++----- .../cloud/commons/ExampleInstrumentedTest.kt | 24 ------------------- .../com/mogo/cloud/commons/ExampleUnitTest.kt | 17 ------------- foudations/mogo-httpdns/build.gradle | 7 ++---- foudations/mogo-passport/build.gradle | 2 +- .../passport/MoGoAiCloudClientConfig.java | 10 ++++++++ 8 files changed, 33 insertions(+), 57 deletions(-) delete mode 100644 foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt delete mode 100644 foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt diff --git a/app/build.gradle b/app/build.gradle index e6d9c80..b71e1a2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,11 @@ android { versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + packagingOptions { + //解决编译时com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/rxjava.properties'这个错误 + exclude 'META-INF/rxjava.properties' + } } buildTypes { diff --git a/config.gradle b/config.gradle index 4566169..bc07a04 100644 --- a/config.gradle +++ b/config.gradle @@ -10,7 +10,7 @@ ext { dependencies = [ // androidx androidxappcompat : "androidx.appcompat:appcompat:1.1.0", - androidxccorektx : "androidx.core:core-ktx:1.3.0", + androidxccorektx : "androidx.core:core-ktx:1.3.2", androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3", boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1", androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0", @@ -55,9 +55,9 @@ ext { // 公司服务 - 埋点 analytics : "com.elegant.analytics:analytics:1.1.28", - retrofit : "com.squareup.retrofit2:retrofit:2.6.0", - retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.0", - retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.6.0", + retrofit : "com.squareup.retrofit2:retrofit:2.1.0", + retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.1.0", + retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.1.0", retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0", @@ -116,6 +116,10 @@ ext { androidxroomruntime : "androidx.room:room-runtime:2.2.3", androidxroomcompiler : "androidx.room:room-compiler:2.2.3", androidxroomktx : "androidx.room:room-ktx:2.2.3", + + mogoutils : "com.mogo.commons:mogo-utils:2.0.12", + + ] } \ No newline at end of file diff --git a/foudations/mogo-commons/build.gradle b/foudations/mogo-commons/build.gradle index 27c082a..b38abaa 100644 --- a/foudations/mogo-commons/build.gradle +++ b/foudations/mogo-commons/build.gradle @@ -27,15 +27,16 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.1.0' - implementation 'androidx.appcompat:appcompat:1.1.0' - implementation project(path: ':foudations:mogo-passport') - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + + implementation rootProject.ext.dependencies.androidxccorektx + implementation rootProject.ext.dependencies.androidxappcompat + api rootProject.ext.dependencies.retrofit api rootProject.ext.dependencies.retrofitadapter api rootProject.ext.dependencies.retrofitconvertergson api rootProject.ext.dependencies.retrofitconverterscalars + implementation project(path: ':foudations:mogo-httpdns') + implementation project(path: ':foudations:mogo-passport') + } \ No newline at end of file diff --git a/foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt b/foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt deleted file mode 100644 index 229aaf7..0000000 --- a/foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.cloud.commons - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.mogo.cloud.commons.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt b/foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt deleted file mode 100644 index b8f9ed0..0000000 --- a/foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.mogo.cloud.commons - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/foudations/mogo-httpdns/build.gradle b/foudations/mogo-httpdns/build.gradle index b2fcc3b..15a91d3 100644 --- a/foudations/mogo-httpdns/build.gradle +++ b/foudations/mogo-httpdns/build.gradle @@ -33,12 +33,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.1' - + implementation rootProject.ext.dependencies.androidxccorektx + implementation rootProject.ext.dependencies.androidxappcompat } apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/foudations/mogo-passport/build.gradle b/foudations/mogo-passport/build.gradle index 1c76b2c..333563c 100644 --- a/foudations/mogo-passport/build.gradle +++ b/foudations/mogo-passport/build.gradle @@ -29,7 +29,7 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation rootProject.ext.dependencies.androidxappcompat - + api rootProject.ext.dependencies.mogoutils // passport implementation 'com.zhidao.tcloginsdk:tclogin:1.1.5.1' api project(path: ':foudations:mogo-httpdns') diff --git a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java index 9838a30..02c17fa 100644 --- a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java +++ b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java @@ -1,11 +1,15 @@ package com.mogo.cloud.passport; +import android.text.TextUtils; + import com.mogo.cloud.httpdns.MogoHttpDnsConfig; +import com.mogo.utils.logger.Logger; /** * SDK 中的参数 */ public class MoGoAiCloudClientConfig { + private static final String TAG = "MoGoAiCloudClientConfig"; /** * 网络模式 @@ -104,10 +108,16 @@ public class MoGoAiCloudClientConfig { } public String getToken() { + if (TextUtils.isEmpty(token)) { + Logger.e(TAG, "Token 获取失败……"); + } return token; } public String getSn() { + if (TextUtils.isEmpty(sn)) { + Logger.e(TAG, "SN 获取失败……"); + } return sn; }