Net: 'junitreport' doesn't seem to provide a way to set the temporary folder that it uses while performing transformations, and the doesn't seem to be a way to update 'java.io.tmpdir' for the reporting task. In this case, setting 'user.home' or 'java.io.tmpdir' from the command line while invoking ant is not a solution which can be used.
In detail: I'm using junit tasks within ant/mantis, with this syntax:
<target name="unittest_report">
<sequential>
<echo>User Home [ user.home ] [ ${user.home} ]</echo>
<echo>Java Temp [ java.io.tmpdir ] [ ${java.io.tmpdir} ]</echo>
<junitreport todir="${dir.unittest.reports}/raw">
<fileset dir="${dir.unittest.reports}/raw">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dir.unittest.reports}"/>
</junitreport>
</sequential>
</mantis:modifyenvironment>
This seems to be a very standard usage, with the addition of the "echo" statements to show system property values which are active when the task is executed.
The task runs fine, except that the processing writes temporary output relative to the java temporary directory (java.io.tmpdir):
[15:55:03+0000/tester/unittest_report/echo] User Home [ user.home ] [ C:\Users\MyUser ]
[15:55:03+0000/tester/unittest_report/echo] Java Temp [ java.io.tmpdir ] [C:\Users\MyUser\AppData\Local\Temp\ ]
[15:55:04+0000/tester/unittest_report/junitreport] Processing c:\work\tester\build\reports\unittest\raw\TESTS-TestSuites.xml to
C:\Users\MyUser\AppData\Local\Temp\null591799606
The key values are the "java.io.tmpdir" value and the write to "C:\Users\MyUser\AppData\Local\Temp\null591799606".
I've tried to temporary update the temporary directory using "sysproperty", for example:
<mantis:modifyenvironment>
<sysproperty key="java.io.tmpdir" value="${dir.build}/junit.report.tmp"/>
<sequential>
<echo>User Home [ user.home ] [ ${user.home} ]</echo>
<echo>Java Temp [ java.io.tmpdir ] [ ${java.io.tmpdir} ]</echo>
<junitreport todir="${dir.unittest.reports}/raw">
<fileset dir="${dir.unittest.reports}/raw">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dir.unittest.reports}"/>
</junitreport>
</sequential>
</mantis:modifyenvironment>
But, that has no effect.
Then:
1) Is this correct expectation of "sysproperty" to update the system property for the "junitreport" task? For example, the effect of "sysproperty" might be limited to nested "java" sequential task invocations, in which case the expectation that the update be visible to "junitreport" would be incorrect.
2) Or, is there a limitation for "java.io.tmpdir" in particular which prevents this from working?
3) Or, is there a bug in "sysproperty"?
For this problem, I'm prevented from updating "java.io.tmpdir" (or "user.home") from the command line. Those values cannot be modified in a wider scope than the "junitreport" task invocations.
Finally: Not sure if it fits under this same set of questions:
4) Where is the documentation for "mantis:modifyenvironment"? I find this in my local "mantis.jar", but I am finding no documentation for it in the mantis manual / documentation.
5) That "junitreport" modifies the file system through "java.io.tmpdir" with no possible override seems to be very bad practice.