Change the title of ant junit report

<junitreport todir="${junit.report.html.dir}">                
                <fileset dir="${junit.report.xml.dir}">
                    <include name="*.xml"/>
                </fileset>
                <report format="frames" todir="${junit.report.html.dir}">
                    <param name="TITLE" expression="${junit.configuration} test results." />
                </report>
            </junitreport>

You can pass parameters to the stylesheet as above, one of which is TITLE. YOu can also change the whole stylesheet by passing “styledir” in as a property.

Share

Cruise / Ant : Could not find log.xml

We just ran into this problem trying to configure ant to run in a different working directory using cruise.

Our original snippet looked like this:

 
                
        

We then added antWorkingDir="${build.dir}" to the ant target, which failed with a dodgy message like “could not find log.xml”. This was because we no longer needed the ${build.dir} when speciying the buildfile. The error was actually hidden up above in the log and was really saying “could not find build.xml”.

working code:

 
                
        

Share

SCP files to a server using ANT

This is quite easy using the optional ‘scp’ task.

Under windows, this depends on a java implementation of ssh which is found here

Then do something like the following:

<!-- On windows, this needs an optional java implementation of ssh which you can get from :
	 http://www.jcraft.com/jsch/index.html
	 download it, build it and then pop the jar file into your ant lib folder 
-->
<target name="deploy" description="pushes jar to the test server">
    <scp trust="true" file="${target.dist.jarfile}"
    todir="${deploy.server.1.username}:${deploy.server.1.password}@${deploy.server.1}:${deploy.server.1.dir}"/>    
</target>
Share