From 151a155d25816d21beda89656938bfb1671ffcac Mon Sep 17 00:00:00 2001 From: fmy <635555698@qq.com> Date: Sat, 1 May 2021 15:25:46 +0800 Subject: [PATCH 1/6] Fixed the incremental invalidation of the annotation processor --- .../META-INF/gradle/incremental.annotation.processors | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arouter-compiler/src/main/resources/META-INF/gradle/incremental.annotation.processors b/arouter-compiler/src/main/resources/META-INF/gradle/incremental.annotation.processors index c435aa2b..d7107041 100644 --- a/arouter-compiler/src/main/resources/META-INF/gradle/incremental.annotation.processors +++ b/arouter-compiler/src/main/resources/META-INF/gradle/incremental.annotation.processors @@ -1,3 +1,3 @@ -com.alibaba.android.arouter.compiler.processor.RouteProcessor,isolating -com.alibaba.android.arouter.compiler.processor.AutowiredProcessor,isolating -com.alibaba.android.arouter.compiler.processor.InterceptorProcessor,isolating +com.alibaba.android.arouter.compiler.processor.RouteProcessor,aggregating +com.alibaba.android.arouter.compiler.processor.AutowiredProcessor,aggregating +com.alibaba.android.arouter.compiler.processor.InterceptorProcessor,aggregating From c10c1355c930080408db16439769d5fcb69de30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A3=E7=BA=AC?= Date: Thu, 17 Jun 2021 16:25:40 +0800 Subject: [PATCH 2/6] Migrate from jcenter to mavenCentral and release 1.5.2 --- README.md | 6 +- README_CN.md | 10 +- arouter-annotation/build.gradle | 17 +-- arouter-annotation/gradle.properties | 5 + arouter-api/build.gradle | 13 +- arouter-api/gradle.properties | 5 + arouter-compiler/build.gradle | 11 +- arouter-compiler/gradle.properties | 5 + arouter-gradle-plugin/build.gradle | 11 +- arouter-gradle-plugin/gradle.properties | 5 + bintray.gradle | 61 --------- build.gradle | 11 +- gradle.properties | 31 ++--- gradle/publish.gradle | 174 ++++++++++++++++++++++++ install.gradle | 44 ------ 15 files changed, 230 insertions(+), 179 deletions(-) create mode 100644 arouter-annotation/gradle.properties create mode 100644 arouter-api/gradle.properties create mode 100644 arouter-compiler/gradle.properties create mode 100644 arouter-gradle-plugin/gradle.properties delete mode 100644 bintray.gradle create mode 100644 gradle/publish.gradle delete mode 100644 install.gradle diff --git a/README.md b/README.md index 481fe2b6..27a59803 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ module|arouter-api|arouter-compiler|arouter-register|arouter-idea-plugin ---|---|---|---|--- -version|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-api/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-compiler/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-compiler/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-register/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-register/_latestVersion)|[![as plugin](https://img.shields.io/jetbrains/plugin/d/11428-arouter-helper.svg)](https://plugins.jetbrains.com/plugin/11428-arouter-helper) +version|[![Download](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-api)|[![Download](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-compiler/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-compiler)|[![Download](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-register/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-register)|[![as plugin](https://img.shields.io/jetbrains/plugin/d/11428-arouter-helper.svg)](https://plugins.jetbrains.com/plugin/11428-arouter-helper) #### Demo @@ -117,7 +117,7 @@ version|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/ buildscript { repositories { - jcenter() + mavenCentral() } dependencies { @@ -493,7 +493,7 @@ annotation,**Only the routing information of the same group can be registered buildscript { repositories { - jcenter() + mavenCentral() } dependencies { diff --git a/README_CN.md b/README_CN.md index 2f1778ee..8fe0dcb6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -12,7 +12,7 @@ 模块|arouter-api|arouter-compiler|arouter-register|arouter-idea-plugin ---|---|---|---|--- -最新版本|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-api/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-compiler/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-compiler/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-register/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-register/_latestVersion)|[![as plugin](https://img.shields.io/jetbrains/plugin/d/11428-arouter-helper.svg)](https://plugins.jetbrains.com/plugin/11428-arouter-helper) +最新版本|[![Download](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-api)|[![Download](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-compiler/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-compiler)|[![Download](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-register/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/arouter-register)|[![as plugin](https://img.shields.io/jetbrains/plugin/d/11428-arouter-helper.svg)](https://plugins.jetbrains.com/plugin/11428-arouter-helper) #### Demo展示 @@ -119,7 +119,7 @@ buildscript { repositories { - jcenter() + mavenCentral() } dependencies { @@ -534,17 +534,17 @@ buildscript { repositories { - jcenter() + mavenCentral() } dependencies { - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' + classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' } } apt { arguments { - AROUTER_MODULE_NAME project.getName(); + AROUTER_MODULE_NAME project.getName(); } } diff --git a/arouter-annotation/build.gradle b/arouter-annotation/build.gradle index b0863590..2c1c2519 100644 --- a/arouter-annotation/build.gradle +++ b/arouter-annotation/build.gradle @@ -1,17 +1,8 @@ apply plugin: 'java' -ext { - bintrayName = 'arouter-annotation' - artifact = bintrayName - libraryName = 'ARouter annotation' - libraryDescription = 'The annotation used in arouter api' - libraryVersion = arouter_annotation_version +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } -compileJava { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' -} - -apply from: '../install.gradle' -apply from: '../bintray.gradle' \ No newline at end of file +apply from: rootProject.file('gradle/publish.gradle') \ No newline at end of file diff --git a/arouter-annotation/gradle.properties b/arouter-annotation/gradle.properties new file mode 100644 index 00000000..2b89f853 --- /dev/null +++ b/arouter-annotation/gradle.properties @@ -0,0 +1,5 @@ +POM_NAME=ARouter Annotations +POM_ARTIFACT_ID=arouter-annotation +POM_PACKAGING=jar +POM_DESCRIPTION=The annotation used in arouter api +VERSION_NAME=1.0.6 \ No newline at end of file diff --git a/arouter-api/build.gradle b/arouter-api/build.gradle index c4f3b597..62afaf73 100644 --- a/arouter-api/build.gradle +++ b/arouter-api/build.gradle @@ -1,13 +1,5 @@ apply plugin: 'com.android.library' -ext { - bintrayName = 'arouter-api' - artifact = bintrayName - libraryName = 'ARouter sdk' - libraryDescription = 'A router for android' - libraryVersion = arouter_main_version -} - android { compileSdkVersion Integer.parseInt(COMPILE_SDK_VERSION) buildToolsVersion BUILDTOOLS_VERSION @@ -39,10 +31,9 @@ android { } dependencies { - annotationProcessor 'com.alibaba:arouter-compiler:1.5.1' + annotationProcessor 'com.alibaba:arouter-compiler:1.5.2' api 'com.alibaba:arouter-annotation:1.0.6' implementation "com.android.support:support-v4:${SUPPORT_LIB_VERSION}" } -apply from: '../install.gradle' -apply from: '../bintray.gradle' \ No newline at end of file +apply from: rootProject.file('gradle/publish.gradle') \ No newline at end of file diff --git a/arouter-api/gradle.properties b/arouter-api/gradle.properties new file mode 100644 index 00000000..e3ebdc12 --- /dev/null +++ b/arouter-api/gradle.properties @@ -0,0 +1,5 @@ +POM_NAME=ARouter SDK +POM_ARTIFACT_ID=arouter-api +POM_PACKAGING=aar +POM_DESCRIPTION=Route framework for android +VERSION_NAME=1.5.2 \ No newline at end of file diff --git a/arouter-compiler/build.gradle b/arouter-compiler/build.gradle index ed33584d..198766d4 100644 --- a/arouter-compiler/build.gradle +++ b/arouter-compiler/build.gradle @@ -1,13 +1,5 @@ apply plugin: 'java' -ext { - bintrayName = 'arouter-compiler' - artifact = bintrayName - libraryName = 'ARouter compiler' - libraryDescription = 'A compiler for ARouter to find route' - libraryVersion = arouter_main_version -} - compileJava { sourceCompatibility = '1.8' targetCompatibility = '1.8' @@ -27,5 +19,4 @@ dependencies { implementation 'com.alibaba:fastjson:1.2.69' } -apply from: '../install.gradle' -apply from: '../bintray.gradle' \ No newline at end of file +apply from: rootProject.file('gradle/publish.gradle') \ No newline at end of file diff --git a/arouter-compiler/gradle.properties b/arouter-compiler/gradle.properties new file mode 100644 index 00000000..07527010 --- /dev/null +++ b/arouter-compiler/gradle.properties @@ -0,0 +1,5 @@ +POM_NAME=ARouter Compiler +POM_ARTIFACT_ID=arouter-compiler +POM_PACKAGING=jar +POM_DESCRIPTION=Compiler for ARouter to find route +VERSION_NAME=1.5.2 \ No newline at end of file diff --git a/arouter-gradle-plugin/build.gradle b/arouter-gradle-plugin/build.gradle index cb24fd3a..0fa7f0f1 100644 --- a/arouter-gradle-plugin/build.gradle +++ b/arouter-gradle-plugin/build.gradle @@ -1,13 +1,5 @@ apply plugin: 'groovy' -ext { - bintrayName = 'arouter-register' - artifact = bintrayName - libraryName = 'ARouter register gradle plugin' - libraryDescription = 'A gradle plugin used for arouter route map register' - libraryVersion = arouter_register_version -} - dependencies { compile gradleApi() compile localGroovy() @@ -17,5 +9,4 @@ dependencies { compile 'com.android.tools.build:gradle:2.1.3' } -apply from: '../install.gradle' -apply from: '../bintray.gradle' \ No newline at end of file +apply from: rootProject.file('gradle/publish.gradle') \ No newline at end of file diff --git a/arouter-gradle-plugin/gradle.properties b/arouter-gradle-plugin/gradle.properties new file mode 100644 index 00000000..e03a4da7 --- /dev/null +++ b/arouter-gradle-plugin/gradle.properties @@ -0,0 +1,5 @@ +POM_NAME=ARouter Register +POM_ARTIFACT_ID=arouter-register +POM_PACKAGING=jar +POM_DESCRIPTION=Gradle plugin used for arouter route map register +VERSION_NAME=1.0.2 \ No newline at end of file diff --git a/bintray.gradle b/bintray.gradle deleted file mode 100644 index d49f042c..00000000 --- a/bintray.gradle +++ /dev/null @@ -1,61 +0,0 @@ -// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle] - -apply plugin: 'com.jfrog.bintray' - -version = libraryVersion - -if (project.hasProperty("android")) { // Android libraries - task sourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - } - - task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - } -} else { // Java libraries - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource - } -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -artifacts { -// archives javadocJar - archives sourcesJar -} - -// Bintray -Properties properties = new Properties() -properties.load(project.rootProject.file('local.properties').newDataInputStream()) - -bintray { - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") - - configurations = ['archives'] - pkg { - repo = bintrayRepo - name = bintrayName - desc = libraryDescription - websiteUrl = siteUrl - vcsUrl = gitUrl - licenses = allLicenses - publish = true - publicDownloadNumbers = true - version { - desc = libraryDescription - gpg { - sign = true //Determines whether to GPG sign the files. The default is false - passphrase = properties.getProperty("bintray.gpg.password") - //Optional. The passphrase for GPG signing' - } - } - } -} diff --git a/build.gradle b/build.gradle index b83980e7..8cfd44da 100644 --- a/build.gradle +++ b/build.gradle @@ -3,21 +3,16 @@ buildscript { ext.arouter_register_version = '1.0.2' repositories { - maven { - url "https://oss.sonatype.org/content/repositories/snapshots/" - } maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' } mavenCentral() - jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:4.1.1' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.alibaba:arouter-register:$arouter_register_version" @@ -26,7 +21,11 @@ buildscript { allprojects { repositories { - jcenter() + mavenLocal() + mavenCentral() + maven { + url "https://s01.oss.sonatype.org/content/repositories/releases/" + } google() } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1a2f22b1..c07b94c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,21 +24,20 @@ SUPPORT_LIB_VERSION=28.0.0 MIN_SDK_VERSION=14 TARGET_SDK_VERSION=28 -arouter_main_version=1.5.2 -arouter_annotation_version=1.0.6 -arouter_register_version=1.0.2 -arouter_idea_plugin_version=1.0.0 -support_idea_version=2016.2.5 -arouter_idea_plugin_name=ARouter Road Sign +GROUP=com.alibaba + +POM_URL=https://github.com/Alibaba/ARouter/ +POM_SCM_URL=https://github.com/Alibaba/ARouter/ +POM_SCM_CONNECTION=scm:git:git://github.com/Alibaba/ARouter.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Alibaba/ARouter.git -bintrayRepo=maven -publishedGroupId=com.alibaba -siteUrl=https://github.com/Alibaba/ARouter -gitUrl=https://github.com/Alibaba/ARouter.git -developerId=zhi1ong -developerName=zhilong.liu -developerEmail=zhilong.liu@aliyun.com +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo -licenseName=The Apache Software License, Version 2.0 -licenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt -allLicenses=["Apache-2.0"] \ No newline at end of file +POM_DEVELOPER_ID=zhi1ong +POM_DEVELOPER_NAME=ZhiLong Liu + +arouter_idea_plugin_version=1.0.0 +support_idea_version=2016.2.5 +arouter_idea_plugin_name=ARouter Road Sign \ No newline at end of file diff --git a/gradle/publish.gradle b/gradle/publish.gradle new file mode 100644 index 00000000..bd95c563 --- /dev/null +++ b/gradle/publish.gradle @@ -0,0 +1,174 @@ +/* + * Copyright 2013 Chris Banes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'maven' +apply plugin: 'signing' + +version = VERSION_NAME +group = GROUP + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://s01.oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : "" +} + +def getRepositoryPassword() { + return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : "" +} + +def configurePom(pom) { + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + configurePom(pom) + } + } + } + + tasks.create("installLocally", Upload) { + configuration = configurations.archives + + repositories { + mavenDeployer { + repository(url: "file://${rootProject.buildDir}/localMaven") + + configurePom(pom) + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + if (project.getPlugins().hasPlugin('com.android.application') || + project.getPlugins().hasPlugin('com.android.library')) { + task install(type: Upload, dependsOn: assemble) { + repositories.mavenInstaller { + configuration = configurations.archives + + configurePom(pom) + } + } + + task androidJavadocs(type: Javadoc) { + source = android.sourceSets.main.java.source + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + } + + task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + classifier = 'javadoc' + from androidJavadocs.destinationDir + } + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.source + } + } else { + install { + repositories.mavenInstaller { + configurePom(pom) + } + } + + task sourcesJar(type: Jar, dependsOn:classes) { + classifier = 'sources' + from sourceSets.main.allSource + } + + task javadocJar(type: Jar, dependsOn:javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir + } + } + + if (JavaVersion.current().isJava8Compatible()) { + allprojects { + tasks.withType(Javadoc) { + options.addStringOption('Xdoclint:none', '-quiet') + } + } + } + + artifacts { + if (project.getPlugins().hasPlugin('com.android.application') || + project.getPlugins().hasPlugin('com.android.library')) { + archives androidSourcesJar + archives androidJavadocsJar + } else { + archives sourcesJar + archives javadocJar + } + } +} diff --git a/install.gradle b/install.gradle deleted file mode 100644 index c4b0405c..00000000 --- a/install.gradle +++ /dev/null @@ -1,44 +0,0 @@ -// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle] - -apply plugin: 'com.github.dcendents.android-maven' - -group = publishedGroupId - -install { - repositories.mavenInstaller { - // This generates POM.xml with proper parameters - pom { - project { - packaging 'aar' - groupId publishedGroupId - artifactId artifact - - // Add your description here - name libraryName - description libraryDescription - url siteUrl - - // Set your license - licenses { - license { - name licenseName - url licenseUrl - } - } - developers { - developer { - id developerId - name developerName - email developerEmail - } - } - scm { - connection gitUrl - developerConnection gitUrl - url siteUrl - - } - } - } - } -} From 011530d1095935a2db165380ebaa1e526f2b4e16 Mon Sep 17 00:00:00 2001 From: jaydroid1024 Date: Tue, 22 Jun 2021 09:28:03 +0800 Subject: [PATCH 3/6] Fixed a comment error, because it's easy to cause trouble for code watcher --- .../compiler/processor/InterceptorProcessor.java | 14 +++++++------- .../arouter/demo/module1/TestInterceptor90.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/InterceptorProcessor.java b/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/InterceptorProcessor.java index d87fde27..69ac960b 100644 --- a/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/InterceptorProcessor.java +++ b/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/InterceptorProcessor.java @@ -77,9 +77,9 @@ public boolean process(Set annotations, RoundEnvironment } /** - * Parse tollgate. + * Parse interceptor. * - * @param elements elements of tollgate. + * @param elements elements of interceptor. */ private void parseInterceptors(Set elements) throws IOException { if (CollectionUtils.isNotEmpty(elements)) { @@ -108,20 +108,20 @@ private void parseInterceptors(Set elements) throws IOExcepti } // Interface of ARouter. - TypeElement type_ITollgate = elementUtils.getTypeElement(IINTERCEPTOR); - TypeElement type_ITollgateGroup = elementUtils.getTypeElement(IINTERCEPTOR_GROUP); + TypeElement type_IInterceptor = elementUtils.getTypeElement(IINTERCEPTOR); + TypeElement type_IInterceptorGroup = elementUtils.getTypeElement(IINTERCEPTOR_GROUP); /** * Build input type, format as : * - * ```Map>``` + * ```Map>``` */ ParameterizedTypeName inputMapTypeOfTollgate = ParameterizedTypeName.get( ClassName.get(Map.class), ClassName.get(Integer.class), ParameterizedTypeName.get( ClassName.get(Class.class), - WildcardTypeName.subtypeOf(ClassName.get(type_ITollgate)) + WildcardTypeName.subtypeOf(ClassName.get(type_IInterceptor)) ) ); @@ -148,7 +148,7 @@ private void parseInterceptors(Set elements) throws IOExcepti .addModifiers(PUBLIC) .addJavadoc(WARNING_TIPS) .addMethod(loadIntoMethodOfTollgateBuilder.build()) - .addSuperinterface(ClassName.get(type_ITollgateGroup)) + .addSuperinterface(ClassName.get(type_IInterceptorGroup)) .build() ).build().writeTo(mFiler); diff --git a/module-java/src/main/java/com/alibaba/android/arouter/demo/module1/TestInterceptor90.java b/module-java/src/main/java/com/alibaba/android/arouter/demo/module1/TestInterceptor90.java index 1883fde1..21789766 100644 --- a/module-java/src/main/java/com/alibaba/android/arouter/demo/module1/TestInterceptor90.java +++ b/module-java/src/main/java/com/alibaba/android/arouter/demo/module1/TestInterceptor90.java @@ -18,7 +18,7 @@ @Interceptor(priority = 90) public class TestInterceptor90 implements IInterceptor { /** - * The operation of this tollgate. + * The operation of this interceptor. * * @param postcard meta * @param callback cb From 64238e926888369518dd9d97d0d7432e945fc093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A3=E7=BA=AC?= Date: Tue, 22 Jun 2021 13:15:07 +0800 Subject: [PATCH 4/6] Trim brackets end of log if nobody called "printStackTrace()" --- .../alibaba/android/arouter/demo/MainActivity.java | 1 + .../android/arouter/utils/DefaultLogger.java | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/alibaba/android/arouter/demo/MainActivity.java b/app/src/main/java/com/alibaba/android/arouter/demo/MainActivity.java index 9590a902..89c38383 100644 --- a/app/src/main/java/com/alibaba/android/arouter/demo/MainActivity.java +++ b/app/src/main/java/com/alibaba/android/arouter/demo/MainActivity.java @@ -55,6 +55,7 @@ public void onClick(View v) { switch (v.getId()) { case R.id.openLog: ARouter.openLog(); +// ARouter.printStackTrace(); break; case R.id.openDebug: ARouter.openDebug(); diff --git a/arouter-api/src/main/java/com/alibaba/android/arouter/utils/DefaultLogger.java b/arouter-api/src/main/java/com/alibaba/android/arouter/utils/DefaultLogger.java index 882d3d46..e615b90e 100644 --- a/arouter-api/src/main/java/com/alibaba/android/arouter/utils/DefaultLogger.java +++ b/arouter-api/src/main/java/com/alibaba/android/arouter/utils/DefaultLogger.java @@ -98,11 +98,10 @@ public String getDefaultTag() { } public static String getExtInfo(StackTraceElement stackTraceElement) { - - String separator = " & "; - StringBuilder sb = new StringBuilder("["); - if (isShowStackTrace) { + String separator = " & "; + StringBuilder sb = new StringBuilder("["); + String threadName = Thread.currentThread().getName(); String fileName = stackTraceElement.getFileName(); String className = stackTraceElement.getClassName(); @@ -116,9 +115,11 @@ public static String getExtInfo(StackTraceElement stackTraceElement) { sb.append("ClassName=").append(className).append(separator); sb.append("MethodName=").append(methodName).append(separator); sb.append("LineNumber=").append(lineNumber); + + sb.append(" ] "); + return sb.toString(); } - sb.append(" ] "); - return sb.toString(); + return ""; } } \ No newline at end of file From 518d413569810195173fb92de12d9fc718e79c46 Mon Sep 17 00:00:00 2001 From: Knight-ZXW Date: Fri, 6 Aug 2021 11:54:49 +0800 Subject: [PATCH 5/6] fix DexArchiveMergeException occuurred in incremental build if the dependency library code has changed --- .../android/arouter/register/core/RegisterTransform.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/RegisterTransform.groovy b/arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/RegisterTransform.groovy index 17f696eb..c9325349 100644 --- a/arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/RegisterTransform.groovy +++ b/arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/RegisterTransform.groovy @@ -67,6 +67,10 @@ class RegisterTransform extends Transform { long startTime = System.currentTimeMillis() boolean leftSlash = File.separator == '/' + if (!isIncremental){ + outputProvider.deleteAll() + } + inputs.each { TransformInput input -> // scan all jars From 60e6b63c6d30beaaf46a6c1b031d49e0b952babc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A3=E7=BA=AC?= Date: Fri, 8 Jul 2022 13:41:52 +0800 Subject: [PATCH 6/6] remove bintray repo --- build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle b/build.gradle index 8cfd44da..3e9e12d0 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,6 @@ buildscript { ext.arouter_register_version = '1.0.2' repositories { - maven { - url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' - } mavenCentral() google() } @@ -23,9 +20,6 @@ allprojects { repositories { mavenLocal() mavenCentral() - maven { - url "https://s01.oss.sonatype.org/content/repositories/releases/" - } google() } } \ No newline at end of file