aggregating gradle multiproject test results using TestReport

前端 未结 5 489
深忆病人
深忆病人 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:12

    In addition to the subprojects block and testReport task suggested by https://stackoverflow.com/users/84889/peter-niederwieser above, I would add another line to the build below those:

    tasks('test').finalizedBy(testReport)
    

    That way if you run gradle test (or even gradle build), the testReport task will run after the subproject tests complete. Note that you have to use tasks('test') rather than just test.finalizedBy(...) because the test task doesn't exist in the root project.

提交回复
热议问题