From 8d4851a9132b565566f932a6c82c701dd4175068 Mon Sep 17 00:00:00 2001 From: jiangdg Date: Tue, 30 Aug 2022 10:25:15 +0800 Subject: [PATCH] [opt] remove mmkv/glide from libusbc --- app/build.gradle | 6 +- .../java/com/jiangdg/demo/DemoApplication.kt | 2 + .../java/com/jiangdg/demo/DemoFragment.kt | 19 +++-- .../java/com/jiangdg/demo/EffectListDialog.kt | 4 +- libausbc/build.gradle | 7 -- .../com/jiangdg/ausbc/base/BaseApplication.kt | 2 - libutils/.gitignore | 1 + libutils/build.gradle | 49 +++++++++++ libutils/consumer-rules.pro | 0 libutils/proguard-rules.pro | 21 +++++ .../jiangdg/utils/ExampleInstrumentedTest.kt | 24 ++++++ libutils/src/main/AndroidManifest.xml | 5 ++ .../main/java/com/jiangdg}/utils/MMKVUtils.kt | 2 +- .../jiangdg}/utils/imageloader/GlideLoader.kt | 77 ++++++++++-------- .../com/jiangdg}/utils/imageloader/ILoader.kt | 2 +- .../utils/imageloader/ImageLoaders.kt | 2 +- .../src/main/res/drawable/effect_none.xml | 13 +++ libutils/src/main/res/drawable/ic_none.png | Bin 0 -> 1775 bytes .../drawable/imageloader_default_cover_bg.xml | 4 + .../java/com/jiangdg/utils/ExampleUnitTest.kt | 17 ++++ settings.gradle | 12 +-- 21 files changed, 207 insertions(+), 62 deletions(-) create mode 100644 libutils/.gitignore create mode 100644 libutils/build.gradle create mode 100644 libutils/consumer-rules.pro create mode 100644 libutils/proguard-rules.pro create mode 100644 libutils/src/androidTest/java/com/jiangdg/utils/ExampleInstrumentedTest.kt create mode 100644 libutils/src/main/AndroidManifest.xml rename {libausbc/src/main/java/com/jiangdg/ausbc => libutils/src/main/java/com/jiangdg}/utils/MMKVUtils.kt (99%) rename {libausbc/src/main/java/com/jiangdg/ausbc => libutils/src/main/java/com/jiangdg}/utils/imageloader/GlideLoader.kt (78%) rename {libausbc/src/main/java/com/jiangdg/ausbc => libutils/src/main/java/com/jiangdg}/utils/imageloader/ILoader.kt (98%) rename {libausbc/src/main/java/com/jiangdg/ausbc => libutils/src/main/java/com/jiangdg}/utils/imageloader/ImageLoaders.kt (97%) create mode 100644 libutils/src/main/res/drawable/effect_none.xml create mode 100644 libutils/src/main/res/drawable/ic_none.png create mode 100644 libutils/src/main/res/drawable/imageloader_default_cover_bg.xml create mode 100644 libutils/src/test/java/com/jiangdg/utils/ExampleUnitTest.kt diff --git a/app/build.gradle b/app/build.gradle index 843c29ab3..864c26e24 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,9 +59,11 @@ dependencies { implementation "com.tencent.bugly:crashreport:$bugly_version" implementation "com.tencent.bugly:nativecrashreport:$bugly_native_version" + implementation project(':libutils') + // For debug online -// implementation project(':libausbc') + implementation project(':libausbc') // demo - implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:3.2.7' +// implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:3.2.7' } diff --git a/app/src/main/java/com/jiangdg/demo/DemoApplication.kt b/app/src/main/java/com/jiangdg/demo/DemoApplication.kt index c57936aab..864b97f42 100644 --- a/app/src/main/java/com/jiangdg/demo/DemoApplication.kt +++ b/app/src/main/java/com/jiangdg/demo/DemoApplication.kt @@ -18,6 +18,7 @@ package com.jiangdg.demo import android.content.Context import androidx.multidex.MultiDex import com.jiangdg.ausbc.base.BaseApplication +import com.jiangdg.utils.MMKVUtils import com.tencent.bugly.crashreport.CrashReport /** @@ -35,5 +36,6 @@ class DemoApplication: BaseApplication() { super.onCreate() // init bugly library CrashReport.initCrashReport(this, "165c46d5b1", true) + MMKVUtils.init(this) } } \ No newline at end of file diff --git a/app/src/main/java/com/jiangdg/demo/DemoFragment.kt b/app/src/main/java/com/jiangdg/demo/DemoFragment.kt index 6a82d69db..d7ace2490 100644 --- a/app/src/main/java/com/jiangdg/demo/DemoFragment.kt +++ b/app/src/main/java/com/jiangdg/demo/DemoFragment.kt @@ -57,12 +57,13 @@ import com.jiangdg.ausbc.render.effect.bean.CameraEffect import com.jiangdg.ausbc.utils.* import com.jiangdg.ausbc.utils.bus.BusKey import com.jiangdg.ausbc.utils.bus.EventBus -import com.jiangdg.ausbc.utils.imageloader.ILoader -import com.jiangdg.ausbc.utils.imageloader.ImageLoaders +import com.jiangdg.utils.imageloader.ILoader +import com.jiangdg.utils.imageloader.ImageLoaders import com.jiangdg.ausbc.widget.* import com.jiangdg.demo.EffectListDialog.Companion.KEY_ANIMATION import com.jiangdg.demo.EffectListDialog.Companion.KEY_FILTER import com.jiangdg.demo.databinding.DialogMoreBinding +import com.jiangdg.utils.MMKVUtils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import java.util.* @@ -631,11 +632,15 @@ class DemoFragment : CameraFragment(), View.OnClickListener, CaptureMediaView.On } private fun goToGalley() { - Intent( - Intent.ACTION_VIEW, - MediaStore.Images.Media.EXTERNAL_CONTENT_URI - ).apply { - startActivity(this) + try { + Intent( + Intent.ACTION_VIEW, + MediaStore.Images.Media.EXTERNAL_CONTENT_URI + ).apply { + startActivity(this) + } + } catch (e: Exception) { + ToastUtils.show("open error: ${e.localizedMessage}") } } diff --git a/app/src/main/java/com/jiangdg/demo/EffectListDialog.kt b/app/src/main/java/com/jiangdg/demo/EffectListDialog.kt index e803a2303..77f310be6 100644 --- a/app/src/main/java/com/jiangdg/demo/EffectListDialog.kt +++ b/app/src/main/java/com/jiangdg/demo/EffectListDialog.kt @@ -29,9 +29,9 @@ import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseViewHolder import com.jiangdg.ausbc.base.BaseDialog import com.jiangdg.ausbc.render.effect.bean.CameraEffect -import com.jiangdg.ausbc.utils.MMKVUtils +import com.jiangdg.utils.MMKVUtils import com.jiangdg.ausbc.utils.Utils -import com.jiangdg.ausbc.utils.imageloader.ImageLoaders +import com.jiangdg.utils.imageloader.ImageLoaders /** Effect list dialog * diff --git a/libausbc/build.gradle b/libausbc/build.gradle index 13358c523..a793d4266 100644 --- a/libausbc/build.gradle +++ b/libausbc/build.gradle @@ -34,15 +34,8 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "androidx.appcompat:appcompat:${androidXVersion}" - implementation "androidx.core:core-ktx:${kotlinCoreVersion}" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${kotlinCoroutines}" implementation "androidx.constraintlayout:constraintlayout:${constraintlayoutVersion}" implementation "com.google.android.material:material:${materialVersion}" - api 'com.gyf.immersionbar:immersionbar:3.0.0' - implementation "com.github.bumptech.glide:glide:4.10.0" - implementation "com.github.bumptech.glide:okhttp3-integration:4.10.0" - implementation "com.zlc.glide:webpdecoder:1.6.4.9.0" - implementation 'com.tencent:mmkv:1.2.12' // For debug online implementation project(path: ':libuvc') diff --git a/libausbc/src/main/java/com/jiangdg/ausbc/base/BaseApplication.kt b/libausbc/src/main/java/com/jiangdg/ausbc/base/BaseApplication.kt index 2daf0962a..3875247a9 100644 --- a/libausbc/src/main/java/com/jiangdg/ausbc/base/BaseApplication.kt +++ b/libausbc/src/main/java/com/jiangdg/ausbc/base/BaseApplication.kt @@ -18,7 +18,6 @@ package com.jiangdg.ausbc.base import android.app.Application import com.jiangdg.ausbc.utils.CrashUtils import com.jiangdg.ausbc.utils.Logger -import com.jiangdg.ausbc.utils.MMKVUtils import com.jiangdg.ausbc.utils.ToastUtils /** Base Application @@ -32,6 +31,5 @@ open class BaseApplication: Application() { CrashUtils.init(this) Logger.init(this) ToastUtils.init(this) - MMKVUtils.init(this) } } \ No newline at end of file diff --git a/libutils/.gitignore b/libutils/.gitignore new file mode 100644 index 000000000..42afabfd2 --- /dev/null +++ b/libutils/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/libutils/build.gradle b/libutils/build.gradle new file mode 100644 index 000000000..f621a4fda --- /dev/null +++ b/libutils/build.gradle @@ -0,0 +1,49 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' +} + +android { + compileSdkVersion rootProject.ext.versionCompiler + + defaultConfig { + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.versionTarget + versionCode rootProject.ext.versionCode + versionName rootProject.ext.versionNameString + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "consumer-rules.pro" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.3.2' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.3.0' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + + // utils + api 'com.gyf.immersionbar:immersionbar:3.0.0' + implementation "com.github.bumptech.glide:glide:4.10.0" + implementation "com.github.bumptech.glide:okhttp3-integration:4.10.0" + implementation "com.zlc.glide:webpdecoder:1.6.4.9.0" + implementation 'com.tencent:mmkv:1.2.12' +} \ No newline at end of file diff --git a/libutils/consumer-rules.pro b/libutils/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/libutils/proguard-rules.pro b/libutils/proguard-rules.pro new file mode 100644 index 000000000..481bb4348 --- /dev/null +++ b/libutils/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/libutils/src/androidTest/java/com/jiangdg/utils/ExampleInstrumentedTest.kt b/libutils/src/androidTest/java/com/jiangdg/utils/ExampleInstrumentedTest.kt new file mode 100644 index 000000000..5c6c19962 --- /dev/null +++ b/libutils/src/androidTest/java/com/jiangdg/utils/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.jiangdg.utils + +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.jiangdg.utils.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/libutils/src/main/AndroidManifest.xml b/libutils/src/main/AndroidManifest.xml new file mode 100644 index 000000000..a881c96c5 --- /dev/null +++ b/libutils/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/libausbc/src/main/java/com/jiangdg/ausbc/utils/MMKVUtils.kt b/libutils/src/main/java/com/jiangdg/utils/MMKVUtils.kt similarity index 99% rename from libausbc/src/main/java/com/jiangdg/ausbc/utils/MMKVUtils.kt rename to libutils/src/main/java/com/jiangdg/utils/MMKVUtils.kt index efd155506..2d4e7eeb7 100644 --- a/libausbc/src/main/java/com/jiangdg/ausbc/utils/MMKVUtils.kt +++ b/libutils/src/main/java/com/jiangdg/utils/MMKVUtils.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.jiangdg.ausbc.utils +package com.jiangdg.utils import android.content.Context import android.os.Parcelable diff --git a/libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/GlideLoader.kt b/libutils/src/main/java/com/jiangdg/utils/imageloader/GlideLoader.kt similarity index 78% rename from libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/GlideLoader.kt rename to libutils/src/main/java/com/jiangdg/utils/imageloader/GlideLoader.kt index d0915201e..1fef05ff6 100644 --- a/libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/GlideLoader.kt +++ b/libutils/src/main/java/com/jiangdg/utils/imageloader/GlideLoader.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.jiangdg.ausbc.utils.imageloader +package com.jiangdg.utils.imageloader import android.annotation.SuppressLint import android.app.Activity @@ -38,8 +38,7 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target -import com.jiangdg.ausbc.R -import com.jiangdg.ausbc.utils.Utils +import com.jiangdg.utils.R import java.lang.IllegalArgumentException /**GlideImageLoader by glide @@ -104,9 +103,9 @@ class GlideLoader(target: T) : ILoader { override fun loadRounded(imageView: ImageView, url: String?, placeHolder: Int, radius: Float) { RequestOptions().apply { if (radius >= 0) { - transform(CenterCrop(), RoundedCorners(Utils.dp2px(imageView.context, radius))) + transform(CenterCrop(), RoundedCorners(dp2px(imageView.context, radius))) } else { - transform(RoundedCorners(Utils.dp2px(imageView.context, radius))) + transform(RoundedCorners(dp2px(imageView.context, radius))) } }.also { options -> mRequestManager!!.load(url) @@ -125,9 +124,9 @@ class GlideLoader(target: T) : ILoader { ) { RequestOptions().apply { if (radius >= 0) { - transform(CenterCrop(), RoundedCorners(Utils.dp2px(imageView.context, radius))) + transform(CenterCrop(), RoundedCorners(dp2px(imageView.context, radius))) } else { - transform(RoundedCorners(Utils.dp2px(imageView.context, radius))) + transform(RoundedCorners(dp2px(imageView.context, radius))) } }.also { options -> mRequestManager!!.load(url) @@ -177,35 +176,45 @@ class GlideLoader(target: T) : ILoader { } } - override fun loadAsBitmap(url: String?, width: Int, height: Int, listener: ILoader.OnLoadedResultListener) { + override fun loadAsBitmap( + url: String?, + width: Int, + height: Int, + listener: ILoader.OnLoadedResultListener + ) { mRequestManager?.apply { this.asBitmap() - .centerCrop() - .load(url) - .listener(object : RequestListener { - override fun onLoadFailed( - e: GlideException?, - model: Any?, - target: Target?, - isFirstResource: Boolean - ): Boolean { - listener.onLoadedFailed(e) - return true - } - - override fun onResourceReady( - resource: Bitmap?, - model: Any?, - target: Target?, - dataSource: DataSource?, - isFirstResource: Boolean - ): Boolean { - listener.onLoadedSuccess(resource) - return true - } - - }) - .submit(width, height) + .centerCrop() + .load(url) + .listener(object : RequestListener { + override fun onLoadFailed( + e: GlideException?, + model: Any?, + target: Target?, + isFirstResource: Boolean + ): Boolean { + listener.onLoadedFailed(e) + return true + } + + override fun onResourceReady( + resource: Bitmap?, + model: Any?, + target: Target?, + dataSource: DataSource?, + isFirstResource: Boolean + ): Boolean { + listener.onLoadedSuccess(resource) + return true + } + + }) + .submit(width, height) } } + + private fun dp2px(context: Context, dpValue: Float): Int { + val scale: Float = context.resources.displayMetrics.density + return (dpValue * scale + 0.5f).toInt() + } } \ No newline at end of file diff --git a/libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/ILoader.kt b/libutils/src/main/java/com/jiangdg/utils/imageloader/ILoader.kt similarity index 98% rename from libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/ILoader.kt rename to libutils/src/main/java/com/jiangdg/utils/imageloader/ILoader.kt index ad8c36c31..bf7745caa 100644 --- a/libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/ILoader.kt +++ b/libutils/src/main/java/com/jiangdg/utils/imageloader/ILoader.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.jiangdg.ausbc.utils.imageloader +package com.jiangdg.utils.imageloader import android.graphics.Bitmap import android.graphics.drawable.Drawable diff --git a/libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/ImageLoaders.kt b/libutils/src/main/java/com/jiangdg/utils/imageloader/ImageLoaders.kt similarity index 97% rename from libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/ImageLoaders.kt rename to libutils/src/main/java/com/jiangdg/utils/imageloader/ImageLoaders.kt index 20192fbbf..1e503a786 100644 --- a/libausbc/src/main/java/com/jiangdg/ausbc/utils/imageloader/ImageLoaders.kt +++ b/libutils/src/main/java/com/jiangdg/utils/imageloader/ImageLoaders.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.jiangdg.ausbc.utils.imageloader +package com.jiangdg.utils.imageloader import android.app.Activity import android.content.Context diff --git a/libutils/src/main/res/drawable/effect_none.xml b/libutils/src/main/res/drawable/effect_none.xml new file mode 100644 index 000000000..f2d9c646b --- /dev/null +++ b/libutils/src/main/res/drawable/effect_none.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/libutils/src/main/res/drawable/ic_none.png b/libutils/src/main/res/drawable/ic_none.png new file mode 100644 index 0000000000000000000000000000000000000000..ab54440f9cb80f3f4955b5da0208cfaadf48170a GIT binary patch literal 1775 zcmVwdf_oV?!D)n-#vHk zy>re*XkbxF4cA(a2Y^l?L@NOB@1_zJM-lNyB08wG-Uk4CEXz97C^N8LL5|~0B%&#) zRO%igx~oQc-vPi*0N5y{JW!*ILbsZMlu}Otz_S1_u^t0L`ff(V^@d@5T#MYQfn3*} zMnnq$AX|&VD*C)bM5|2G+*?JT1pZh?OjSlFIJCy|HvJwe3f z0MLirvc!+xITWptOOMa zl+Wi|JS3#oW zS=QpAf?@qah;ab$P?!xtFBO1X*S(X7_Cz#3CWL6Kb&rV}grx6GaWEannT&{^M9Cwf zNqmqk0iblDv`z{g9jDT7!rCfqtU0oLr8#e4`BDx}^;mK4gHMWu7 zsTIbbNgYJQt8iG^E2W%-F^j=YDdhu=dUxu9DcayT&N~0>7iQKN23iCFOT%izHm+LX z8Ue$)l~U~hFtG2G*fXDjB3Cyey3sVvgSA2w`!x!N<>hj@QCjOG5e`_zK>GoJPY9*u zgp~5)a|tFeK>VF`QHX7u80dEZ7#UJ|KuURAJwT20OwbOc6o0wiTxuI4b~Dg_0MHU* z_%?U*d@8s<#I|1;h$4)BQ%d=KEkMnLVS8NHjoLSR8xGWL7~ey$0l-Tk zQ|?qHpsJ_b*?{qZR{KHDQl_H}#1Wdy>RlAh7K{({9soQZV)K3m`Wyi6u4makn=n2Q zhl%eiwV8;z&~@E)ezc{GNo#$zWmy~#i!5gw#s~Tf04@&!T8@t6EI`DS5f*nyDcOUe zWhh{5+rC!_@o9ufvw6z#DS=N5Wrc`Vo2L0(Slv*-_}*Cq0Q16Z>hJGwEqo6trTA<# zDx}dF&-2D-v)LblbwdS{&*w*It-m3nvgrl@JyOa$iXV9EiD-5hH6pGs4C94j-B7`> ze%rPe3n5;Km~MqEMFA+6%iXKBj+&Pz(&_ZLj*gBaLkZ)1r-z8HiWv9_hGBd)5F~M3 zH%COB5shCZB2J~mMl_r8$)3PFA4(|;0hD0WhvUg>BizYB_{dmuu}`yLT-TjJMDJJF zJ!VQNHx2^w7l)*APlu|bU03QJPS*dIzqBW*zMlJbqV=}0o zm*&2{zIhe)nt}G7=Ut!8X3IPnnHs4wzskq?)xoqzH6%rlR4O$$YM&{Q7kS2PSkjmk z6481@+#rNFoXKR4#z8rb^9UkN=c_eIv+P9FZkpy7k*i*u(xl1b5IH9SfX|3W5b+QZ zo$?dHoD?2TL=%!i_=EM25Mq{L7~3n^oG2UTL-EE|db28SJQ`Kc?w-D*uxR zu5O^9mRv43R%^{SwETlT!Yj$l3&r{s%62hi(C& Ruhjqm002ovPDHLkV1g2RGBE%E literal 0 HcmV?d00001 diff --git a/libutils/src/main/res/drawable/imageloader_default_cover_bg.xml b/libutils/src/main/res/drawable/imageloader_default_cover_bg.xml new file mode 100644 index 000000000..db7b2cc5d --- /dev/null +++ b/libutils/src/main/res/drawable/imageloader_default_cover_bg.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/libutils/src/test/java/com/jiangdg/utils/ExampleUnitTest.kt b/libutils/src/test/java/com/jiangdg/utils/ExampleUnitTest.kt new file mode 100644 index 000000000..885ee7b3d --- /dev/null +++ b/libutils/src/test/java/com/jiangdg/utils/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.jiangdg.utils + +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/settings.gradle b/settings.gradle index fa7133e78..7e5cabc80 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,10 @@ include ':app' +include ':libutils' // For debug online -//include ':libausbc' -//include ':libuvc' -//include ':libpush' -//include ':libnative' -//include ':libuvccommon' \ No newline at end of file +include ':libausbc' +include ':libuvc' +include ':libpush' +include ':libnative' +include ':libuvccommon' +