Gradle只构建一个模块 [英] Gradle build only one module

查看:333
本文介绍了Gradle只构建一个模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多模块gradle构建。我想用root来执行一个模块的目标。
例子:

  gradle build -Pmodule = ABC 
gradle jar -Pmodule = ABC
gradle test -Pmodule = ABC
gradle compileJava -Pmodule = ABC
gradle customTask -Pmodule = ABC

因此,每个目标都可以从指定模块的根目录运行。
是否有一种简单的方法可以做到这一点?

谢谢!

解决方案 div>

要执行特定子项目的任务,请指定其任务路径。例如:

  gradle:ABC:build 

领先的代表根项目。 ABC 是子项目,构建该项目中的任务。


I have a multiple module gradle build. I want to execute targets for one module using root. Ex :

gradle build -Pmodule=ABC
gradle jar -Pmodule=ABC
gradle test -Pmodule=ABC
gradle compileJava -Pmodule=ABC
gradle customTask -Pmodule=ABC
etc.

So every target can be run from root specifying the module. Is there a simple way to do this?

Thanks !

解决方案

To execute a task of a specific subproject, specify its task path. For example:

gradle :ABC:build

The leading : stands for the root project. ABC is the subproject, and build a task in that project.

这篇关于Gradle只构建一个模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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