Every time I try to invoke an Ant build file from the command line I get an error:
Unable to write log file
Am I missing something here? Please let me know as I am trying to run my Junit batch files from a command prompt using Ant.
<?xml version="1.0" encoding="UTF-8"?>
<project name="AntTest" basedir=".">
<description>
AntTest project build file.
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="ExternalLibraries" location="ExternalLibraries"/>
<property name="JenkinsResults" location="Results/JenkinsResults"/>
<property name="TestSuiteName" location="${src}/AntTest.testsuite"/>
<!--Set the classpath for compiling the source files-->
<path id="AntTest.classpath">
<fileset dir="${ExternalLibraries}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build}"/>
<pathelement location="${Results}"/>
</path>
<!--Set the framework properties required for the run-->
<target name="setFrameworkProperties">
<propertyfile file="framework.properties" >
<entry key="browser" operation="=" value="${Browser}" />
<entry key="url" operation="=" value="${Url}" />
<entry key="Environment" operation="=" value="${Environment}" />
</propertyfile>
</target>
<!--Creates the directory for the classes-->
<target name="createBuildFolder" depends="setFrameworkProperties">
<mkdir dir="${build}"/>
</target>
<!--Creates the Jenkins results folder-->
<target name="createResultsFolder" depends="createBuildFolder">
<mkdir dir="${JenkinsResults}"/>
</target>
<!--Deletes the old build jenkins results files-->
<target name="DeleteContentsOldResultsFolder" depends="createResultsFolder">
<delete>
<fileset dir="${JenkinsResults}">
<include name="**/*.*"/>
</fileset>
</delete>
</target>
<!--Compile the source code from the source folder to the build folder-->
<target name="compile" depends="DeleteContentsOldResultsFolder" description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="AntTest.classpath" />
</javac>
</target>
<target name="runtestsuite" description="runs a junit testsuite" >
<antcall id="compileTargetCall" description="Call to target compile" target="compile"/>
<!-- runs a testsuite -->
<junit printsummary="yes" haltonfailure="no">
<classpath refid="AntTest.classpath" />
<test name="${TestSuiteName}" haltonfailure="no" todir="${JenkinsResults}">
<formatter type="xml"/>
</test>
</junit>
<antcall id="deleteBuildFolderCall" description="Call to delete build folder" target="deleteBuildFolder" />
</target>
<!--Deletes the directory for the classes after the current run-->
<target name="deleteBuildFolder">
<delete dir="${build}"/>
</target>
</project>