【问题标题】:What task to run to re-create Dagger 2 injection files运行什么任务来重新创建 Dagger 2 注入文件
【发布时间】:2016-03-02 04:16:33
【问题描述】:

当我对 Dagger 2 组件进行更改时,我希望它重新构建注入类。但我不想运行整个项目 Rebuild,因为这需要 5 分钟,即使使用 gradle 守护程序也是如此。

在某些情况下它会自动重建,但在其他情况下不会。

我可以运行什么 gradle 任务来重新创建 Dagger 2 文件?

【问题讨论】:

    标签: android android-gradle-plugin dagger-2


    【解决方案1】:

    您需要通过运行apt 插件来生成源文件。这发生在编译您的源代码时。使用gradlew compileDebugSources 触发编译或在您的IDE 中使用Make Project

    如果您想检查sources,您可以看到它附加到javaCompile 任务。

    另见How to trigger the minimal task on Gradle to run apt plugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-31
      • 2022-09-30
      • 1970-01-01
      • 2018-06-13
      • 2020-02-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多