Skip to content

Commit 65abfc8

Browse files
authored
Merge pull request #43 from wyjsonGo/develop
publish v2.4.9 优化路由帮助类
2 parents a410b90 + e593d6c commit 65abfc8

File tree

15 files changed

+38
-11
lines changed

15 files changed

+38
-11
lines changed

GoRouter-Gradle-Plugin/src/main/kotlin/com/wyjson/router/gradle_plugin/helper/AssembleGoRouteHelperCode.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class AssembleGoRouteHelperCode(private val model: RouteHelperModel) {
127127

128128
val getCardMetaMethod = MethodSpec.methodBuilder("getCardMeta")
129129
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
130+
.addAnnotation(Nullable)
130131
.returns(CardMeta)
131132
.addStatement(
132133
"return \$T.getInstance().build(\$N()).getCardMeta()",
@@ -361,6 +362,7 @@ class AssembleGoRouteHelperCode(private val model: RouteHelperModel) {
361362
if (routeModel.type == "Activity") {
362363
newGoMethod.addStatement("\$N(\$L).go()", buildMethod.build().name, goParamCodeString)
363364
} else {
365+
newGoMethod.addAnnotation(Nullable)
364366
newGoMethod.returns(Fragment)
365367
newGoMethod.addStatement("return (Fragment) \$N(\$L).go()", buildMethod.build().name, goParamCodeString)
366368
}
@@ -393,6 +395,7 @@ class AssembleGoRouteHelperCode(private val model: RouteHelperModel) {
393395
if (routeModel.type == "Activity") {
394396
newGoMethod.addStatement("\$N(\$L).go()", buildMethod.build().name, goParamCodeString)
395397
} else {
398+
newGoMethod.addAnnotation(Nullable)
396399
newGoMethod.returns(Fragment)
397400
newGoMethod.addStatement("return (Fragment) \$N(\$L).go()", buildMethod.build().name, goParamCodeString)
398401
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ dependencyResolutionManagement {
6969
}
7070
7171
dependencies {
72-
api 'com.github.wyjsonGo.GoRouter:GoRouter-Api:2.4.8'
72+
api 'com.github.wyjsonGo.GoRouter:GoRouter-Api:2.4.9'
7373
}
7474
// Kotlin配置参见8-1
7575
```
@@ -89,7 +89,7 @@ android {
8989
}
9090
9191
dependencies {
92-
annotationProcessor 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.8'
92+
annotationProcessor 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.9'
9393
}
9494
```
9595

@@ -157,7 +157,7 @@ pluginManagement {
157157
// 项目根目录下的build.gradle
158158
buildscript {
159159
dependencies {
160-
classpath 'com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:2.4.8'
160+
classpath 'com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:2.4.9'
161161
}
162162
}
163163
```
@@ -894,7 +894,7 @@ kapt {
894894
}
895895

896896
dependencies {
897-
kapt 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.8'
897+
kapt 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.9'
898898
}
899899
```
900900

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.4.8
28+
VERSION=2.4.9

module_common/src/main/java/com/wyjson/router/helper/module_kotlin/group_kotlin/KotlinActivityGoRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wyjson.router.helper.module_kotlin.group_kotlin;
22

3+
import androidx.annotation.Nullable;
34
import com.wyjson.router.GoRouter;
45
import com.wyjson.router.model.Card;
56
import com.wyjson.router.model.CardMeta;
@@ -15,6 +16,7 @@ public static String getPath() {
1516
return "/kotlin/activity";
1617
}
1718

19+
@Nullable
1820
public static CardMeta getCardMeta() {
1921
return GoRouter.getInstance().build(getPath()).getCardMeta();
2022
}

module_common/src/main/java/com/wyjson/router/helper/module_main/group_main/MainActivityGoRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wyjson.router.helper.module_main.group_main;
22

3+
import androidx.annotation.Nullable;
34
import com.wyjson.router.GoRouter;
45
import com.wyjson.router.model.Card;
56
import com.wyjson.router.model.CardMeta;
@@ -15,6 +16,7 @@ public static String getPath() {
1516
return "/main/activity";
1617
}
1718

19+
@Nullable
1820
public static CardMeta getCardMeta() {
1921
return GoRouter.getInstance().build(getPath()).getCardMeta();
2022
}

module_common/src/main/java/com/wyjson/router/helper/module_main/group_main/MainEventActivityGoRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wyjson.router.helper.module_main.group_main;
22

3+
import androidx.annotation.Nullable;
34
import com.wyjson.router.GoRouter;
45
import com.wyjson.router.model.Card;
56
import com.wyjson.router.model.CardMeta;
@@ -15,6 +16,7 @@ public static String getPath() {
1516
return "/main/event/activity";
1617
}
1718

19+
@Nullable
1820
public static CardMeta getCardMeta() {
1921
return GoRouter.getInstance().build(getPath()).getCardMeta();
2022
}

module_common/src/main/java/com/wyjson/router/helper/module_main/group_main/MainEventFragmentGoRouter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wyjson.router.helper.module_main.group_main;
22

3+
import androidx.annotation.Nullable;
34
import androidx.fragment.app.Fragment;
45
import com.wyjson.router.GoRouter;
56
import com.wyjson.router.model.Card;
@@ -16,6 +17,7 @@ public static String getPath() {
1617
return "/main/event/fragment";
1718
}
1819

20+
@Nullable
1921
public static CardMeta getCardMeta() {
2022
return GoRouter.getInstance().build(getPath()).getCardMeta();
2123
}
@@ -28,6 +30,7 @@ public static Card build() {
2830
return GoRouter.getInstance().build(getPath());
2931
}
3032

33+
@Nullable
3134
public static Fragment go() {
3235
return (Fragment) build().go();
3336
}

module_common/src/main/java/com/wyjson/router/helper/module_main/group_main/MainSplashActivityGoRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wyjson.router.helper.module_main.group_main;
22

3+
import androidx.annotation.Nullable;
34
import com.wyjson.router.GoRouter;
45
import com.wyjson.router.model.Card;
56
import com.wyjson.router.model.CardMeta;
@@ -15,6 +16,7 @@ public static String getPath() {
1516
return "/main/splash/activity";
1617
}
1718

19+
@Nullable
1820
public static CardMeta getCardMeta() {
1921
return GoRouter.getInstance().build(getPath()).getCardMeta();
2022
}

module_common/src/main/java/com/wyjson/router/helper/module_user/group_new/NewParamActivityGoRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wyjson.router.helper.module_user.group_new;
22

3+
import androidx.annotation.Nullable;
34
import com.wyjson.router.GoRouter;
45
import com.wyjson.router.model.Card;
56
import com.wyjson.router.model.CardMeta;
@@ -15,6 +16,7 @@ public static String getPath() {
1516
return "/new/param/activity";
1617
}
1718

19+
@Nullable
1820
public static CardMeta getCardMeta() {
1921
return GoRouter.getInstance().build(getPath()).getCardMeta();
2022
}

0 commit comments

Comments
 (0)