Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify Gradle Report Directory

Tags:

gradle

I have several folders trying to seperate my tests up into unit, integration, 3rd party, db. This way I can have my tests seperated into chunks purposes, to make TDD easier/faster. Here is the task that I am trying to use.

task integrationTest(type: Test) {
    testClassesDir = sourceSets.integration.output.classesDir
    classpath = sourceSets.integration.runtimeClasspath
    maxParallelForks 8
    maxHeapSize = "4048m"
}

I know there is testReportDir, but it's deprecated. I want to be able to use the new method.

I have tried the following closures:

reports {
    html = file("$buildDir/reports/intTests")
}

reports {
    setDestination = file("$buildDir/reports/intTests")
}

reports {
    destinationDir = file("$buildDir/reports/intTests")
}

destinationDir = file("$buildDir/reports/intTests")
like image 247
Ethan Avatar asked Oct 11 '13 20:10

Ethan


1 Answers

I think you want

integrationTest.reports.html.destination = file("$buildDir/reports/intTests")

You may want to consult the api docs for TestTaskReports which shows that the html report is a DirectoryReport extending ConfigurableReport and that that provides the destination accessor referred to in the one liner above.

like image 111
Matt Avatar answered Oct 18 '22 12:10

Matt