Gradle build only one module

后端 未结 4 1592
栀梦
栀梦 2020-12-04 07:35

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 t         


        
相关标签:
4条回答
  • 2020-12-04 08:06

    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.

    0 讨论(0)
  • 2020-12-04 08:17

    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

    0 讨论(0)
  • 2020-12-04 08:21

    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 )

    0 讨论(0)
  • 2020-12-04 08:22

    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'.

    0 讨论(0)
提交回复
热议问题