From 4c07709a502bf971402c80958c7adcf1305c3448 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Wed, 27 Sep 2023 17:54:37 +0800 Subject: [PATCH] [3.4.0-map-sdk] --- build.gradle | 12 +-- codequality/detekt.gradle | 26 ++++-- codequality/detekt.yml | 26 +++--- codequality/pmd.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../com/autonavi/nge/dm/INavigationCore.aidl | 85 ------------------- .../map/sdk/inner/map/MapController.kt | 6 +- 7 files changed, 44 insertions(+), 115 deletions(-) delete mode 100644 libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl diff --git a/build.gradle b/build.gradle index 40ba76905b..190f5f0714 100644 --- a/build.gradle +++ b/build.gradle @@ -74,14 +74,14 @@ allprojects { } if (isCodeInspectEnable ) { -// def basePath = new File(codequality, 'code_inspect_increment.gradle').path -// apply from: "$basePath" -// def pmdPath = new File(codequality, 'pmd.gradle').path -// apply from: "$pmdPath" + def basePath = new File(codequality, 'code_inspect_increment.gradle').path + apply from: "$basePath" + def pmdPath = new File(codequality, 'pmd.gradle').path + apply from: "$pmdPath" def detektPath = new File(codequality, 'detekt.gradle').path apply from: "$detektPath" -// def codeInspectPath = new File(codequality, 'code_inspect.gradle').path -// apply from: "$codeInspectPath" + def codeInspectPath = new File(codequality, 'code_inspect.gradle').path + apply from: "$codeInspectPath" } } diff --git a/codequality/detekt.gradle b/codequality/detekt.gradle index 1129174a38..e57ef8c5cc 100644 --- a/codequality/detekt.gradle +++ b/codequality/detekt.gradle @@ -1,6 +1,6 @@ apply plugin: 'io.gitlab.arturbosch.detekt' -def pmdConfigPath = rootProject.file("codequality").path +def configPath = rootProject.file("codequality").path detekt { toolVersion = "1.15.0" @@ -10,13 +10,13 @@ detekt { "src/driverm1/java" ) //将配置文件应用于detekt的默认配置文件之上 - buildUponDefaultConfig = true + buildUponDefaultConfig = false //规则集 - config.setFrom("${pmdConfigPath}/detekt.yml") + config.setFrom("${configPath}/detekt.yml") //指定基准文件。在detekt的后续运行中,所有发现都存储在此文件中 -// baseline = file("${pmdConfigPath}/baseline.xml") - +// baseline = file("${configPath}/baseline.xml") + ignoreFailures = true // Android: Don't create tasks for the specified build types (e.g. "release") // ignoredBuildTypes = ["release"] // Android: Don't create tasks for the specified build flavor (e.g. "production") @@ -25,7 +25,7 @@ detekt { // ignoredVariants = ["productionRelease"] } -tasks.detekt.jvmTarget = "1.11" +tasks.detekt.jvmTarget = "1.8" tasks.named("detekt").configure { reports { @@ -33,7 +33,21 @@ tasks.named("detekt").configure { html { enabled = true // Path where HTML report will be stored (default: `build/reports/detekt/detekt.html`) + destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.xml") + } + xml { + enabled = true destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.html") } + txt { + enabled = false +// destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.txt") + } + sarif { + // Enable/Disable SARIF report (default: false) + enabled = true + // Path where SARIF report will be stored (default: `build/reports/detekt/detekt.sarif`) + destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.sarif") + } } } diff --git a/codequality/detekt.yml b/codequality/detekt.yml index 492f87f811..327c7525c2 100644 --- a/codequality/detekt.yml +++ b/codequality/detekt.yml @@ -287,12 +287,12 @@ exceptions: exceptionNames: - 'ArrayIndexOutOfBoundsException' - 'Error' - - 'Exception' +# - 'Exception' - 'IllegalMonitorStateException' - 'IndexOutOfBoundsException' - 'NullPointerException' - 'RuntimeException' - - 'Throwable' +# - 'Throwable' allowedExceptionNameRegex: '_|(ignore|expected).*' TooGenericExceptionThrown: #规则报告类型过于通用的抛出异常。对于当前发生的情况,最好抛出特定的异常 active: true @@ -545,8 +545,8 @@ style: active: false DataClassContainsFunctions: active: false - conversionFunctionPrefix: - - 'to' +# conversionFunctionPrefix: +# - 'to' # allowOperators: false DataClassShouldBeImmutable: active: false @@ -623,7 +623,7 @@ style: active: true ignoreOverridableFunction: true # ignoreActualFunction: true - excludedFunctions: [] +# excludedFunctions: [] LoopWithTooManyJumpStatements: active: true maxJumpCount: 1 @@ -695,14 +695,14 @@ style: active: true RedundantVisibilityModifierRule: active: false - ReturnCount: #在一个函数中有许多出口点可能会造成混乱,并影响代码的可读性。 - active: true - max: 2 - excludedFunctions: - - 'equals' - excludeLabeled: false - excludeReturnFromLambda: true - excludeGuardClauses: false +# ReturnCount: #在一个函数中有许多出口点可能会造成混乱,并影响代码的可读性。 +# active: false +# max: 2 +# excludedFunctions: +# - 'equals' +# excludeLabeled: false +# excludeReturnFromLambda: false +# excludeGuardClauses: false SafeCast: active: true SerialVersionUIDInSerializableClass: diff --git a/codequality/pmd.gradle b/codequality/pmd.gradle index 359264c4ee..3f2524f724 100644 --- a/codequality/pmd.gradle +++ b/codequality/pmd.gradle @@ -4,7 +4,7 @@ def pmdConfigPath = rootProject.file("codequality").path task pmd(type:Pmd){ //忽略失败,如果设置为true,检测出bug会停止task - ignoreFailures = false + ignoreFailures = true consoleOutput = true //filter路径 ruleSetFiles = files("${pmdConfigPath}/custom-pmd-ruleset.xml") //新增rules diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 050b1a2bf7..b850a7a179 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Sep 22 11:53:55 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl b/libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl deleted file mode 100644 index bea7074392..0000000000 --- a/libraries/mapmodule/src/main/aidl/com/autonavi/nge/dm/INavigationCore.aidl +++ /dev/null @@ -1,85 +0,0 @@ -//package com.autonavi.nge.dm; -// -//import android.os.IBinder; -//import com.autonavi.nge.guidance.RouteBook; -//import com.autonavi.nge.guidance.NaviInfo; -//import com.autonavi.nge.guidance.RouteImage; -//import com.autonavi.nge.guidance.LaneMask; -//import com.autonavi.nge.obj.Category; -//import com.autonavi.nge.obj.UpdateRegion; -//import com.autonavi.nge.trafficInfo.TMCID; -//import com.autonavi.nge.search.SPPoiItem; -//import com.autonavi.nge.search.SPCategories; -//import com.autonavi.nge.search.SPQuery; -//import com.autonavi.nge.search.SPSearchResult; -//import com.autonavi.nge.map.LonLat; -//import com.autonavi.nge.guidance.GuidanceStatListener; -//interface INavigationCore { -//// IBinder getHandler(); -// void Routing_SetOrigin(float lon, float lat, int sessionid); -// void Routing_SetDest(float lon, float lat, int sessionid); -// void Routing_GetRoute(int sessionid); -// boolean Routing_GetStatus(int sessionid); -// void Routing_Reset(int sessionid); -// void Routing_ClearTour(int sessionid); -// void RoutingSetCostModel(int model, int sessionid); -// void RoutingSetAvoidHighway(boolean isAvoidHighway, int sessionid); -// void RoutingSetAvoidToll(boolean isAvoidToll, int sessionid); -// -// void Traffic_Update(in List ids, int evt); -// void Traffic_UpdateByTile(int tile, in int[] ids, in byte[] speeds); -// void RoutingSetUseTraffic(boolean useTraffic, int sessionid); -// int RoutingGetRouteNum(int sessionid); -// int RoutingGetLength(int route, int sessionid); -// int RoutingGetSTime(int route, int sessionid); -// int RoutingGetDTime(int route, int sessionid); -// void addwaypoint(float lon, float lat, int heading, int sessionid); -// void clearwaypoints(int sessionid); -// -// void Guidance_UpdatePosition(float lon, float lat, float speed, float heading); -// void Guidance_StartNavi(int type); -// void Guidance_StopNavi(); -// void Guidance_SetSimSpeed(int speed); -// void Guidance_PauseSimNavi(); -// void Guidance_ResumeSimNavi(); -// RouteBook Guidance_RouteBook(int session,int start,int end); -// NaviInfo Guidance_NaviInfo(); -// NaviInfo GetNaviInfo(in byte[] datas); -// String Guidance_TTS(); -// RouteImage Guidance_Image(int imageUr,int imageBg,int imageArrow,int type); -// LaneMask Guidance_LaneMask(); -// double Guidance_getRoadAngle(); -// -// List Search_getSearchResult(int productId, double lon, double lat, double radius, int kindfilter, int updateregionId, String keyWord, int pageIdx, int searchType); -// SPPoiItem getPoiItemByPoiId(int poiId); -// List getPoiItemListByLonLat(int prodId, int urId, float lon, float lat, int pageCount, int pageIdx); -// List queryPoiItemByCircle(float centerLon,float centerLat,float radius); -// List queryPoiItemByRect(float topLeftLon,float topLeftLat,float bottomRightLon,float bottomRightLat); -// List queryPoiItemByPolygon(in List latLonPoints); -// List getFTSDataByDA( int urid, String keyStr, int keytype, int maxResultCount); -// List getInputResult(int productId, int updateregionId, String inputStr); -// List getInputResultByDA(); -// List getCatList(int urid); -// List getURListByDA(int prodid); -// void play(String text,boolean forcePlay); -// -// int RoutingGetSearchedCnt(int route, int sessionid); -// -// int [] getMemoryInfo(); -// -// void startServer(); -// -// void stopServer(); -// -// int getMDSVersion(); -// String getDataVersion(); -// String getCopyRight(); -// String getCompilerVersion(); -// -// void onGuidanceStatusChanged(int statCode, in byte[] datas); -// -// void setGuidanceStatListener(GuidanceStatListener listener); -// -// SPCategories getAllPoiCategories(int languageCode); -// List getPoiItemList(in SPQuery query); -//} diff --git a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt index be37e8c49a..6087b945b2 100644 --- a/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt +++ b/libraries/mapmodule/src/main/java/com/zhidaoauto/map/sdk/inner/map/MapController.kt @@ -1025,7 +1025,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie val data = polylineOptions.lonLats var polyline: Polyline? = null try { - if (data == null || data.size <= 1) { + if (data.size <= 1) { throw RuntimeException("传入的坐标数必须大于1") } val strOptionsJson = JSON.toJSONString(polylineOptions) @@ -1054,7 +1054,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie val colorSize = colorValues?.size ?: 0 var polyline: Polyline? = null try { - if (data == null || data.size <= 1) { + if (data.size <= 1) { throw RuntimeException("传入的坐标数必须大于1") } if (polylineOptions.getIsGradient() && colorSize > data.size) { @@ -1090,7 +1090,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie val data = deadZoneOptions.getPosition() var deadZone: DeadZone? = null try { - if (data == null || data.size <= 1) { + if (data.size <= 1) { throw RuntimeException("传入的坐标数必须大于1") } val strOptionsJson = JSON.toJSONString(deadZoneOptions)