Using dbc_javac with Ant
To use dbc_javac (instead of javac ) with Apache's Jakarta Ant build tool.
- Modify the CLASSPATH environment variable to include 'jcontract.jar' and 'antlr.jar'. These files are in <jcontract_installation_dir>/bin.
- Modify your Ant project's xml file to include the following property inside the project:
<property name="build.compiler" value="com.parasoft.dbc.AntDbcJavac"/>
A simple yet complete build file using dbc_javac instead of javac follows:
<project name="SampleProject" default="compile" basedir=".">
<!-- set this build to use dbc_javac instead of javac -->
<property name="build.compiler" value="com.parasoft.dbc.Ant-
DbcJavac"/>
<target name="compile">
<!-- Create the time stamp -->
<tstamp/>
<!-- Compile the java code -->
<exec dir ="${basedir}" executable="${JCONTACT_HOME}/
bin/dbc_javac.exe">
<arg line= "(Path to the users .java files)" />
</exec>
</target>
</project>
- Ensure that 'ant.jar' is in your CLASSPATH environment variable.
|