How to just compile only changed (or related) module in multi-module gradle project

半城伤御伤魂 提交于 2021-01-29 08:11:10

问题


I am having multi-module gradle project, which is having 5 modules. And these modules creates a lineage of dependency ie. A <- B <- C <- D <- E.

Here A depends on B, B depends on C and so on.

My problem is that, If i am going to change in A, it compile all the parent modules.

Is there any way to just compile only A. And if i change in B then only compile A and B.


回答1:


Yes, @JB Nizet you are correct i was using one of the scalaCompileOption property.

  tasks.withType(ScalaCompile) {
    scalaCompileOptions.with {
      force = true
    }

which force to disable scala incremental build. https://docs.gradle.org/current/userguide/scala_plugin.html#sec:scala_incremental_compilation



来源:https://stackoverflow.com/questions/53670130/how-to-just-compile-only-changed-or-related-module-in-multi-module-gradle-proj

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!