Gradle exclude a specific subproject from full build

前端 未结 4 1989
别那么骄傲
别那么骄傲 2020-12-13 19:31


In our Gradle project, we want to add a new module for functional-tests that needs to be able to access dependencies from other subprojects but still not be run as

4条回答
  •  星月不相逢
    2020-12-13 20:09

    You can't exclude the subproject, but you can disable subproject tasks:

    gradle.taskGraph.whenReady {
      gradle.taskGraph.allTasks.each {
        if(it.project == project) {
          it.onlyIf { false }
        }
      }
    }
    

提交回复
热议问题