From 6e92b30a9a9b871b24cdbff0c169536e89fe6d26 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Tue, 10 May 2022 19:14:31 +0800 Subject: [PATCH] =?UTF-8?q?[change]=E5=B0=86ADAS=20LIB=20=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=88=B0Maven=E7=94=A8=E4=BA=8E=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=B5=8B=E8=AF=95=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_ipc_monitoring/build.gradle | 9 +++- gradle.properties | 12 +++++ libraries/mogo-adas-data/build.gradle | 24 +++++++++ libraries/mogo-adas/build.gradle | 71 ++++++++++++++------------- 4 files changed, 81 insertions(+), 35 deletions(-) diff --git a/app_ipc_monitoring/build.gradle b/app_ipc_monitoring/build.gradle index f0a7388877..186dfe1d94 100644 --- a/app_ipc_monitoring/build.gradle +++ b/app_ipc_monitoring/build.gradle @@ -18,6 +18,11 @@ android { //解决编译时com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/rxjava.properties'这个错误 exclude 'META-INF/rxjava.properties' } + externalNativeBuild { + ndk { + abiFilters 'armeabi-v7a', 'arm64-v8a' + } + } } buildTypes { @@ -64,7 +69,9 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' implementation rootProject.ext.dependencies.gson implementation project(':libraries:mogo-adas') - implementation project(':core:mogo-core-data') +// implementation 'com.zhidao.support.adas:high:2.6.6.0' +// implementation 'com.zhjt.mogo.adas.data:adas-data:2.6.6.0' + compileOnly project(':core:mogo-core-data') implementation project(':core:mogo-core-utils') implementation 'org.greenrobot:eventbus:3.2.0' implementation 'com.android.support:multidex:1.0.3' diff --git a/gradle.properties b/gradle.properties index 9a8b2ff92b..6e1c82fba7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -157,3 +157,15 @@ MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.16.10 # v2x-sdk MOGO_V2X_SDK_VERSION=1.3.55 ################# 旧版本架构模块版本 ################# + + + + +# ADAS LIB Maven配置(用于地图部门测试使用,鹰眼项目中使用本地依赖) # +ADAS_LIB_GROUP=com.zhidao.support.adas +ADAS_LIB_POM_ARTIFACT_ID=high +ADAS_LIB_CHILD_VERSION=.0 + +ADAS_DATA_LIB_GROUP=com.zhjt.mogo.adas.data +ADAS_DATA_LIB_POM_ARTIFACT_ID=adas-data +ADAS_DATA_LIB_CHILD_VERSION=.0 diff --git a/libraries/mogo-adas-data/build.gradle b/libraries/mogo-adas-data/build.gradle index 3185235483..5ca64748fd 100644 --- a/libraries/mogo-adas-data/build.gradle +++ b/libraries/mogo-adas-data/build.gradle @@ -2,6 +2,7 @@ plugins { id 'com.android.library' id 'kotlin-android' id 'com.google.protobuf' + id 'maven' } android { @@ -60,4 +61,27 @@ android { dependencies { api rootProject.ext.dependencies.protobuf_java api rootProject.ext.dependencies.protobuf_java_util +} + +task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} +//配置需要上传到maven仓库的文件 +artifacts { + archives androidSourcesJar +} + +uploadArchives { + repositories.mavenDeployer { + repository(url: RELEASE_REPOSITORY_URL) { + authentication(userName: USERNAME, password: PASSWORD) + } + snapshotRepository(url: SNAPSHOT_REPOSITORY_URL) { + authentication(userName: USERNAME, password: PASSWORD) + } + pom.groupId = ADAS_DATA_LIB_GROUP + pom.artifactId = ADAS_DATA_LIB_POM_ARTIFACT_ID + pom.version = versionName + ADAS_DATA_LIB_CHILD_VERSION + } } \ No newline at end of file diff --git a/libraries/mogo-adas/build.gradle b/libraries/mogo-adas/build.gradle index adc3b97ecb..ef6631552f 100644 --- a/libraries/mogo-adas/build.gradle +++ b/libraries/mogo-adas/build.gradle @@ -1,7 +1,7 @@ plugins { id 'com.android.library' id 'com.google.protobuf' -// id 'maven' + id 'maven' } //ext { // //自动驾驶产品版本号 @@ -22,11 +22,6 @@ android { versionName rootProject.versionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' - externalNativeBuild { - ndk { - abiFilters 'armeabi-v7a', 'arm64-v8a' - } - } } buildTypes { @@ -77,6 +72,7 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp:3.12.3' // parser implementation rootProject.ext.dependencies.gson + implementation project(':libraries:mogo-adas-data') // logger //implementation 'com.orhanobut:logger:2.2.0' //ProtoBuf @@ -86,33 +82,40 @@ dependencies { // api project(path: ':lib_recorder') // api "com.zhidao.support.recorder:recorder:1.0.0.3" - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation project(':libraries:mogo-adas-data') - } else { - implementation project(':libraries:mogo-adas-data') - } } -//task androidSourcesJar(type: Jar) { -// classifier = 'sources' -// from android.sourceSets.main.java.srcDirs -//} -////配置需要上传到maven仓库的文件 -//artifacts { -// archives androidSourcesJar -//} -// -//uploadArchives { -// repositories.mavenDeployer { -// repository(url: RELEASE_REPO_URL) { -// authentication(userName: NAME, password: PASSWORD) -// } -// snapshotRepository(url: SNAPSHOT_REPOSITORY_URL) { -// authentication(userName: NAME, password: PASSWORD) -// } -// pom.groupId = GROUP -// pom.artifactId = POM_ARTIFACT_ID -// pom.version = VERSION -// } -//} \ No newline at end of file +task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} +//配置需要上传到maven仓库的文件 +artifacts { + archives androidSourcesJar +} + +uploadArchives { + repositories.mavenDeployer { + repository(url: RELEASE_REPOSITORY_URL) { + authentication(userName: USERNAME, password: PASSWORD) + } + snapshotRepository(url: SNAPSHOT_REPOSITORY_URL) { + authentication(userName: USERNAME, password: PASSWORD) + } + pom.groupId = ADAS_LIB_GROUP + pom.artifactId = ADAS_LIB_POM_ARTIFACT_ID + pom.version = versionName + ADAS_LIB_CHILD_VERSION + pom.whenConfigured { pom -> + pom.dependencies.forEach { dep -> + if (dep.getVersion() == "unspecified") { + println("--修改pom.xml中的dependies模块--->>" + dep.getArtifactId()) + if (dep.getArtifactId() == ADAS_DATA_LIB_POM_ARTIFACT_ID) { + dep.setGroupId(ADAS_DATA_LIB_GROUP) + dep.setVersion(versionName + ADAS_DATA_LIB_CHILD_VERSION) + } + } + + } + + } + } +} \ No newline at end of file