Ant.junitreport generates rest reports fine, but all with size 0KB listed unless refresh the explorer

I did something similar to this post (http://forums.gradle.org/gradle/topics/unable_to_use_ant_junitreport_task_even_though_ant_junit_jar_is_present) to generate junit report. Here’s what my build.gradle looks like: repositories {

maven { url localMavenRepo } } configurations {

antClasspath } dependencies {

antClasspath ‘org.apache.ant:ant-junit:1.8.4’

} ClassLoader antClassLoader = org.apache.tools.ant.Project.class.classLoader

configurations.antClasspath.each { File f ->

antClassLoader.addURL(f.toURI().toURL())

}

task test {

//…do testing stuff

ant.junitreport(todir:"${projectDir}/testReport"){

fileset(dir: “${projectDir}/testReport”){

include(name: “TEST-*.xml”)

}

report(format:“frames”, todir:"${projectDir}/testReport/htmlReport")

} }

When looking at the htmlReport folder, all the report files were generated but listed with file size of 0KB. Only after refreshing windows explorer, the file sizes were updated. The content of the reports were in fact generated just fine. Has anyone seen a similar issue? Or am I not using junitreport correctly.

It’s likely just Windows not seeing the filesystem updates.

Thanks for the quick reply. I also tried to use junitreport in an ant script for same tests. Windows was able to see the filesystem updates right away. Just would like to make sure there is nothing wrong with the way I am calling junitreport in gradle, which might cause the issue…