Skip to content

Commit

Permalink
模块的生成文件名称可以自定义
Browse files Browse the repository at this point in the history
如果不自定义的话,将用UUID进行替换
  • Loading branch information
你需要一台永动机 committed Nov 26, 2019
1 parent bc30664 commit 5c4f7cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

kapt {
arguments {
arg("metroModuleName", project.getName())
}
}
//kapt {
// arguments {
// arg("metroModuleName", project.getName())
// }
//}

android {
compileSdkVersion versions.compileSdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MetroProcessor : AbstractProcessor() {
// 保存 messager 对象
this.messager = processingEnv?.messager

moduleName = processingEnv?.options?.get("metroModuleName") ?: "${UUID.randomUUID()}"
moduleName = processingEnv?.options?.get("metroModuleName") ?: "${UUID.randomUUID()}".replace("-","")
}


Expand Down

0 comments on commit 5c4f7cb

Please sign in to comment.