如何仅在多模块gradle项目中编译仅更改(或相关)的模块 [英] How to just compile only changed (or related) module in multi-module gradle project

查看:74
本文介绍了如何仅在多模块gradle项目中编译仅更改(或相关)的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多模块gradle项目,其中有5个模块.这些模块创建了一个依赖关系,即. A <- B <- C <- D <- E .

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.

此处 A 取决于 B B 取决于 C ,依此类推.

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

我的问题是,如果我要在 A 中进行更改,它将编译所有父模块.

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

有什么方法可以只编译 A .如果我在 B 中进行更改,则仅编译 A B .

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

推荐答案

是的,@ JB Nizet您是正确的,我使用的是 scalaCompileOption 属性之一.

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

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

这将强制禁用Scala增量构建. https://docs.gradle.org/current/userguide/scala_plugin.html#sec:scala_incremental_compilation

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

这篇关于如何仅在多模块gradle项目中编译仅更改(或相关)的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆