Gradle build only one module

Found a quick way

gradle build -p moduleA

moduleA is the module's directory.

Above command builds a moduleA and all its submodules, and moduleA should be its path


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.


enter image description here

If your IDE is Android Studio ,there is a simple way.Just choose the module folder you want to compile ,then click Build and choose Make Module 'your module folder'.


On Mac OS, the only variant which is working with me :

./gradlew  ABC:build

ABC is the name of module

( It might be working on Linux too )

Tags:

Gradle