抽离公共依赖

This commit is contained in:
董宏宇
2021-01-19 11:23:50 +08:00
parent a98e0ebc45
commit 398e43b09b
13 changed files with 222 additions and 52 deletions

3
.idea/gradle.xml generated
View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
@@ -11,6 +12,8 @@
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/foudations" />
<option value="$PROJECT_DIR$/foudations/mogo-passport" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />

View File

@@ -21,5 +21,20 @@
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="http://nexus.zhidaoauto.com/repository/maven-releases/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="http://nexus.zhidaoauto.com/repository/maven-public/" />
</remote-repository>
</component>
</project>

View File

@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion rootProject.ext.android.compileSdkVersion
defaultConfig {
applicationId "com.mogo.cloud"
minSdkVersion 19
targetSdkVersion 30
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode 1
versionName "1.0"
@@ -24,10 +23,8 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
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.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
}

View File

@@ -1,26 +0,0 @@
package com.mogo.cloud;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.mogo.cloud", appContext.getPackageName());
}
}

View File

@@ -1,17 +0,0 @@
package com.mogo.cloud;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@@ -1,6 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"
buildscript {
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'http://nexus.zhidaoauto.com/repository/maven-releases/'
}
maven {
url 'http://nexus.zhidaoauto.com/repository/maven-public/'
}
google()
jcenter()
}
@@ -14,6 +25,15 @@ buildscript {
allprojects {
repositories {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
url 'http://nexus.zhidaoauto.com/repository/maven-releases/'
}
maven {
url 'http://nexus.zhidaoauto.com/repository/maven-public/'
}
google()
jcenter()
}

121
config.gradle Normal file
View File

@@ -0,0 +1,121 @@
ext {
time = ""
kotlin_version = "1.4.10"
android = [
compileSdkVersion : 28,
buildToolsVersion : "29.0.2",
minSdkVersion : 19,
targetSdkVersion : 22,
]
dependencies = [
// androidx
androidxappcompat : "androidx.appcompat:appcompat:1.1.0",
androidxccorektx : "androidx.core:core-ktx:1.3.0",
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3",
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
androidxcardview : "androidx.cardview:cardview:1.0.0",
localbroadcastmanager : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
// flexbox
flexbox : 'com.google.android:flexbox:2.0.1',
// 测试
junit : "junit:junit:4.12",
androidxjunit : "androidx.test.ext:junit:1.1.0",
androidxespressocore : "androidx.test.espresso:espresso-core:3.1.1",
// 地图
amapnavi3dmap : "com.amap.api:navi-3dmap:7.2.0_3dmap7.2.0",
amapsearch : "com.amap.api:search:7.1.0",
amaplocation : "com.amap.api:location:5.2.0",
// json 转换
gson : "com.google.code.gson:gson:2.8.4",
// 内存泄漏检测
debugleakcanary : "com.squareup.leakcanary:leakcanary-android:1.6.1",
releaseleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1",
testleakcanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.1",
//rxJava
rxjava : "io.reactivex.rxjava2:rxjava:2.2.2",
rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.0",
// arouter
arouter : "com.alibaba:arouter-api:1.5.0",
aroutercompiler : "com.alibaba:arouter-compiler:1.2.2",
// glide
glide : 'com.github.bumptech.glide:glide:4.8.0',
glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0',
glideanno : 'com.github.bumptech.glide:annotations:4.8.0',
glidecompiler : 'com.github.bumptech.glide:compiler:4.8.0',
supportannos : "com.android.support:support-annotations:28.0.0",
okhttpinterceptor : "com.squareup.okhttp3:logging-interceptor:3.12.0",
// fresco
fresco : 'com.facebook.fresco:fresco:1.9.0',
// 公司服务 - 语音
aiassist : "com.zhidaoauto.common:service:1.0.8.4",
// 语音替换方案 暂时只用TTS 解决焦点问题
aiassistReplace : "com.zhidao.mogoVoicesdk:voice:1.0.5",
// 公司服务 - 埋点
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",
retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0",
// leakcanary
leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.5.4',
leakcanarynoop : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4',
// add for room
room : "android.arch.persistence.room:runtime:1.1.1",
roomAnnotationProcessor : 'android.arch.persistence.room:compiler:1.1.1',
// rxjava2 with room
roomRxjava : "android.arch.persistence.room:rxjava2:1.1.1",
// material
material : 'com.google.android.material:material:1.1.0',
indicator : 'com.github.zhpanvip:viewpagerindicator:1.0.4',
//
jetbrainsannotationsjava5 : "org.jetbrains:annotations-java5:15.0",
// 统一登录
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.18",
// crash
crashSdk : "com.zhidaoauto.crash.log:library:1.0.5",
//探路
videoarmv7 : "com.shuyu:gsyVideoPlayer-armv7a:7.1.2",
videoarm64 : "com.shuyu:gsyVideoPlayer-arm64:7.1.2",
videojava : "com.shuyu:gsyVideoPlayer-java:7.1.2",
eventbus : "org.greenrobot:eventbus:3.1.1",
videoprocessor : "com.zhidao.video:video-processor:1.0.2.1",
livesdk : "com.tencent.liteavsdk:LiteAVSDK_Smart:7.4.9211",
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3",
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3",
aspectj : "org.aspectj:aspectjrt:1.8.9",
adasapi : "com.zhidao.autopilot.support:adas:1.0.6.6",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5.2",
// 个人中心的SDK
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
// google
googlezxing : "com.google.zxing:core:3.3.3",
litezxing : "com.google.zxing:litezxing:1.0.29.8",
// android - room
androidxroomruntime : "androidx.room:room-runtime:2.2.3",
androidxroomcompiler : "androidx.room:room-compiler:2.2.3",
androidxroomktx : "androidx.room:room-ktx:2.2.3",
]
}

1
foudations/mogo-passport/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,29 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation rootProject.ext.dependencies.androidxappcompat
}

View File

@@ -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

View File

@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.cloud.passport">
/
</manifest>

View File

@@ -1,2 +1,3 @@
include ':foudations:mogo-passport'
include ':app'
rootProject.name = "MoGoAiCloudSdk"