aggregating gradle multiproject test results using TestReport

前端 未结 5 487
深忆病人
深忆病人 2020-12-08 03:51

I have a project structure that looks like the below. I want to use the TestReport functionality in Gradle to aggregate all the test results to a single directory. Then I ca

5条回答
  •  再見小時候
    2020-12-08 04:08

    FYI, I've solved this problem using the following subprojects config in my root project build.gradle file. This way no extra tasks are needed.

    Note: this places each module's output in its own reports/ folder, so subproject builds don't overwrite each other's results.

    subprojects {
     // Combine all build results
      java {
        reporting.baseDir = "${rootProject.buildDir.path}/reports/${project.name}"
      }
    }
    

    For a default Gradle project, this would result in a folder structure like

    build/reports/module_a/tests/test/index.html
    build/reports/module_b/tests/test/index.html
    build/reports/module_c/tests/test/index.html
    

提交回复
热议问题