Skip to content

Commit

Permalink
Merge pull request #43 from wyjsonGo/develop
Browse files Browse the repository at this point in the history
publish v2.4.9
优化路由帮助类
  • Loading branch information
wyjsonGo authored Jan 24, 2024
2 parents a410b90 + e593d6c commit 65abfc8
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class AssembleGoRouteHelperCode(private val model: RouteHelperModel) {

val getCardMetaMethod = MethodSpec.methodBuilder("getCardMeta")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.addAnnotation(Nullable)
.returns(CardMeta)
.addStatement(
"return \$T.getInstance().build(\$N()).getCardMeta()",
Expand Down Expand Up @@ -361,6 +362,7 @@ class AssembleGoRouteHelperCode(private val model: RouteHelperModel) {
if (routeModel.type == "Activity") {
newGoMethod.addStatement("\$N(\$L).go()", buildMethod.build().name, goParamCodeString)
} else {
newGoMethod.addAnnotation(Nullable)
newGoMethod.returns(Fragment)
newGoMethod.addStatement("return (Fragment) \$N(\$L).go()", buildMethod.build().name, goParamCodeString)
}
Expand Down Expand Up @@ -393,6 +395,7 @@ class AssembleGoRouteHelperCode(private val model: RouteHelperModel) {
if (routeModel.type == "Activity") {
newGoMethod.addStatement("\$N(\$L).go()", buildMethod.build().name, goParamCodeString)
} else {
newGoMethod.addAnnotation(Nullable)
newGoMethod.returns(Fragment)
newGoMethod.addStatement("return (Fragment) \$N(\$L).go()", buildMethod.build().name, goParamCodeString)
}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencyResolutionManagement {
}
dependencies {
api 'com.github.wyjsonGo.GoRouter:GoRouter-Api:2.4.8'
api 'com.github.wyjsonGo.GoRouter:GoRouter-Api:2.4.9'
}
// Kotlin配置参见8-1
```
Expand All @@ -89,7 +89,7 @@ android {
}
dependencies {
annotationProcessor 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.8'
annotationProcessor 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.9'
}
```

Expand Down Expand Up @@ -157,7 +157,7 @@ pluginManagement {
// 项目根目录下的build.gradle
buildscript {
dependencies {
classpath 'com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:2.4.8'
classpath 'com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:2.4.9'
}
}
```
Expand Down Expand Up @@ -894,7 +894,7 @@ kapt {
}

dependencies {
kapt 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.8'
kapt 'com.github.wyjsonGo.GoRouter:GoRouter-Compiler:2.4.9'
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath "com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:${VERSION}"
// classpath "com.github.wyjsonGo.GoRouter:GoRouter-Gradle-Plugin:${VERSION}"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ android.nonTransitiveRClass=true
# org.gradle.jvmargs=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

GROUP_ID=com.github.wyjsonGo.GoRouter
VERSION=2.4.8
VERSION=2.4.9
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_kotlin.group_kotlin;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/kotlin/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_main.group_main;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/main/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_main.group_main;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/main/event/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_main.group_main;

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

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand All @@ -28,6 +30,7 @@ public static Card build() {
return GoRouter.getInstance().build(getPath());
}

@Nullable
public static Fragment go() {
return (Fragment) build().go();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_main.group_main;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/main/splash/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_user.group_new;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/new/param/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_user.group_new;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
Expand All @@ -16,6 +17,7 @@ public static String getPath() {
return "/new/param/fragment";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand All @@ -28,6 +30,7 @@ public static Card build() {
return GoRouter.getInstance().build(getPath());
}

@Nullable
public static Fragment go() {
return (Fragment) build().go();
}
Expand All @@ -40,6 +43,7 @@ public static Card build(int age, String name) {
return create().setAge(age).setName(name).build();
}

@Nullable
public static Fragment go(int age, String name) {
return (Fragment) build(age, name).go();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_user.group_user;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
Expand All @@ -16,6 +17,7 @@ public static String getPath() {
return "/user/card/fragment";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand All @@ -28,6 +30,7 @@ public static Card build() {
return GoRouter.getInstance().build(getPath());
}

@Nullable
public static Fragment go() {
return (Fragment) build().go();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_user.group_user;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/user/info/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wyjson.router.helper.module_user.group_user;

import androidx.annotation.Nullable;
import com.wyjson.router.GoRouter;
import com.wyjson.router.model.Card;
import com.wyjson.router.model.CardMeta;
Expand All @@ -15,6 +16,7 @@ public static String getPath() {
return "/user/sign_in/activity";
}

@Nullable
public static CardMeta getCardMeta() {
return GoRouter.getInstance().build(getPath()).getCardMeta();
}
Expand Down
10 changes: 5 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencyResolutionManagement {

rootProject.name = "GoRouter"

include ':app'
include ':module_main'
include ':module_user'
include ':module_kotlin'
include ':module_common'
//include ':app'
//include ':module_main'
//include ':module_user'
//include ':module_kotlin'
//include ':module_common'

include ':GoRouter-Api'
include ':GoRouter-Annotation'
Expand Down

0 comments on commit 65abfc8

Please sign in to comment.