Skip to content

Commit 868b18f

Browse files
authored
Merge pull request #19 from wyjsonGo/develop
publish v2.1.1 修复Gradle生成文档任务存在多个变体失败bug
2 parents 4c9d363 + 3edd722 commit 868b18f

File tree

8 files changed

+31
-20
lines changed

8 files changed

+31
-20
lines changed

GoRouter-Gradle-Plugin/src/main/kotlin/com/wyjson/router/gradle_plugin/doc/GenerateRouteDocTask.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ abstract class GenerateRouteDocTask : DefaultTask() {
2828
fun taskAction() {
2929
Logger.i(TAG, "Generate GoRouter document task start.")
3030
project.dependProject().plus(project).forEach { curProject ->
31-
val genFile = curProject.file("${curProject.buildDir}/generated/ap_generated_sources/debug").listFiles()
31+
val genFile = curProject.file("${curProject.buildDir}/generated/ap_generated_sources").listFiles()
3232
val collection = curProject.files(genFile).asFileTree.filter { it.name.endsWith(Constants.DOCUMENT_FILE_NAME) }
3333
if (collection.isEmpty) {
3434
Logger.w(TAG, "project[${curProject.name}] scan 0 route document.")
3535
} else {
36-
for (file in collection) {
37-
Logger.i(TAG, "project[${curProject.name}] found the file[${file.name}].")
38-
mergeRouteModuleDoc(curProject, file)
39-
}
36+
val file = collection.first()
37+
Logger.i(TAG, "project[${curProject.name}] found the file[${file.name}].")
38+
mergeRouteModuleDoc(curProject, file)
4039
}
4140
}
4241
if (document == null) {

app/GoRouter-route-doc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@
8181
"type": "Activity",
8282
"pathClass": "com.wyjson.module_main.activity.MainActivity"
8383
},
84+
{
85+
"path": "/main/event/activity",
86+
"remark": "事件页面",
87+
"type": "Activity",
88+
"pathClass": "com.wyjson.module_main.activity.EventActivity"
89+
},
90+
{
91+
"path": "/main/event/fragment",
92+
"remark": "事件片段",
93+
"type": "Fragment",
94+
"pathClass": "com.wyjson.module_main.fragment.EventFragment"
95+
},
8496
{
8597
"path": "/main/splash/activity",
8698
"remark": "欢迎页",

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
plugins {
22
id 'com.android.application'
3-
id 'com.wyjson.gorouter'
4-
}
5-
GoRouter {
6-
// 允许执行自动注册任务的集合,最好不要写debug,以节省开发阶段build时间。
7-
buildTypes "release"
3+
// id 'com.wyjson.gorouter'
84
}
5+
//GoRouter {
6+
// // 允许执行自动注册任务的集合,最好不要写debug,以节省开发阶段build时间。
7+
// buildTypes "release"
8+
//}
99
android {
1010
namespace 'com.wyjson.go_router'
1111
compileSdk 33

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
dependencies {
4-
classpath "com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:${VERSION}"
4+
// classpath "com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:${VERSION}"
55
}
66
}
77

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ android.nonTransitiveRClass=true
2525
# org.gradle.jvmargs=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
2626

2727
GROUP_ID=com.github.wyjsonGo.GoRouter
28-
VERSION=2.1.0
28+
VERSION=2.1.1

module_common/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ android {
3636
dependencies {
3737
api 'androidx.appcompat:appcompat:1.6.1'
3838

39-
// api project(path: ':GoRouter-Api')
40-
// annotationProcessor project(path: ':GoRouter-Compiler')
39+
api project(path: ':GoRouter-Api')
40+
annotationProcessor project(path: ':GoRouter-Compiler')
4141

42-
api "com.github.wyjsonGo.GoRouter:GoRouter-Api:${VERSION}"
43-
annotationProcessor "com.github.wyjsonGo.GoRouter:GoRouter-Compiler:${VERSION}"
42+
// api "com.github.wyjsonGo.GoRouter:GoRouter-Api:${VERSION}"
43+
// annotationProcessor "com.github.wyjsonGo.GoRouter:GoRouter-Compiler:${VERSION}"
4444
}

module_main/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ android {
3838

3939
dependencies {
4040
api project(path: ':module_common')
41-
// annotationProcessor project(path: ':GoRouter-Compiler')
42-
annotationProcessor "com.github.wyjsonGo.GoRouter:GoRouter-Compiler:${VERSION}"
41+
annotationProcessor project(path: ':GoRouter-Compiler')
42+
// annotationProcessor "com.github.wyjsonGo.GoRouter:GoRouter-Compiler:${VERSION}"
4343
}

module_user/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ android {
3838

3939
dependencies {
4040
api project(path: ':module_common')
41-
// annotationProcessor project(path: ':GoRouter-Compiler')
42-
annotationProcessor "com.github.wyjsonGo.GoRouter:GoRouter-Compiler:${VERSION}"
41+
annotationProcessor project(path: ':GoRouter-Compiler')
42+
// annotationProcessor "com.github.wyjsonGo.GoRouter:GoRouter-Compiler:${VERSION}"
4343
}

0 commit comments

Comments
 (0)