Gradle 只构建一个模块 [英] Gradle build only one module
本文介绍了Gradle 只构建一个模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个多模块 gradle 构建.我想使用 root 为一个模块执行目标.例如:
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?
谢谢!
推荐答案
要执行特定子项目的任务,请指定其任务路径.例如:
To execute a task of a specific subproject, specify its task path. For example:
gradle :ABC:build
前导:
代表根项目.ABC
是子项目,build
是项目中的一个任务.
The leading :
stands for the root project. ABC
is the subproject, and build
a task in that project.
这篇关于Gradle 只构建一个模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文