Skip to content

Commit

Permalink
Update README about generate router doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhi1ong committed Aug 9, 2018
1 parent 1550a21 commit 8bdfe2b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 14 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ version|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/
10. Support multiple ways to configure transition animation
11. Support for fragement
12. Full kotlin support (Look at Other#2)
13. **Generate route doc support**

#### II. Classic Case
1. Forward from external URLs to internal pages, and parsing parameters
Expand All @@ -43,12 +44,12 @@ version|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/
``` gradle
android {
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [ moduleName : project.getName() ]
}
}
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
}
Expand Down Expand Up @@ -422,6 +423,20 @@ public class PathReplaceServiceImpl implements PathReplaceService {
}
```

5. Generate router doc
``` gradle
## Edit build.gradle, add option 'AROUTER_GENERATE_DOC = enable'
android {
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
}
}
}
}
#### VI. Other
1. Old version of gradle plugin configuration
Expand Down
28 changes: 22 additions & 6 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
11. 支持获取Fragment
12. 完全支持Kotlin以及混编(配置见文末 其他#5)
13. **支持第三方 App 加固**(使用 arouter-register 实现自动注册)
14. **支持生成路由文档**

#### 二、典型应用
1. 从外部URL映射到内部页面,以及参数传递与解析
Expand All @@ -46,12 +47,12 @@
``` gradle
android {
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [ moduleName : project.getName() ]
}
}
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
}
Expand Down Expand Up @@ -430,6 +431,21 @@ public class PathReplaceServiceImpl implements PathReplaceService {
}
```

5. 生成路由文档
``` gradle
## 更新 build.gradle, 添加参数 AROUTER_GENERATE_DOC = enable
android {
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
}
}
}
}
#### 六、其他
1. 路由中的分组概念
Expand Down
4 changes: 2 additions & 2 deletions arouter-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

javaCompileOptions {
annotationProcessorOptions {
arguments = [ moduleName : project.getName() ]
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
Expand All @@ -39,7 +39,7 @@ android {
}

dependencies {
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
annotationProcessor 'com.alibaba:arouter-compiler:1.2.0'
compile 'com.alibaba:arouter-annotation:1.0.6'
compile "com.android.support:support-v4:${SUPPORT_LIB_VERSION}"
}
Expand Down
1 change: 1 addition & 0 deletions module-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ android {

javaCompileOptions {
annotationProcessorOptions {
// 这里是旧版本写法!1.0.3 的用法, 用于测试兼容性,请按照文档填写参数
arguments = [ moduleName : project.getName() ]
}
}
Expand Down
1 change: 1 addition & 0 deletions module-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apply plugin: 'kotlin-android-extensions'

kapt {
arguments {
// 这里是旧版本写法!1.0.3 的用法, 用于测试兼容性,请按照文档填写参数
arg("moduleName", project.getName())
}
}
Expand Down

0 comments on commit 8bdfe2b

Please sign in to comment.