Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle插件生成RouterBuildInfo信息不全 #66

Closed
faith333 opened this issue Jan 8, 2018 · 5 comments
Closed

gradle插件生成RouterBuildInfo信息不全 #66

faith333 opened this issue Jan 8, 2018 · 5 comments
Labels

Comments

@faith333
Copy link

faith333 commented Jan 8, 2018

你好. 发现一个问题. 如果设置com.android.tools.build:gradle:3.0.0 那么gradle插件自动生成RouterBuildInfo.java里ALL_MODULES的值只有app, 没有其他Module的name.. 如果使用gradle2.3.3版本就没有问题. 在你的1.2分支的代码上就可以复现.. 请问你有什么解决办法吗? 期待你的回复

@chenenyu
Copy link
Owner

chenenyu commented Jan 8, 2018

gradle3.0变化太大,很多原有api不起作用(应该是bug),所以1.2的版本不兼容,建议换到1.3的版本

@faith333
Copy link
Author

faith333 commented Jan 8, 2018

我尝试修改了一下插件里的判断方式, 姑且解决了3.0.0上的这个问题. 希望日后有更优雅的方式可以解决
`
subs.findAll {

  String file = it.buildFile.text
  String regxLibrary = "apply plugin:\\s*['\"]" + LIBRARY + "['\"]"
  String regxRouterPlugin = "apply plugin:\\s*['\"]" + ROUTER_PLUGIN + "['\"]"
  file.find(regxLibrary) != null && file.find(regxRouterPlugin) != null
  //it.plugins.hasPlugin(LIBRARY) && it.plugins.hasPlugin(RouterPlugin)

}
`

@chenenyu
Copy link
Owner

chenenyu commented Jan 8, 2018

解决方式太硬了。。。

@faith333
Copy link
Author

faith333 commented Jan 8, 2018

没办法. 我觉得插件的这个自动register module的特性是个亮点, 不想抛弃它使用1.3的方式. 但苦于对gradle插件和api的不熟悉只能用这样暴力的方法了.. 期待你找到更好的方式我再跟上:)

@xxw8393
Copy link

xxw8393 commented Jan 21, 2018

临时方案还不错的 我是干脆写成以app开头的全部加进去。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants