junit が結果XMLを生成する → そのXMLを入力として junitreport がHTMLを生成、の順番。
なので、junitreport 用のターゲットを別に作って test ターゲットの実行後にそれを実行とかでもいいはず。
<target name="test" depends="compile-test"> <junit printsummary="yes" fork="yes"> <classpath refid="classpath.test" /> <formatter type="xml" /> <test name="foo.FooTest" todir="${project.root.dir}/test_result" /> </junit> <!-- ここ(junit の後) --> <junitreport todir="${project.root.dir}/test_report"> <fileset dir="${project.root.dir}/test_result"> <include name="TEST-*.xml" /> </fileset> <report format="frames" todir="${project.root.dir}/test_report/html" /> </junitreport> </target>