Skip to content

Commit

Permalink
Merge pull request #155 from chenenyu/dev
Browse files Browse the repository at this point in the history
1.7.5
  • Loading branch information
chenenyu authored Nov 18, 2020
2 parents 4ebfbd5 + d6123b2 commit 3ddd6f5
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.appcompat:appcompat:1.2.0"
implementation project(':module1')
implementation project(':module2')
testImplementation 'junit:junit:4.12'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.71'
ext.kotlin_version = '1.4.10'
repositories {
maven { url 'repo' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
if (Boolean.valueOf(applyRemotePlugin)) {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!Boolean.valueOf(applyRemotePlugin)) {
dependencies {
compile gradleApi()
compile localGroovy()
compile 'com.android.tools.build:gradle:3.6.3'
compile 'com.android.tools.build:gradle:4.0.0'
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
dependencies {
implementation gradleApi()
implementation localGroovy()
compileOnly 'com.android.tools.build:gradle:3.6.3'
compileOnly 'com.android.tools.build:gradle:4.0.0'
}

ext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ class RouterPlugin implements Plugin<Project> {
private static final String APT_OPTION_MODULE_NAME = "moduleName"
private static final String APT_OPTION_LOGGABLE = "loggable"

String DEFAULT_ROUTER_RUNTIME_VERSION = "1.7.4"
String DEFAULT_ROUTER_COMPILER_VERSION = "1.7.4"
String DEFAULT_ROUTER_RUNTIME_VERSION = "1.7.5"
String DEFAULT_ROUTER_COMPILER_VERSION = "1.7.5"

@Override
void apply(Project project) {
if (!project.plugins.hasPlugin(AppPlugin) // AppPlugin
&& !project.plugins.hasPlugin(LibraryPlugin) // LibraryPlugin
&& !project.plugins.hasPlugin(TestPlugin) // TestPlugin
&& !project.plugins.hasPlugin(InstantAppPlugin) // InstantAppPlugin, added in 3.0
&& !project.plugins.hasPlugin(FeaturePlugin) // FeaturePlugin, added in 3.0
&& !project.plugins.hasPlugin("com.android.dynamic-feature")) // DynamicFeaturePlugin, added in 3.2
if (!project.plugins.hasPlugin(AppPlugin) // com.android.application
&& !project.plugins.hasPlugin(LibraryPlugin) // com.android.library
&& !project.plugins.hasPlugin(TestPlugin) // com.android.test
&& !project.plugins.hasPlugin(DynamicFeaturePlugin)) // com.android.dynamic-feature, added in 3.2
{
throw new GradleException("android plugin required.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ class RouterTransform extends Transform {
return true
}

@Override
void transform(Context context,
Collection<TransformInput> inputs,
Collection<TransformInput> referencedInputs,
TransformOutputProvider outputProvider,
boolean isIncremental)
throws IOException, TransformException, InterruptedException {
}

@Override
void transform(TransformInvocation transformInvocation)
throws TransformException, InterruptedException, IOException {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ android.useAndroidX=true
# apply router plugin
applyRemotePlugin=false
# router gradle plugin version
PLUGIN_VERSION=1.7.4
PLUGIN_VERSION=1.7.5
# router library version
ROUTER_VERSION=1.7.4
ROUTER_VERSION=1.7.5
# compiler library version
COMPILER_VERSION=1.7.4
COMPILER_VERSION=1.7.5
# annotation library version
ANNOTATION_VERSION=0.5.0
83 changes: 10 additions & 73 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,92 +53,29 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
}

// handle aar artifact

// The following types/formats are supported:
// - Instances of MavenArtifact.
// - Instances of AbstractArchiveTask, for example jar.
// - Instances of PublishArtifact
// - Maps containing a 'source' entry, for example [source: '/path/to/file', extension: 'zip'].
// - Anything that can be converted to a file, as per Project.file()
def aarArtifact = null
if (isAndroidModule) {
if (project.ext.has('AAR')) {
aarArtifact = project.ext.AAR
} else {
project.afterEvaluate {
def bundleAarTask = project.tasks.findByPath('bundleRelease')
if (!bundleAarTask) {
bundleAarTask = project.tasks.findByPath('bundleReleaseAar') // gradle plugin 3.2
}
if (bundleAarTask && (bundleAarTask instanceof AbstractArchiveTask)) {
aarArtifact = bundleAarTask
}
if (!aarArtifact) {
throw new MissingPropertyException("Extra properties['AAR'] are required.")
}
}
}
}

def synchronized verifyDependency(Dependency it) {
return it.group != null && it.group != 'unspecified' && it.name != 'unspecified' &&
it.version != null && it.version != 'unspecified'
}

project.afterEvaluate {
publishing {
publications {
Bintray(MavenPublication) {
release(MavenPublication) {
groupId project.ext.GROUP
artifactId project.ext.ARTIFACT
version project.ext.VERSION

artifact sourcesJar
artifact javadocJar
if (isAndroidModule) {
artifact aarArtifact
from components.release
} else if (isJavaModule) {
from components.java
// artifact jar
}

pom {
if (isAndroidModule) {
packaging 'aar'
} else if (isJavaModule) {
packaging 'jar'
}
if (isAndroidModule) {
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.dependencies.each {
if (verifyDependency(it)) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
configurations.implementation.dependencies.each {
if (verifyDependency(it)) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
configurations.api.dependencies.each {
if (verifyDependency(it)) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
// pom {
// if (isAndroidModule) {
// packaging 'aar'
// } else if (isJavaModule) {
// packaging 'jar'
// }
// }
}
}
}
Expand All @@ -150,7 +87,7 @@ project.afterEvaluate {
bintray {
user = properties.containsKey('BINTRAY_USER') ? properties.get('BINTRAY_USER') : ""
key = properties.containsKey('BINTRAY_API_KEY') ? properties.get('BINTRAY_API_KEY') : ""
publications = ['Bintray']
publications = ['release']
publish = project.ext.has('PUBLISH') ? project.ext.PUBLISH : true
override = project.ext.has('OVERRIDE') ? project.ext.OVERRIDE : false
dryRun = project.ext.has('DRYRUN') ? project.ext.DRYRUN : false
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 28 18:52:44 CST 2020
#Wed Nov 18 11:23:42 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
8 changes: 4 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# annotation
./gradlew clean pBPTML -p annotation
./gradlew clean pRPTML -p annotation
./gradlew bintrayUpload -p annotation

# compiler
./gradlew clean pBPTML -p compiler
./gradlew clean pRPTML -p compiler
./gradlew bintrayUpload -p compiler

# router
./gradlew clean pBPTML -p router
./gradlew clean pRPTML -p router
./gradlew bintrayUpload -p router

# gradle-plugin
./gradlew clean pBPTML -p gradle-plugin
./gradlew clean pRPTML -p gradle-plugin
./gradlew bintrayUpload -p gradle-plugin
2 changes: 1 addition & 1 deletion router/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
compileOnly 'androidx.annotation:annotation:1.1.0'
compileOnly "androidx.fragment:fragment:1.2.4"
compileOnly "androidx.fragment:fragment:1.2.5"
// api project(':annotation')
api "com.chenenyu.router:annotation:${ANNOTATION_VERSION}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public RouteResponse intercept(Chain chain) {

// insert global interceptors in front of the queue
if (!Router.getGlobalInterceptors().isEmpty()) {
realChain.getInterceptors().addAll(index++, Router.getGlobalInterceptors());
realChain.getInterceptors().addAll(index, Router.getGlobalInterceptors());
index = Router.getGlobalInterceptors().size();
}

Set<String> finalInterceptors = new LinkedHashSet<>();
Expand Down

0 comments on commit 3ddd6f5

Please sign in to comment.