Home » Language IDEs » Java Development Tools (JDT) » Ant can't find directory
Ant can't find directory [message #172546] |
Mon, 09 August 2004 21:27  |
Eclipse User |
|
|
|
Originally posted by: mpjburke.verizon.net
I'm trying to run ant as a remote process so I can debug my junit tests.
When I run ant from a terminal window it throws exceptions complaining
about directories not existing. the directories exist, and when i run the
same build.xml file from within eclipse it suns fine. Here's the exception:
compile.test:
[echo]
============================================================ =======
[echo] Your test configuration:
[echo] test.java.dir = src/${test.dir}
[echo] test.classes.dir = ${test.dir}/${classes.dir}
[echo]
============================================================ =======
[antcall] Exiting /home/mburke/m7/workspace/JPOX/build.xml.
BUILD FAILED
/home/mburke/m7/workspace/JPOX/build.xml:206: Following error occured
while executing this line
/home/mburke/m7/workspace/JPOX/build.xml:502: srcdir
"/home/mburke/m7/workspace/JPOX/src/${test.dir}" does not exist!
in build.properties I have this:
test.dir=test
test.java.dir=src/${test.dir}
|
|
| |
Re: Ant can't find directory [message #172756 is a reply to message #172554] |
Tue, 10 August 2004 20:05   |
Eclipse User |
|
|
|
Originally posted by: mpjburke.verizon.net
Darin Swanson wrote:
> So the build works within Eclipse but does not work from the commandline?
> Only run the build in Eclipse :-) (Sorry couldn't resist)
> It would appear that you are referencing a property that is not defined.
> ${test.dir} ??
> Without seeing your whole buildfile it is a little hard to diagnose but how
> are you referencing the build.properties file so that the properties are
> defined?
> Darins
Darin, I can see you're a true Eclipse evangelist. I changed
build.properties to remove the offending ${} variables and tried again and
got an error saying
ant was unable to find a javac compiler. Just to clarify, I'm running any
in a terminal window and trying to attach to it in order to debug junit
tests (from what I've read this is the only way to debug the tests if I'm
using ant. Here's the build.properties file:
#######################################
# project properties
#######################################
Name=JPOX
name=${Name}
version=1.0.0
#######################################
# JDO
#######################################
#core
#src.dir=src
src.java.dir=src/java
#Enhancer project
Enhancer.src.dir=Enhancer/src
Enhancer.src.java.dir=${Enhancer.src.dir}/java
#lib
lib.dir=lib
#builds
bin.dir=bin
classes.dir=classes
jar.file=${bin.dir}/${name}.jar
#######################################
# JDO build dependencies
#######################################
jdo.file=${lib.dir}/jdo-2.0.jar
log4j.file=${lib.dir}/log4j.jar
#######################################
# JCA
#######################################
metainf.dir=${src.java.dir}/META-INF
#######################################
# distribution
#######################################
dist.name=${name}-${version}
dist.base=distribution
dist.dir=dist
dist.src.file=${dist.dir}/${dist.name}-src.zip
dist.bin.zip.file=${dist.dir}/${dist.name}.zip
dist.bin.tar.file=${dist.dir}/${dist.name}.tar
dist.bin.targz.file=${dist.dir}/${dist.name}.tar.gz
dist.rar.file=${dist.dir}/${dist.name}.rar
#######################################
# third party dependencies
#######################################
dependency.ant.name=org.apache.ant
dependency.ant.library=ant.library
dependency.ant.url=http://www.ibiblio.org/maven/ant/jars/ant-1.6.jar
dependency.ant.location=${lib.dir}/ant-1.6.jar
dependency.junit.name=junit
dependency.junit.library=junit.library
dependency.junit.url=http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar
dependency.junit.location=${lib.dir}/junit-3.8.1.jar
dependency.commons-dbcp.name=org.apache.commons.dbcp
dependency.commons-dbcp.library=commons-dbcp.library
dependency.commons-dbcp.url= http://www.ibiblio.org/maven/commons-dbcp/jars/commons-dbcp- 1.0.jar
dependency.commons-dbcp.location=${lib.dir}/commons-dbcp-1.0 .jar
dependency.commons-pool.name=org.apache.commons.pool
dependency.commons-pool.library=commons-pool.library
dependency.commons-pool.url= http://www.ibiblio.org/maven/commons-pool/jars/commons-pool- 1.0.jar
dependency.commons-pool.location=${lib.dir}/commons-pool-1.0 .jar
dependency.commons-collections.name=org.apache.commons.colle ctions
dependency.commons-collections.library=commons-collections.l ibrary
dependency.commons-collections.url= http://www.ibiblio.org/maven/commons-collections/jars/common s-collections-2.0.jar
dependency.commons-collections.location=${lib.dir}/commons-c ollections-2.0.jar
dependency.bcel.name=org.apache.commons.org.apache.bcel
dependency.bcel.library=bcel.library
dependency.bcel.url=http://www.ibiblio.org/maven/bcel/jars/bcel-5.1.jar
dependency.bcel.location=${lib.dir}/bcel-5.1.jar
dependency.log4j.name=log4j
dependency.log4j.library=log4j.library
dependency.log4j.jar.name=log4j-1.2.8.jar
dependency.log4j.url= http://www.ibiblio.org/maven/log4j/jars/${dependency.log4j.j ar.name}
dependency.log4j.location=${lib.dir}/${dependency.log4j.jar. name}
dependency.jca.location=${lib.dir}/jca-1.0.jart
dependency.jta.location=${lib.dir}/jta-1.0.1B.jar
dependency.jdbc.location=${lib.dir}/jdbc2_0-stdext.jar
dependency.jaas.location=${lib.dir}/jaas-1.0.01.jar
dependency.jdo.location=${jdo.file}
dependency.jdori.location=${lib.dir}/jdori.jar
dependency.oracle.jdbc.location=${lib.dir}/ojdbc14.jar
#######################################
# documentation
#######################################
doc.dir=doc
javadoc.dir=${doc.dir}/api
#######################################
# test properties
#######################################
test.dir=test
test.java.dir=src/test
test.results.dir=${test.dir}/results
test.general.results.dir=${test.results.dir}/general
test.datastore.results.dir=${test.results.dir}/datastore
test.application.results.dir=${test.results.dir}/application
test.schema.results.dir=${test.results.dir}/schema
test.classes.dir=${test.dir}/${classes.dir}
test.log4j.configuration = log4j.lcf
Enhancer.test.dir=test
Enhancer.test.java.dir=${Enhancer.src.dir}/${Enhancer.test.d ir}
Enhancer.test.results.dir=${Enhancer.test.dir}/results
Enhancer.test.classes.dir=${Enhancer.test.dir}/${classes.dir }
Enhancer.test.log4j.configuration = log4j.lcf
#directory that contains jars of your jdbc driver
test.jdbc.dir=/home/mburke/mysql-connector-java-3.0.11-stabl e
#######################################
# test database properties
#######################################
javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://localhost/jpox
javax.jdo.option.ConnectionUserName=sa
javax.jdo.option.ConnectionPassword=password
org.jpox.autoCreateTables=true
org.jpox.validateTables=true
org.jpox.autoCreateConstraints=true
org.jpox.validateConstraints=true
org.jpox.autoCreateSchema=false
and the build.xml:
<!--
== JPOX
-->
<project name="jpox" default="help">
<property environment="env"/>
<property name="project.location" location="."/>
<property file="${project.location}/build.properties"/>
<property file="${project.location}/jpox.properties"/>
<property file="${project.location}/test.properties"/>
<property name="project.build.debug" value="on"/>
<taskdef resource="clovertasks"/>
<target name="with.clover">
<clover-setup initString="coverage.db"/>
</target>
<target name="clover.html" depends="with.clover">
<clover-log span="1h"/>
<clover-report>
<current outfile="clover_html">
<format type="html"/>
</current>
</clover-report>
</target>
<path id="lib.classpath">
<pathelement path="${ant.home}/lib/clover.jar"/>
<pathelement location="${dependency.bcel.location}"/>
<pathelement location="${dependency.commons-dbcp.location}"/>
<pathelement
location="${dependency.commons-collections.location}"/>
<pathelement location="${dependency.commons-pool.location}"/>
<pathelement location="${dependency.junit.location}"/>
<pathelement location="${dependency.log4j.location}"/>
<pathelement location="${dependency.ant.location}"/>
<pathelement location="${dependency.jaas.location}"/>
<pathelement location="${dependency.jca.location}"/>
<pathelement location="${dependency.jta.location}"/>
<pathelement location="${dependency.jdbc.location}"/>
<pathelement location="${dependency.jdo.location}"/>
<pathelement location="${dependency.jdori.location}"/>
<pathelement location="${dependency.oracle.jdbc.location}"/>
</path>
<path id="project.classpath">
<pathelement location="${classes.dir}"/>
<path refid="lib.classpath"/>
</path>
<path id="test.jdbc.classpath">
<fileset dir="${test.jdbc.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="generated.dist.files"
value="${dist.bin.file},${dist.src.file}"/>
<!--
============================================================ =======
TARGET : all
============================================================ =======
-->
<target name="all" depends="clean,compile,test,release"/>
<!--
============================================================ =======
TARGET : help
============================================================ =======
-->
<target name="help">
<echo>
Targets available:
- all
Cleans, compiles, run tests and creates the release files.
- compile
Compiles functional classes only.
- clean
Deletes build output.
- test
Runs the suite of tests.
- release
Create binary and source files for the formats: jar, zip, tar and targz.
</echo>
</target>
<!--
============================================================ =======
TARGET : clean
============================================================ =======
-->
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${classes.dir}"
includes="**/*.class,**/*.properties,**/*.*"/>
<fileset dir="${test.classes.dir}"
includes="**/*.class,**/*.properties"/>
<fileset dir="${Enhancer.test.classes.dir}"
includes="**/*.class,**/*.properties"/>
<fileset dir="." includes="${generated.dist.files}"/>
</delete>
<delete dir="${classes.dir}" quiet="true"/>
<delete dir="${test.classes.dir}" quiet="true"/>
<delete dir="${Enhancer.test.classes.dir}" quiet="true"/>
</target>
<!--
============================================================ =======
TARGET : test.clean
============================================================ =======
-->
<target name="test.clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${test.classes.dir}" includes="**/*.*"/>
</delete>
<delete dir="${test.classes.dir}" quiet="true"/>
</target>
<!--
============================================================ =======
TARGET : test.general.clean
============================================================ =======
-->
<target name="test.general.clean" depends="test.clean">
<delete dir="${test.general.results.dir}" quiet="true"/>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${test.general.results.dir}" includes="**/*.*"/>
</delete>
<delete dir="${test.general.results.dir}" quiet="true"/>
</target>
<!--
============================================================ =======
TARGET : test.datastore.clean
============================================================ =======
-->
<target name="test.datastore.clean" depends="test.clean">
<delete dir="${test.datastore.results.dir}" quiet="true"/>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${test.datastore.results.dir}"
includes="**/*.*"/>
</delete>
<delete dir="${test.datastore.results.dir}" quiet="true"/>
</target>
<!--
============================================================ =======
TARGET : test.application.clean
============================================================ =======
-->
<target name="test.application.clean" depends="test.clean">
<delete dir="${test.application.results.dir}" quiet="true"/>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${test.application.results.dir}"
includes="**/*.*"/>
</delete>
<delete dir="${test.application.results.dir}" quiet="true"/>
</target>
<!--
============================================================ =======
TARGET : test.schema.clean
============================================================ =======
-->
<target name="test.schema.clean" depends="test.clean">
<delete dir="${test.schema.results.dir}" quiet="true"/>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${test.schema.results.dir}" includes="**/*.*"/>
</delete>
<delete dir="${test.schema.results.dir}" quiet="true"/>
</target>
<!--
============================================================ =======
TARGET : prepare
============================================================ =======
-->
<target name="prepare">
<echo message="Making dir ${classes.dir}" level="debug"/>
<echo message="Making dir ${test.classes.dir}" level="debug"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${test.classes.dir}"/>
</target>
<!--
============================================================ =======
TARGET : prepare.Enhancer
============================================================ =======
-->
<target name="prepare.Enhancer">
<echo message="Making dir ${Enhancer.test.classes.dir}"
level="debug"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${Enhancer.test.classes.dir}"/>
</target>
<!--
============================================================ =======
TARGET : test
============================================================ =======
-->
<target name="test" description="Runs all JUnit tests.">
<echo
message=" ============================================================ ======= "/>
<echo message="Database configuration for testing:"/>
<echo message="database.driver =
${javax.jdo.option.ConnectionDriverName}"/>
<echo message="database.url =
${javax.jdo.option.ConnectionURL}"/>
<echo message="database.user =
${javax.jdo.option.ConnectionUserName}"/>
<echo
message=" ============================================================ ======= "/>
<antcall target="test.general"/>
<antcall target="test.datastore"/>
<antcall target="test.application"/>
<antcall target="test.schema"/>
<antcall target="test.Enhancer"/>
</target>
<!--
============================================================ =======
TARGET : test.general
============================================================ =======
-->
<target name="test.general"
depends=" test.general.clean,compile,test.general.copy.properties,enha nce ">
<echo
message=" ============================================================ ======= "/>
<echo message="General tests"/>
<echo
message=" ============================================================ ======= "/>
<mkdir dir="${test.general.results.dir}"/>
<copy todir="${test.classes.dir}" failonerror="no">
<fileset dir="." includes="${test.log4j.configuration}"/>
</copy>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="test.jdbc.classpath"/>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<formatter type="xml"/>
<sysproperty key="org.jpox.autoCreateSchema"
value="${org.jpox.autoCreateSchema}"/>
<sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
value="org.jpox.PersistenceManagerFactoryImpl"/>
<sysproperty key="javax.jdo.option.ConnectionDriverName"
value="${javax.jdo.option.ConnectionDriverName}"/>
<sysproperty key="javax.jdo.option.ConnectionURL"
value="${javax.jdo.option.ConnectionURL}"/>
<sysproperty key="javax.jdo.option.ConnectionUserName"
value="${javax.jdo.option.ConnectionUserName}"/>
<sysproperty key="javax.jdo.option.ConnectionPassword"
value="${javax.jdo.option.ConnectionPassword}"/>
<sysproperty key="org.jpox.autoCreateTables"
value="${org.jpox.autoCreateTables}"/>
<sysproperty key="org.jpox.validateTables"
value="${org.jpox.validateTables}"/>
<sysproperty key="org.jpox.autoCreateConstraints"
value="${org.jpox.autoCreateConstraints}"/>
<sysproperty key="org.jpox.validateConstraints"
value="${org.jpox.validateConstraints}"/>
<sysproperty key="log4j.configuration"
value="${test.log4j.configuration}"/>
<batchtest fork="yes" todir="${test.general.results.dir}">
<fileset dir="${test.classes.dir}"
includes="${test.suite.general}"/>
</batchtest>
<test name="org.jpox.FinishScenarioTest"
todir="${test.general.results.dir}"/>
</junit>
<junitreport todir="${test.general.results.dir}">
<fileset dir="${test.general.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="${test.general.results.dir}/html"/>
</junitreport>
</target>
<!--
============================================================ =======
TARGET : test.datastore
============================================================ =======
-->
<target name="test.datastore"
depends=" test.datastore.clean,compile,test.datastore.copy.properties, enhance ">
<echo
message=" ============================================================ ======= "/>
<echo message="Datastore tests"/>
<echo
message=" ============================================================ ======= "/>
<mkdir dir="${test.datastore.results.dir}"/>
<copy todir="${test.classes.dir}" failonerror="no">
<fileset dir="." includes="${test.log4j.configuration}"/>
</copy>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="test.jdbc.classpath"/>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<formatter type="xml"/>
<sysproperty key="org.jpox.autoCreateSchema"
value="${org.jpox.autoCreateSchema}"/>
<sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
value="org.jpox.PersistenceManagerFactoryImpl"/>
<sysproperty key="javax.jdo.option.ConnectionDriverName"
value="${javax.jdo.option.ConnectionDriverName}"/>
<sysproperty key="javax.jdo.option.ConnectionURL"
value="${javax.jdo.option.ConnectionURL}"/>
<sysproperty key="javax.jdo.option.ConnectionUserName"
value="${javax.jdo.option.ConnectionUserName}"/>
<sysproperty key="javax.jdo.option.ConnectionPassword"
value="${javax.jdo.option.ConnectionPassword}"/>
<sysproperty key="org.jpox.autoCreateTables"
value="${org.jpox.autoCreateTables}"/>
<sysproperty key="org.jpox.validateTables"
value="${org.jpox.validateTables}"/>
<sysproperty key="org.jpox.autoCreateConstraints"
value="${org.jpox.autoCreateConstraints}"/>
<sysproperty key="org.jpox.validateConstraints"
value="${org.jpox.validateConstraints}"/>
<sysproperty key="log4j.configuration"
value="${test.log4j.configuration}"/>
<batchtest fork="yes" todir="${test.datastore.results.dir}">
<fileset dir="${test.classes.dir}"
includes="${test.suite.datastore}"/>
</batchtest>
<test name="org.jpox.FinishScenarioTest"
todir="${test.datastore.results.dir}"/>
</junit>
<junitreport todir="${test.datastore.results.dir}">
<fileset dir="${test.datastore.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="${test.datastore.results.dir}/html"/>
</junitreport>
</target>
<!--
============================================================ =======
TARGET : test.application
============================================================ =======
-->
<target name="test.application"
depends=" test.application.clean,compile,test.application.copy.propert ies,enhance ">
<echo
message=" ============================================================ ======= "/>
<echo message="Application tests"/>
<echo
message=" ============================================================ ======= "/>
<mkdir dir="${test.application.results.dir}"/>
<copy todir="${test.classes.dir}" failonerror="no">
<fileset dir="." includes="${test.log4j.configuration}"/>
</copy>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="test.jdbc.classpath"/>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<formatter type="xml"/>
<sysproperty key="org.jpox.autoCreateSchema"
value="${org.jpox.autoCreateSchema}"/>
<sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
value="org.jpox.PersistenceManagerFactoryImpl"/>
<sysproperty key="javax.jdo.option.ConnectionDriverName"
value="${javax.jdo.option.ConnectionDriverName}"/>
<sysproperty key="javax.jdo.option.ConnectionURL"
value="${javax.jdo.option.ConnectionURL}"/>
<sysproperty key="javax.jdo.option.ConnectionUserName"
value="${javax.jdo.option.ConnectionUserName}"/>
<sysproperty key="javax.jdo.option.ConnectionPassword"
value="${javax.jdo.option.ConnectionPassword}"/>
<sysproperty key="org.jpox.autoCreateTables"
value="${org.jpox.autoCreateTables}"/>
<sysproperty key="org.jpox.validateTables"
value="${org.jpox.validateTables}"/>
<sysproperty key="org.jpox.autoCreateConstraints"
value="${org.jpox.autoCreateConstraints}"/>
<sysproperty key="org.jpox.validateConstraints"
value="${org.jpox.validateConstraints}"/>
<sysproperty key="log4j.configuration"
value="${test.log4j.configuration}"/>
<batchtest fork="yes" todir="${test.application.results.dir}">
<fileset dir="${test.classes.dir}"
includes="${test.suite.application}"/>
</batchtest>
<test name="org.jpox.FinishScenarioTest"
todir="${test.application.results.dir}"/>
</junit>
<junitreport todir="${test.application.results.dir}">
<fileset dir="${test.application.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="${test.application.results.dir}/html"/>
</junitreport>
</target>
<!--
============================================================ =======
TARGET : test.schema
============================================================ =======
-->
<target name="test.schema"
depends=" test.schema.clean,compile,test.schema.copy.properties,enhanc e ">
<echo
message=" ============================================================ ======= "/>
<echo message="Custom schema tests"/>
<echo
message=" ============================================================ ======= "/>
<mkdir dir="${test.schema.results.dir}"/>
<copy todir="${test.classes.dir}" failonerror="no">
<fileset dir="." includes="${test.log4j.configuration}"/>
</copy>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="test.jdbc.classpath"/>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<formatter type="xml"/>
<sysproperty key="org.jpox.autoCreateSchema"
value="${org.jpox.autoCreateSchema}"/>
<sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
value="org.jpox.PersistenceManagerFactoryImpl"/>
<sysproperty key="javax.jdo.option.ConnectionDriverName"
value="${javax.jdo.option.ConnectionDriverName}"/>
<sysproperty key="javax.jdo.option.ConnectionURL"
value="${javax.jdo.option.ConnectionURL}"/>
<sysproperty key="javax.jdo.option.ConnectionUserName"
value="${javax.jdo.option.ConnectionUserName}"/>
<sysproperty key="javax.jdo.option.ConnectionPassword"
value="${javax.jdo.option.ConnectionPassword}"/>
<sysproperty key="org.jpox.autoCreateTables"
value="${org.jpox.autoCreateTables}"/>
<sysproperty key="org.jpox.validateTables"
value="${org.jpox.validateTables}"/>
<sysproperty key="org.jpox.autoCreateConstraints"
value="${org.jpox.autoCreateConstraints}"/>
<sysproperty key="org.jpox.validateConstraints"
value="${org.jpox.validateConstraints}"/>
<sysproperty key="log4j.configuration"
value="${test.log4j.configuration}"/>
<batchtest fork="yes" todir="${test.schema.results.dir}">
<fileset dir="${test.classes.dir}"
includes="${test.suite.schema}"/>
</batchtest>
<test name="org.jpox.FinishScenarioTest"
todir="${test.schema.results.dir}"/>
</junit>
<junitreport todir="${test.schema.results.dir}">
<fileset dir="${test.schema.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="${test.schema.results.dir}/html"/>
</junitreport>
</target>
<!--
============================================================ =======
TARGET : test.Enhancer
============================================================ =======
-->
<target name="test.Enhancer"
depends=" compile.Enhancer,compile.Enhancer.test,test.Enhancer.copy.pr operties ">
<echo
message=" ============================================================ ======= "/>
<echo message="Enhancer tests"/>
<echo
message=" ============================================================ ======= "/>
<mkdir dir="${Enhancer.test.results.dir}"/>
<copy todir="${Enhancer.test.classes.dir}" failonerror="no">
<fileset dir="."
includes="${Enhancer.test.log4j.configuration}"/>
</copy>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${Enhancer.test.classes.dir}"/>
</classpath>
<formatter type="xml"/>
<sysproperty key="log4j.configuration"
value="${Enhancer.test.log4j.configuration}"/>
<batchtest fork="yes" todir="${Enhancer.test.results.dir}">
<fileset dir="${Enhancer.test.classes.dir}"
includes="**/TestA**.class"/>
</batchtest>
</junit>
<junitreport todir="${Enhancer.test.results.dir}">
<fileset dir="${Enhancer.test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="${Enhancer.test.results.dir}/html"/>
</junitreport>
</target>
<!--
============================================================ =======
TARGET : compile
============================================================ =======
-->
<target name="compile"
depends=" copy-jars,prepare,compile.java,compile.test,compile.Enhancer ,copy.properties "/>
<!--
============================================================ =======
TARGET : compile.java
============================================================ =======
-->
<target name="compile.java">
<echo
message=" ============================================================ ======= "/>
<echo message="Your source configuration:"/>
<echo message="src.java.dir = ${src.java.dir}"/>
<echo message="classes.dir = ${classes.dir}"/>
<echo
message=" ============================================================ ======= "/>
<javac srcdir="${src.java.dir}" destdir="${classes.dir}"
debug="${project.build.debug}" classpathref="project.classpath">
<include name="org/jpox/**/*.java"/>
</javac>
</target>
<!--
============================================================ =======
TARGET : compile.Enhancer
============================================================ =======
-->
<target name="compile.Enhancer" depends="prepare.Enhancer">
<echo
message=" ============================================================ ======= "/>
<echo message="Your source configuration:"/>
<echo message="Enhancer.src.java.dir =
${Enhancer.src.java.dir}"/>
<echo message="classes.dir = ${classes.dir}"/>
<echo
message=" ============================================================ ======= "/>
<javac srcdir="${Enhancer.src.java.dir}" destdir="${classes.dir}"
debug="${project.build.debug}" classpathref="project.classpath">
<include name="org/jpox/**/*.java"/>
</javac>
<copy todir="${classes.dir}">
<fileset dir="${Enhancer.src.java.dir}"
includes="**/*.properties"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : compile.Enhancer.test
============================================================ =======
-->
<target name="compile.Enhancer.test">
<echo
message=" ============================================================ ======= "/>
<echo message="Your test configuration:"/>
<echo message="Enhancer.test.java.dir =
${Enhancer.test.java.dir}"/>
<echo message="test.classes.dir = ${test.classes.dir}"/>
<echo
message=" ============================================================ ======= "/>
<javac srcdir="${Enhancer.test.java.dir}"
destdir="${Enhancer.test.classes.dir}" debug="${project.build.debug}"
classpathref="project.classpath">
<include name="org/jpox/**/*.java"/>
</javac>
</target>
<!--
============================================================ =======
TARGET : compile.test
============================================================ =======
-->
<target name="compile.test">
<echo
message=" ============================================================ ======= "/>
<echo message="Your test configuration:"/>
<echo message="test.java.dir = ${test.java.dir}"/>
<echo message="test.classes.dir = ${test.classes.dir}"/>
<echo
message=" ============================================================ ======= "/>
<javac srcdir="${test.java.dir}" destdir="${test.classes.dir}"
debug="${project.build.debug}" classpathref="project.classpath">
<include name="org/jpox/**/*.java"/>
</javac>
</target>
<!--
============================================================ =======
TARGET : enhance.Enhancer
============================================================ =======
-->
<target name="enhance.Enhancer" depends="compile,compile.Enhancer">
<taskdef name="jpox-enhancer"
classname="org.jpox.enhancer.tools.EnhancerTask">
<classpath refid="project.classpath"/>
</taskdef>
<jpox-enhancer failonerror="false" fork="true"
dir="${test.classes.dir}" verbose="true" destination="${test.classes.dir}"
check="true">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
</jpox-enhancer>
<jpox-enhancer failonerror="false" fork="true"
dir="${test.classes.dir}" checkonly="true">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
</jpox-enhancer>
</target>
<!--
============================================================ =======
TARGET : enhance.jdori
============================================================ =======
-->
<target name="enhance.jdori">
<taskdef name="enhancer" classname="org.jpox.enhance.EnhancerTask">
<classpath refid="project.classpath"/>
</taskdef>
<enhancer destination="${test.classes.dir}"
dir="${test.classes.dir}" verbose="false" checkonly="false">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<include name="**/*.jdo"/>
</enhancer>
<enhancer dir="${test.classes.dir}" verbose="false"
checkonly="true">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<include name="**/*.jdo"/>
</enhancer>
</target>
<!--
============================================================ =======
TARGET : enhance
============================================================ =======
-->
<target name="enhance" depends="enhance.Enhancer"/>
<!--
============================================================ =======
TARGET : copy.properties
============================================================ =======
-->
<target name="copy.properties">
<copy todir="${classes.dir}">
<fileset dir="${src.java.dir}" includes="**/*.properties"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : test.copy.properties
============================================================ =======
-->
<target name="test.copy.properties">
<copy todir="${test.classes.dir}">
<fileset dir="${test.java.dir}"
includes="**/*.properties,**/*.lcf,**/*.jdo"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : test.general.copy.properties
============================================================ =======
-->
<target name="test.general.copy.properties"
depends="test.copy.properties">
</target>
<!--
============================================================ =======
TARGET : test.datastore.copy.properties
============================================================ =======
-->
<target name="test.datastore.copy.properties"
depends="test.copy.properties">
<copy todir="${test.classes.dir}">
<fileset dir="${test.java.dir}"
includes="**/*.properties,**/*.jdod"/>
<mapper type="glob" from="*.jdod" to="*.jdo"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : test.application.copy.properties
============================================================ =======
-->
<target name="test.application.copy.properties"
depends="test.copy.properties">
<copy todir="${test.classes.dir}">
<fileset dir="${test.java.dir}"
includes="**/*.properties,**/*.jdoa"/>
<mapper type="glob" from="*.jdoa" to="*.jdo"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : test.schema.copy.properties
============================================================ =======
-->
<target name="test.schema.copy.properties"
depends="test.copy.properties">
<copy todir="${test.classes.dir}">
<fileset dir="${test.java.dir}"
includes="**/*.properties,**/*.jdo"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : test.Enhancer.copy.properties
============================================================ =======
-->
<target name="test.Enhancer.copy.properties"
depends="test.copy.properties">
<copy todir="${Enhancer.test.classes.dir}">
<fileset dir="${Enhancer.test.java.dir}"
includes="**/*.properties,**/*.jdo"/>
</copy>
</target>
<!--
============================================================ =======
TARGET : version
============================================================ =======
-->
<target name="version">
<echo message="${Name} ${version}" file="VERSION.txt"/>
</target>
<!--
============================================================ =======
TARGET : srczip
============================================================ =======
-->
<target name="srczip" depends="version">
<mkdir dir="${dist.dir}"/>
<delete file="${dist.src.file}"/>
<zip zipfile="${dist.src.file}" update="true">
<zipfileset dir="." prefix="${dist.name}" includes="
**/*.css,
**/*.gif,
**/*.html,
**/*.java,
build.xml,
build.properties,
checkstyle.xml,
LICENSE.txt,
maven.xml,
project.xml,
project.properties
README.txt,
VERSION.txt" excludes="${javadoc.dir}/**"/>
</zip>
</target>
<!--
============================================================ =======
TARGET : release
============================================================ =======
-->
<target name="release" depends="binzip,bintargz"/>
<!--
============================================================ =======
TARGET : binzip
============================================================ =======
-->
<target name="binzip" depends="version,javadoc,srczip,rar">
<mkdir dir="${dist.dir}"/>
<delete file="${dist.bin.zip.file}"/>
<zip zipfile="${dist.bin.zip.file}">
<zipfileset dir="." prefix="${dist.name}" includes="
${doc.dir}/**/*,
${dist.src.file},
${jar.file},
LICENSE.txt,
README.txt,
VERSION.txt" excludes="${doc.dir}/api/src-html/**/*"/>
</zip>
</target>
<!--
============================================================ =======
TARGET : bintar
============================================================ =======
-->
<target name="bintar" depends="version,javadoc,srczip,rar">
<mkdir dir="${dist.dir}"/>
<delete file="${dist.bin.tar.file}"/>
<tar destfile="${dist.bin.tar.file}">
<tarfileset dir="." prefix="${dist.name}" includes="
${doc.dir}/**/*,
${dist.src.file},
${jar.file},
LICENSE.html,
README.txt,
VERSION.txt" excludes="${doc.dir}/api/src-html/**/*"/>
</tar>
</target>
<!--
============================================================ =======
TARGET : bintargz
============================================================ =======
-->
<target name="bintargz" depends="bintar">
<gzip zipfile="${dist.bin.targz.file}" src="${dist.bin.tar.file}"/>
</target>
<!--
============================================================ =======
TARGET : rar
============================================================ =======
-->
<target name="rar" depends="version,jar">
<mkdir dir="${dist.dir}"/>
<delete file="${dist.rar.file}"/>
<zip zipfile="${dist.rar.file}">
<zipfileset dir="." prefix="" fullpath="${dist.name}.jar"
includes="${jar.file}"/>
<zipfileset dir="." prefix="" fullpath="jdo.jar"
includes="${dependency.jdo.location}"/>
<zipfileset dir="." prefix=""
fullpath="${dependency.log4j.jar.name}"
includes="${dependency.log4j.location}"/>
<zipfileset dir="." prefix="" includes="LICENSE.html"/>
<zipfileset dir="." prefix="" includes="README.txt"/>
<zipfileset dir="." prefix="" includes="VERSION.txt"/>
<zipfileset dir="${metainf.dir}" prefix="META-INF"
includes="**/*"/>
</zip>
</target>
<!--
============================================================ =======
TARGET : jar
============================================================ =======
-->
<target name="jar" depends="compile">
<mkdir dir="${bin.dir}"/>
<zip zipfile="${jar.file}" update="true">
<zipfileset dir="${classes.dir}"
includes="**/*.class,**/*.properties"/>
<zipfileset dir="."
includes="LICENSE.html,README.txt,VERSION.txt"/>
</zip>
</target>
<!--
============================================================ =======
TARGET : javadoc
============================================================ =======
-->
<target name="javadoc">
<mkdir dir="${javadoc.dir}"/>
<delete quiet="true" file="${javadoc.dir}/index.html"/>
<javadoc sourcepath="${src.java.dir}"
classpathref="project.classpath" destdir="${javadoc.dir}"
packagenames="org.jpox.*,javax.*" overview="${src.java.dir}/overview.html"
footer="<a
href="http://sourceforge.net/projects/jpox"><img
src="http://sourceforge.net/sflogo.php?group_id=35302&type=1"
width="88" height="31" border="0"
alt="SourceForge.net_Logo">< /a> " author="true"
source="1.3">
<link href="http://java.sun.com/j2se/1.3/docs/api/"/>
</javadoc>
</target>
<!--
============================================================ =======
TARGET : copy-jars
============================================================ =======
-->
<target name="copy-jars" description="Copy .jar files into lib, so
that the same files are available to build as in the runtime environment.">
<jarlib-resolve property="${dependency.ant.library}"
failOnError="false" checkExtension="false">
<extension extensionName="${dependency.ant.name}"/>
<location location="${dependency.ant.location}"/>
<url url="${dependency.ant.url}"
destfile="${dependency.ant.location}"/>
</jarlib-resolve>
<jarlib-resolve property="${dependency.junit.library}"
failOnError="false" checkExtension="false">
<extension extensionName="${dependency.junit.name}"/>
<location location="${dependency.junit.location}"/>
<url url="${dependency.junit.url}"
destfile="${dependency.junit.location}"/>
</jarlib-resolve>
<jarlib-resolve property="${dependency.commons-dbcp.library}"
failOnError="false" checkExtension="false">
<extension extensionName="${dependency.commons-dbcp.name}"/>
<location location="${dependency.commons-dbcp.location}"/>
<url url="${dependency.commons-dbcp.url}"
destfile="${dependency.commons-dbcp.location}"/>
</jarlib-resolve>
<jarlib-resolve property="${dependency.commons-pool.library}"
failOnError="false" checkExtension="false">
<extension extensionName="${dependency.commons-pool.name}"/>
<location location="${dependency.commons-pool.location}"/>
<url url="${dependency.commons-pool.url}"
destfile="${dependency.commons-pool.location}"/>
</jarlib-resolve>
<jarlib-resolve
property="${dependency.commons-collections.library}" failOnError="false"
checkExtension="false">
<extension
extensionName="${dependency.commons-collections.name}"/>
<location
location="${dependency.commons-collections.location}"/>
<url url="${dependency.commons-collections.url}"
destfile="${dependency.commons-collections.location}"/>
</jarlib-resolve>
<jarlib-resolve property="${dependency.log4j.library}"
failOnError="false" checkExtension="false">
<extension extensionName="${dependency.log4j.name}"/>
<location location="${dependency.log4j.location}"/>
<url url="${dependency.log4j.url}"
destfile="${dependency.log4j.location}"/>
</jarlib-resolve>
<jarlib-resolve property="${dependency.bcel.library}"
failOnError="false" checkExtension="false">
<extension extensionName="${dependency.bcel.name}"/>
<location location="${dependency.bcel.location}"/>
<url url="${dependency.bcel.url}"
destfile="${dependency.bcel.location}"/>
</jarlib-resolve>
</target>
</project>
I'm starting ant with this:
java -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend= y
-Dant.home=${ANT_HOME} org.apache.tools.ant.Main -verbose -propertyfile
/home/mburke/m7/workspace/JPOX/build.properties test
after hardcoding the offending ${} I'm getting the 'can't find javac
compiler'
Thanks for the help.
> "Michael Burke" <mpjburke@verizon.net> wrote in message
> news:cf98af$4qe$1@eclipse.org...
> > I'm trying to run ant as a remote process so I can debug my junit tests.
> > When I run ant from a terminal window it throws exceptions complaining
> > about directories not existing. the directories exist, and when i run the
> > same build.xml file from within eclipse it suns fine. Here's the
> exception:
> > compile.test:
> > [echo]
> > ============================================================ =======
> > [echo] Your test configuration:
> > [echo] test.java.dir = src/${test.dir}
> > [echo] test.classes.dir = ${test.dir}/${classes.dir}
> > [echo]
> > ============================================================ =======
> > [antcall] Exiting /home/mburke/m7/workspace/JPOX/build.xml.
> >
> > BUILD FAILED
> > /home/mburke/m7/workspace/JPOX/build.xml:206: Following error occured
> > while executing this line
> > /home/mburke/m7/workspace/JPOX/build.xml:502: srcdir
> > "/home/mburke/m7/workspace/JPOX/src/${test.dir}" does not exist!
> >
> > in build.properties I have this:
> > test.dir=test
> > test.java.dir=src/${test.dir}
> >
|
|
|
Re: Ant can't find directory [message #172771 is a reply to message #172756] |
Tue, 10 August 2004 21:41   |
Eclipse User |
|
|
|
"Michael Burke" <mpjburke@verizon.net> wrote in message
news:cfbnsu$p5a$1@eclipse.org...
> Darin Swanson wrote:
>
> > So the build works within Eclipse but does not work from the
commandline?
> > Only run the build in Eclipse :-) (Sorry couldn't resist)
>
> > It would appear that you are referencing a property that is not defined.
> > ${test.dir} ??
>
> > Without seeing your whole buildfile it is a little hard to diagnose but
how
> > are you referencing the build.properties file so that the properties are
> > defined?
>
> > Darins
>
> Darin, I can see you're a true Eclipse evangelist. I changed
> build.properties to remove the offending ${} variables and tried again and
> got an error saying
> ant was unable to find a javac compiler. Just to clarify, I'm running any
> in a terminal window and trying to attach to it in order to debug junit
> tests (from what I've read this is the only way to debug the tests if I'm
> using ant. Here's the build.properties file:
>
> #######################################
> # project properties
> #######################################
> Name=JPOX
> name=${Name}
> version=1.0.0
>
> #######################################
> # JDO
> #######################################
>
> #core
> #src.dir=src
> src.java.dir=src/java
>
> #Enhancer project
> Enhancer.src.dir=Enhancer/src
> Enhancer.src.java.dir=${Enhancer.src.dir}/java
>
> #lib
> lib.dir=lib
>
> #builds
> bin.dir=bin
> classes.dir=classes
> jar.file=${bin.dir}/${name}.jar
>
> #######################################
> # JDO build dependencies
> #######################################
> jdo.file=${lib.dir}/jdo-2.0.jar
> log4j.file=${lib.dir}/log4j.jar
>
> #######################################
> # JCA
> #######################################
> metainf.dir=${src.java.dir}/META-INF
>
> #######################################
> # distribution
> #######################################
> dist.name=${name}-${version}
> dist.base=distribution
> dist.dir=dist
> dist.src.file=${dist.dir}/${dist.name}-src.zip
> dist.bin.zip.file=${dist.dir}/${dist.name}.zip
> dist.bin.tar.file=${dist.dir}/${dist.name}.tar
> dist.bin.targz.file=${dist.dir}/${dist.name}.tar.gz
> dist.rar.file=${dist.dir}/${dist.name}.rar
>
> #######################################
> # third party dependencies
> #######################################
> dependency.ant.name=org.apache.ant
> dependency.ant.library=ant.library
> dependency.ant.url=http://www.ibiblio.org/maven/ant/jars/ant-1.6.jar
> dependency.ant.location=${lib.dir}/ant-1.6.jar
>
> dependency.junit.name=junit
> dependency.junit.library=junit.library
>
dependency.junit.url=http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar
> dependency.junit.location=${lib.dir}/junit-3.8.1.jar
>
> dependency.commons-dbcp.name=org.apache.commons.dbcp
> dependency.commons-dbcp.library=commons-dbcp.library
>
dependency.commons-dbcp.url=http://www.ibiblio.org/maven/commons-dbcp/jars/c
ommons-dbcp-1.0.jar
> dependency.commons-dbcp.location=${lib.dir}/commons-dbcp-1.0 .jar
>
> dependency.commons-pool.name=org.apache.commons.pool
> dependency.commons-pool.library=commons-pool.library
>
dependency.commons-pool.url=http://www.ibiblio.org/maven/commons-pool/jars/c
ommons-pool-1.0.jar
> dependency.commons-pool.location=${lib.dir}/commons-pool-1.0 .jar
>
> dependency.commons-collections.name=org.apache.commons.colle ctions
> dependency.commons-collections.library=commons-collections.l ibrary
>
dependency.commons-collections.url=http://www.ibiblio.org/maven/commons-coll
ections/jars/commons-collections-2.0.jar
>
dependency.commons-collections.location=${lib.dir}/commons-c ollections-2.0.j
ar
>
> dependency.bcel.name=org.apache.commons.org.apache.bcel
> dependency.bcel.library=bcel.library
> dependency.bcel.url=http://www.ibiblio.org/maven/bcel/jars/bcel-5.1.jar
> dependency.bcel.location=${lib.dir}/bcel-5.1.jar
>
> dependency.log4j.name=log4j
> dependency.log4j.library=log4j.library
> dependency.log4j.jar.name=log4j-1.2.8.jar
>
dependency.log4j.url=http://www.ibiblio.org/maven/log4j/jars/${dependency.lo
g4j.jar.name}
> dependency.log4j.location=${lib.dir}/${dependency.log4j.jar. name}
>
> dependency.jca.location=${lib.dir}/jca-1.0.jart
> dependency.jta.location=${lib.dir}/jta-1.0.1B.jar
> dependency.jdbc.location=${lib.dir}/jdbc2_0-stdext.jar
> dependency.jaas.location=${lib.dir}/jaas-1.0.01.jar
> dependency.jdo.location=${jdo.file}
> dependency.jdori.location=${lib.dir}/jdori.jar
> dependency.oracle.jdbc.location=${lib.dir}/ojdbc14.jar
> #######################################
> # documentation
> #######################################
> doc.dir=doc
> javadoc.dir=${doc.dir}/api
>
> #######################################
> # test properties
> #######################################
> test.dir=test
> test.java.dir=src/test
> test.results.dir=${test.dir}/results
> test.general.results.dir=${test.results.dir}/general
> test.datastore.results.dir=${test.results.dir}/datastore
> test.application.results.dir=${test.results.dir}/application
> test.schema.results.dir=${test.results.dir}/schema
> test.classes.dir=${test.dir}/${classes.dir}
>
> test.log4j.configuration = log4j.lcf
>
> Enhancer.test.dir=test
> Enhancer.test.java.dir=${Enhancer.src.dir}/${Enhancer.test.d ir}
> Enhancer.test.results.dir=${Enhancer.test.dir}/results
> Enhancer.test.classes.dir=${Enhancer.test.dir}/${classes.dir }
>
> Enhancer.test.log4j.configuration = log4j.lcf
>
>
> #directory that contains jars of your jdbc driver
> test.jdbc.dir=/home/mburke/mysql-connector-java-3.0.11-stabl e
>
> #######################################
> # test database properties
> #######################################
> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
> javax.jdo.option.ConnectionURL=jdbc:mysql://localhost/jpox
> javax.jdo.option.ConnectionUserName=sa
> javax.jdo.option.ConnectionPassword=password
> org.jpox.autoCreateTables=true
> org.jpox.validateTables=true
> org.jpox.autoCreateConstraints=true
> org.jpox.validateConstraints=true
> org.jpox.autoCreateSchema=false
>
> and the build.xml:
>
> <!--
> == JPOX
> -->
> <project name="jpox" default="help">
> <property environment="env"/>
> <property name="project.location" location="."/>
> <property file="${project.location}/build.properties"/>
> <property file="${project.location}/jpox.properties"/>
> <property file="${project.location}/test.properties"/>
> <property name="project.build.debug" value="on"/>
>
> <taskdef resource="clovertasks"/>
>
> <target name="with.clover">
> <clover-setup initString="coverage.db"/>
> </target>
>
> <target name="clover.html" depends="with.clover">
> <clover-log span="1h"/>
> <clover-report>
> <current outfile="clover_html">
> <format type="html"/>
> </current>
> </clover-report>
> </target>
>
> <path id="lib.classpath">
> <pathelement path="${ant.home}/lib/clover.jar"/>
> <pathelement location="${dependency.bcel.location}"/>
> <pathelement location="${dependency.commons-dbcp.location}"/>
> <pathelement
> location="${dependency.commons-collections.location}"/>
> <pathelement location="${dependency.commons-pool.location}"/>
> <pathelement location="${dependency.junit.location}"/>
> <pathelement location="${dependency.log4j.location}"/>
> <pathelement location="${dependency.ant.location}"/>
> <pathelement location="${dependency.jaas.location}"/>
> <pathelement location="${dependency.jca.location}"/>
> <pathelement location="${dependency.jta.location}"/>
> <pathelement location="${dependency.jdbc.location}"/>
> <pathelement location="${dependency.jdo.location}"/>
> <pathelement location="${dependency.jdori.location}"/>
> <pathelement location="${dependency.oracle.jdbc.location}"/>
> </path>
>
> <path id="project.classpath">
> <pathelement location="${classes.dir}"/>
> <path refid="lib.classpath"/>
> </path>
>
> <path id="test.jdbc.classpath">
> <fileset dir="${test.jdbc.dir}">
> <include name="**/*.jar"/>
> </fileset>
> </path>
>
> <property name="generated.dist.files"
> value="${dist.bin.file},${dist.src.file}"/>
>
> <!--
> ============================================================ =======
> TARGET : all
> ============================================================ =======
> -->
> <target name="all" depends="clean,compile,test,release"/>
>
> <!--
> ============================================================ =======
> TARGET : help
> ============================================================ =======
> -->
> <target name="help">
> <echo>
> Targets available:
> - all
> Cleans, compiles, run tests and creates the release files.
>
> - compile
> Compiles functional classes only.
>
> - clean
> Deletes build output.
>
> - test
> Runs the suite of tests.
>
> - release
> Create binary and source files for the formats: jar, zip, tar and targz.
> </echo>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : clean
> ============================================================ =======
> -->
> <target name="clean">
> <delete includeEmptyDirs="true" quiet="true">
> <fileset dir="${classes.dir}"
> includes="**/*.class,**/*.properties,**/*.*"/>
> <fileset dir="${test.classes.dir}"
> includes="**/*.class,**/*.properties"/>
> <fileset dir="${Enhancer.test.classes.dir}"
> includes="**/*.class,**/*.properties"/>
> <fileset dir="." includes="${generated.dist.files}"/>
> </delete>
> <delete dir="${classes.dir}" quiet="true"/>
> <delete dir="${test.classes.dir}" quiet="true"/>
> <delete dir="${Enhancer.test.classes.dir}" quiet="true"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.clean
> ============================================================ =======
> -->
> <target name="test.clean">
> <delete includeEmptyDirs="true" quiet="true">
> <fileset dir="${test.classes.dir}" includes="**/*.*"/>
> </delete>
> <delete dir="${test.classes.dir}" quiet="true"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.general.clean
> ============================================================ =======
> -->
> <target name="test.general.clean" depends="test.clean">
> <delete dir="${test.general.results.dir}" quiet="true"/>
> <delete includeEmptyDirs="true" quiet="true">
> <fileset dir="${test.general.results.dir}" includes="**/*.*"/>
> </delete>
> <delete dir="${test.general.results.dir}" quiet="true"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.datastore.clean
> ============================================================ =======
> -->
> <target name="test.datastore.clean" depends="test.clean">
> <delete dir="${test.datastore.results.dir}" quiet="true"/>
> <delete includeEmptyDirs="true" quiet="true">
> <fileset dir="${test.datastore.results.dir}"
> includes="**/*.*"/>
> </delete>
> <delete dir="${test.datastore.results.dir}" quiet="true"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.application.clean
> ============================================================ =======
> -->
> <target name="test.application.clean" depends="test.clean">
> <delete dir="${test.application.results.dir}" quiet="true"/>
> <delete includeEmptyDirs="true" quiet="true">
> <fileset dir="${test.application.results.dir}"
> includes="**/*.*"/>
> </delete>
> <delete dir="${test.application.results.dir}" quiet="true"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.schema.clean
> ============================================================ =======
> -->
> <target name="test.schema.clean" depends="test.clean">
> <delete dir="${test.schema.results.dir}" quiet="true"/>
> <delete includeEmptyDirs="true" quiet="true">
> <fileset dir="${test.schema.results.dir}" includes="**/*.*"/>
> </delete>
> <delete dir="${test.schema.results.dir}" quiet="true"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : prepare
> ============================================================ =======
> -->
> <target name="prepare">
> <echo message="Making dir ${classes.dir}" level="debug"/>
> <echo message="Making dir ${test.classes.dir}" level="debug"/>
> <mkdir dir="${classes.dir}"/>
> <mkdir dir="${test.classes.dir}"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : prepare.Enhancer
> ============================================================ =======
> -->
> <target name="prepare.Enhancer">
> <echo message="Making dir ${Enhancer.test.classes.dir}"
> level="debug"/>
> <mkdir dir="${classes.dir}"/>
> <mkdir dir="${Enhancer.test.classes.dir}"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test
> ============================================================ =======
> -->
> <target name="test" description="Runs all JUnit tests.">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Database configuration for testing:"/>
> <echo message="database.driver =
> ${javax.jdo.option.ConnectionDriverName}"/>
> <echo message="database.url =
> ${javax.jdo.option.ConnectionURL}"/>
> <echo message="database.user =
> ${javax.jdo.option.ConnectionUserName}"/>
> <echo
>
message=" ============================================================ =======
"/>
> <antcall target="test.general"/>
> <antcall target="test.datastore"/>
> <antcall target="test.application"/>
> <antcall target="test.schema"/>
> <antcall target="test.Enhancer"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.general
> ============================================================ =======
> -->
> <target name="test.general"
> depends=" test.general.clean,compile,test.general.copy.properties,enha nce ">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="General tests"/>
> <echo
>
message=" ============================================================ =======
"/>
> <mkdir dir="${test.general.results.dir}"/>
> <copy todir="${test.classes.dir}" failonerror="no">
> <fileset dir="." includes="${test.log4j.configuration}"/>
> </copy>
>
> <junit printsummary="yes" fork="yes" haltonfailure="no">
> <classpath>
> <path refid="test.jdbc.classpath"/>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> <formatter type="xml"/>
> <sysproperty key="org.jpox.autoCreateSchema"
> value="${org.jpox.autoCreateSchema}"/>
> <sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
> value="org.jpox.PersistenceManagerFactoryImpl"/>
> <sysproperty key="javax.jdo.option.ConnectionDriverName"
> value="${javax.jdo.option.ConnectionDriverName}"/>
> <sysproperty key="javax.jdo.option.ConnectionURL"
> value="${javax.jdo.option.ConnectionURL}"/>
> <sysproperty key="javax.jdo.option.ConnectionUserName"
> value="${javax.jdo.option.ConnectionUserName}"/>
> <sysproperty key="javax.jdo.option.ConnectionPassword"
> value="${javax.jdo.option.ConnectionPassword}"/>
> <sysproperty key="org.jpox.autoCreateTables"
> value="${org.jpox.autoCreateTables}"/>
> <sysproperty key="org.jpox.validateTables"
> value="${org.jpox.validateTables}"/>
> <sysproperty key="org.jpox.autoCreateConstraints"
> value="${org.jpox.autoCreateConstraints}"/>
> <sysproperty key="org.jpox.validateConstraints"
> value="${org.jpox.validateConstraints}"/>
> <sysproperty key="log4j.configuration"
> value="${test.log4j.configuration}"/>
> <batchtest fork="yes" todir="${test.general.results.dir}">
> <fileset dir="${test.classes.dir}"
> includes="${test.suite.general}"/>
> </batchtest>
> <test name="org.jpox.FinishScenarioTest"
> todir="${test.general.results.dir}"/>
> </junit>
> <junitreport todir="${test.general.results.dir}">
> <fileset dir="${test.general.results.dir}">
> <include name="TEST-*.xml"/>
> </fileset>
> <report format="frames"
> todir="${test.general.results.dir}/html"/>
> </junitreport>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.datastore
> ============================================================ =======
> -->
> <target name="test.datastore"
>
depends=" test.datastore.clean,compile,test.datastore.copy.properties, enhance
">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Datastore tests"/>
> <echo
>
message=" ============================================================ =======
"/>
> <mkdir dir="${test.datastore.results.dir}"/>
> <copy todir="${test.classes.dir}" failonerror="no">
> <fileset dir="." includes="${test.log4j.configuration}"/>
> </copy>
>
> <junit printsummary="yes" fork="yes" haltonfailure="no">
> <classpath>
> <path refid="test.jdbc.classpath"/>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> <formatter type="xml"/>
> <sysproperty key="org.jpox.autoCreateSchema"
> value="${org.jpox.autoCreateSchema}"/>
> <sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
> value="org.jpox.PersistenceManagerFactoryImpl"/>
> <sysproperty key="javax.jdo.option.ConnectionDriverName"
> value="${javax.jdo.option.ConnectionDriverName}"/>
> <sysproperty key="javax.jdo.option.ConnectionURL"
> value="${javax.jdo.option.ConnectionURL}"/>
> <sysproperty key="javax.jdo.option.ConnectionUserName"
> value="${javax.jdo.option.ConnectionUserName}"/>
> <sysproperty key="javax.jdo.option.ConnectionPassword"
> value="${javax.jdo.option.ConnectionPassword}"/>
> <sysproperty key="org.jpox.autoCreateTables"
> value="${org.jpox.autoCreateTables}"/>
> <sysproperty key="org.jpox.validateTables"
> value="${org.jpox.validateTables}"/>
> <sysproperty key="org.jpox.autoCreateConstraints"
> value="${org.jpox.autoCreateConstraints}"/>
> <sysproperty key="org.jpox.validateConstraints"
> value="${org.jpox.validateConstraints}"/>
> <sysproperty key="log4j.configuration"
> value="${test.log4j.configuration}"/>
> <batchtest fork="yes" todir="${test.datastore.results.dir}">
> <fileset dir="${test.classes.dir}"
> includes="${test.suite.datastore}"/>
> </batchtest>
> <test name="org.jpox.FinishScenarioTest"
> todir="${test.datastore.results.dir}"/>
> </junit>
> <junitreport todir="${test.datastore.results.dir}">
> <fileset dir="${test.datastore.results.dir}">
> <include name="TEST-*.xml"/>
> </fileset>
> <report format="frames"
> todir="${test.datastore.results.dir}/html"/>
> </junitreport>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.application
> ============================================================ =======
> -->
> <target name="test.application"
>
depends=" test.application.clean,compile,test.application.copy.propert ies,enh
ance">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Application tests"/>
> <echo
>
message=" ============================================================ =======
"/>
> <mkdir dir="${test.application.results.dir}"/>
> <copy todir="${test.classes.dir}" failonerror="no">
> <fileset dir="." includes="${test.log4j.configuration}"/>
> </copy>
>
> <junit printsummary="yes" fork="yes" haltonfailure="no">
> <classpath>
> <path refid="test.jdbc.classpath"/>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> <formatter type="xml"/>
> <sysproperty key="org.jpox.autoCreateSchema"
> value="${org.jpox.autoCreateSchema}"/>
> <sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
> value="org.jpox.PersistenceManagerFactoryImpl"/>
> <sysproperty key="javax.jdo.option.ConnectionDriverName"
> value="${javax.jdo.option.ConnectionDriverName}"/>
> <sysproperty key="javax.jdo.option.ConnectionURL"
> value="${javax.jdo.option.ConnectionURL}"/>
> <sysproperty key="javax.jdo.option.ConnectionUserName"
> value="${javax.jdo.option.ConnectionUserName}"/>
> <sysproperty key="javax.jdo.option.ConnectionPassword"
> value="${javax.jdo.option.ConnectionPassword}"/>
> <sysproperty key="org.jpox.autoCreateTables"
> value="${org.jpox.autoCreateTables}"/>
> <sysproperty key="org.jpox.validateTables"
> value="${org.jpox.validateTables}"/>
> <sysproperty key="org.jpox.autoCreateConstraints"
> value="${org.jpox.autoCreateConstraints}"/>
> <sysproperty key="org.jpox.validateConstraints"
> value="${org.jpox.validateConstraints}"/>
> <sysproperty key="log4j.configuration"
> value="${test.log4j.configuration}"/>
> <batchtest fork="yes" todir="${test.application.results.dir}">
> <fileset dir="${test.classes.dir}"
> includes="${test.suite.application}"/>
> </batchtest>
> <test name="org.jpox.FinishScenarioTest"
> todir="${test.application.results.dir}"/>
> </junit>
> <junitreport todir="${test.application.results.dir}">
> <fileset dir="${test.application.results.dir}">
> <include name="TEST-*.xml"/>
> </fileset>
> <report format="frames"
> todir="${test.application.results.dir}/html"/>
> </junitreport>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.schema
> ============================================================ =======
> -->
> <target name="test.schema"
> depends=" test.schema.clean,compile,test.schema.copy.properties,enhanc e ">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Custom schema tests"/>
> <echo
>
message=" ============================================================ =======
"/>
> <mkdir dir="${test.schema.results.dir}"/>
> <copy todir="${test.classes.dir}" failonerror="no">
> <fileset dir="." includes="${test.log4j.configuration}"/>
> </copy>
>
> <junit printsummary="yes" fork="yes" haltonfailure="no">
> <classpath>
> <path refid="test.jdbc.classpath"/>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> <formatter type="xml"/>
> <sysproperty key="org.jpox.autoCreateSchema"
> value="${org.jpox.autoCreateSchema}"/>
> <sysproperty key="javax.jdo.PersistenceManagerFactoryClass"
> value="org.jpox.PersistenceManagerFactoryImpl"/>
> <sysproperty key="javax.jdo.option.ConnectionDriverName"
> value="${javax.jdo.option.ConnectionDriverName}"/>
> <sysproperty key="javax.jdo.option.ConnectionURL"
> value="${javax.jdo.option.ConnectionURL}"/>
> <sysproperty key="javax.jdo.option.ConnectionUserName"
> value="${javax.jdo.option.ConnectionUserName}"/>
> <sysproperty key="javax.jdo.option.ConnectionPassword"
> value="${javax.jdo.option.ConnectionPassword}"/>
> <sysproperty key="org.jpox.autoCreateTables"
> value="${org.jpox.autoCreateTables}"/>
> <sysproperty key="org.jpox.validateTables"
> value="${org.jpox.validateTables}"/>
> <sysproperty key="org.jpox.autoCreateConstraints"
> value="${org.jpox.autoCreateConstraints}"/>
> <sysproperty key="org.jpox.validateConstraints"
> value="${org.jpox.validateConstraints}"/>
> <sysproperty key="log4j.configuration"
> value="${test.log4j.configuration}"/>
> <batchtest fork="yes" todir="${test.schema.results.dir}">
> <fileset dir="${test.classes.dir}"
> includes="${test.suite.schema}"/>
> </batchtest>
> <test name="org.jpox.FinishScenarioTest"
> todir="${test.schema.results.dir}"/>
> </junit>
> <junitreport todir="${test.schema.results.dir}">
> <fileset dir="${test.schema.results.dir}">
> <include name="TEST-*.xml"/>
> </fileset>
> <report format="frames"
> todir="${test.schema.results.dir}/html"/>
> </junitreport>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.Enhancer
> ============================================================ =======
> -->
> <target name="test.Enhancer"
>
depends=" compile.Enhancer,compile.Enhancer.test,test.Enhancer.copy.pr opertie
s">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Enhancer tests"/>
> <echo
>
message=" ============================================================ =======
"/>
> <mkdir dir="${Enhancer.test.results.dir}"/>
> <copy todir="${Enhancer.test.classes.dir}" failonerror="no">
> <fileset dir="."
> includes="${Enhancer.test.log4j.configuration}"/>
> </copy>
>
> <junit printsummary="yes" fork="yes" haltonfailure="no">
> <classpath>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${Enhancer.test.classes.dir}"/>
> </classpath>
> <formatter type="xml"/>
> <sysproperty key="log4j.configuration"
> value="${Enhancer.test.log4j.configuration}"/>
> <batchtest fork="yes" todir="${Enhancer.test.results.dir}">
> <fileset dir="${Enhancer.test.classes.dir}"
> includes="**/TestA**.class"/>
> </batchtest>
> </junit>
> <junitreport todir="${Enhancer.test.results.dir}">
> <fileset dir="${Enhancer.test.results.dir}">
> <include name="TEST-*.xml"/>
> </fileset>
> <report format="frames"
> todir="${Enhancer.test.results.dir}/html"/>
> </junitreport>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : compile
> ============================================================ =======
> -->
> <target name="compile"
>
depends=" copy-jars,prepare,compile.java,compile.test,compile.Enhancer ,copy.p
roperties"/>
>
> <!--
> ============================================================ =======
> TARGET : compile.java
> ============================================================ =======
> -->
> <target name="compile.java">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Your source configuration:"/>
> <echo message="src.java.dir = ${src.java.dir}"/>
> <echo message="classes.dir = ${classes.dir}"/>
> <echo
>
message=" ============================================================ =======
"/>
> <javac srcdir="${src.java.dir}" destdir="${classes.dir}"
> debug="${project.build.debug}" classpathref="project.classpath">
> <include name="org/jpox/**/*.java"/>
> </javac>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : compile.Enhancer
> ============================================================ =======
> -->
> <target name="compile.Enhancer" depends="prepare.Enhancer">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Your source configuration:"/>
> <echo message="Enhancer.src.java.dir =
> ${Enhancer.src.java.dir}"/>
> <echo message="classes.dir = ${classes.dir}"/>
> <echo
>
message=" ============================================================ =======
"/>
> <javac srcdir="${Enhancer.src.java.dir}" destdir="${classes.dir}"
> debug="${project.build.debug}" classpathref="project.classpath">
> <include name="org/jpox/**/*.java"/>
> </javac>
> <copy todir="${classes.dir}">
> <fileset dir="${Enhancer.src.java.dir}"
> includes="**/*.properties"/>
> </copy>
>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : compile.Enhancer.test
> ============================================================ =======
> -->
> <target name="compile.Enhancer.test">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Your test configuration:"/>
> <echo message="Enhancer.test.java.dir =
> ${Enhancer.test.java.dir}"/>
> <echo message="test.classes.dir = ${test.classes.dir}"/>
> <echo
>
message=" ============================================================ =======
"/>
> <javac srcdir="${Enhancer.test.java.dir}"
> destdir="${Enhancer.test.classes.dir}" debug="${project.build.debug}"
> classpathref="project.classpath">
> <include name="org/jpox/**/*.java"/>
> </javac>
> </target>
>
>
> <!--
> ============================================================ =======
> TARGET : compile.test
> ============================================================ =======
> -->
> <target name="compile.test">
> <echo
>
message=" ============================================================ =======
"/>
> <echo message="Your test configuration:"/>
> <echo message="test.java.dir = ${test.java.dir}"/>
> <echo message="test.classes.dir = ${test.classes.dir}"/>
> <echo
>
message=" ============================================================ =======
"/>
> <javac srcdir="${test.java.dir}" destdir="${test.classes.dir}"
> debug="${project.build.debug}" classpathref="project.classpath">
> <include name="org/jpox/**/*.java"/>
> </javac>
>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : enhance.Enhancer
> ============================================================ =======
> -->
> <target name="enhance.Enhancer" depends="compile,compile.Enhancer">
> <taskdef name="jpox-enhancer"
> classname="org.jpox.enhancer.tools.EnhancerTask">
> <classpath refid="project.classpath"/>
> </taskdef>
> <jpox-enhancer failonerror="false" fork="true"
> dir="${test.classes.dir}" verbose="true" destination="${test.classes.dir}"
> check="true">
> <classpath>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> </jpox-enhancer>
> <jpox-enhancer failonerror="false" fork="true"
> dir="${test.classes.dir}" checkonly="true">
> <classpath>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> </jpox-enhancer>
> </target>
>
>
> <!--
> ============================================================ =======
> TARGET : enhance.jdori
> ============================================================ =======
> -->
> <target name="enhance.jdori">
> <taskdef name="enhancer"
classname="org.jpox.enhance.EnhancerTask">
> <classpath refid="project.classpath"/>
> </taskdef>
> <enhancer destination="${test.classes.dir}"
> dir="${test.classes.dir}" verbose="false" checkonly="false">
> <classpath>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> <include name="**/*.jdo"/>
> </enhancer>
> <enhancer dir="${test.classes.dir}" verbose="false"
> checkonly="true">
> <classpath>
> <path refid="lib.classpath"/>
> <pathelement location="${classes.dir}"/>
> <pathelement location="${test.classes.dir}"/>
> </classpath>
> <include name="**/*.jdo"/>
> </enhancer>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : enhance
> ============================================================ =======
> -->
> <target name="enhance" depends="enhance.Enhancer"/>
>
>
> <!--
> ============================================================ =======
> TARGET : copy.properties
> ============================================================ =======
> -->
> <target name="copy.properties">
> <copy todir="${classes.dir}">
> <fileset dir="${src.java.dir}" includes="**/*.properties"/>
> </copy>
> </target>
>
>
> <!--
> ============================================================ =======
> TARGET : test.copy.properties
> ============================================================ =======
> -->
> <target name="test.copy.properties">
> <copy todir="${test.classes.dir}">
> <fileset dir="${test.java.dir}"
> includes="**/*.properties,**/*.lcf,**/*.jdo"/>
> </copy>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.general.copy.properties
> ============================================================ =======
> -->
> <target name="test.general.copy.properties"
> depends="test.copy.properties">
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.datastore.copy.properties
> ============================================================ =======
> -->
> <target name="test.datastore.copy.properties"
> depends="test.copy.properties">
> <copy todir="${test.classes.dir}">
> <fileset dir="${test.java.dir}"
> includes="**/*.properties,**/*.jdod"/>
> <mapper type="glob" from="*.jdod" to="*.jdo"/>
> </copy>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.application.copy.properties
> ============================================================ =======
> -->
> <target name="test.application.copy.properties"
> depends="test.copy.properties">
> <copy todir="${test.classes.dir}">
> <fileset dir="${test.java.dir}"
> includes="**/*.properties,**/*.jdoa"/>
> <mapper type="glob" from="*.jdoa" to="*.jdo"/>
> </copy>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.schema.copy.properties
> ============================================================ =======
> -->
> <target name="test.schema.copy.properties"
> depends="test.copy.properties">
> <copy todir="${test.classes.dir}">
> <fileset dir="${test.java.dir}"
> includes="**/*.properties,**/*.jdo"/>
> </copy>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : test.Enhancer.copy.properties
> ============================================================ =======
> -->
> <target name="test.Enhancer.copy.properties"
> depends="test.copy.properties">
> <copy todir="${Enhancer.test.classes.dir}">
> <fileset dir="${Enhancer.test.java.dir}"
> includes="**/*.properties,**/*.jdo"/>
> </copy>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : version
> ============================================================ =======
> -->
> <target name="version">
> <echo message="${Name} ${version}" file="VERSION.txt"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : srczip
> ============================================================ =======
> -->
> <target name="srczip" depends="version">
> <mkdir dir="${dist.dir}"/>
> <delete file="${dist.src.file}"/>
> <zip zipfile="${dist.src.file}" update="true">
> <zipfileset dir="." prefix="${dist.name}" includes="
> **/*.css,
> **/*.gif,
> **/*.html,
> **/*.java,
> build.xml,
> build.properties,
> checkstyle.xml,
> LICENSE.txt,
> maven.xml,
> project.xml,
> project.properties
> README.txt,
> VERSION.txt" excludes="${javadoc.dir}/**"/>
> </zip>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : release
> ============================================================ =======
> -->
> <target name="release" depends="binzip,bintargz"/>
>
> <!--
> ============================================================ =======
> TARGET : binzip
> ============================================================ =======
> -->
> <target name="binzip" depends="version,javadoc,srczip,rar">
> <mkdir dir="${dist.dir}"/>
> <delete file="${dist.bin.zip.file}"/>
> <zip zipfile="${dist.bin.zip.file}">
> <zipfileset dir="." prefix="${dist.name}" includes="
> ${doc.dir}/**/*,
> ${dist.src.file},
> ${jar.file},
> LICENSE.txt,
> README.txt,
> VERSION.txt" excludes="${doc.dir}/api/src-html/**/*"/>
> </zip>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : bintar
> ============================================================ =======
> -->
> <target name="bintar" depends="version,javadoc,srczip,rar">
> <mkdir dir="${dist.dir}"/>
> <delete file="${dist.bin.tar.file}"/>
> <tar destfile="${dist.bin.tar.file}">
> <tarfileset dir="." prefix="${dist.name}" includes="
> ${doc.dir}/**/*,
> ${dist.src.file},
> ${jar.file},
> LICENSE.html,
> README.txt,
> VERSION.txt" excludes="${doc.dir}/api/src-html/**/*"/>
> </tar>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : bintargz
> ============================================================ =======
> -->
> <target name="bintargz" depends="bintar">
> <gzip zipfile="${dist.bin.targz.file}" src="${dist.bin.tar.file}"/>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : rar
> ============================================================ =======
> -->
> <target name="rar" depends="version,jar">
> <mkdir dir="${dist.dir}"/>
> <delete file="${dist.rar.file}"/>
> <zip zipfile="${dist.rar.file}">
> <zipfileset dir="." prefix="" fullpath="${dist.name}.jar"
> includes="${jar.file}"/>
> <zipfileset dir="." prefix="" fullpath="jdo.jar"
> includes="${dependency.jdo.location}"/>
> <zipfileset dir="." prefix=""
> fullpath="${dependency.log4j.jar.name}"
> includes="${dependency.log4j.location}"/>
> <zipfileset dir="." prefix="" includes="LICENSE.html"/>
> <zipfileset dir="." prefix="" includes="README.txt"/>
> <zipfileset dir="." prefix="" includes="VERSION.txt"/>
> <zipfileset dir="${metainf.dir}" prefix="META-INF"
> includes="**/*"/>
> </zip>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : jar
> ============================================================ =======
> -->
> <target name="jar" depends="compile">
> <mkdir dir="${bin.dir}"/>
> <zip zipfile="${jar.file}" update="true">
> <zipfileset dir="${classes.dir}"
> includes="**/*.class,**/*.properties"/>
> <zipfileset dir="."
> includes="LICENSE.html,README.txt,VERSION.txt"/>
> </zip>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : javadoc
> ============================================================ =======
> -->
> <target name="javadoc">
> <mkdir dir="${javadoc.dir}"/>
> <delete quiet="true" file="${javadoc.dir}/index.html"/>
> <javadoc sourcepath="${src.java.dir}"
> classpathref="project.classpath" destdir="${javadoc.dir}"
> packagenames="org.jpox.*,javax.*" overview="${src.java.dir}/overview.html"
> footer="<a
> href="http://sourceforge.net/projects/jpox"><img
>
src="http://sourceforge.net/sflogo.php?group_id=35302&type=1"
> width="88" height="31" border="0"
> alt="SourceForge.net_Logo">< /a> " author="true"
> source="1.3">
> <link href="http://java.sun.com/j2se/1.3/docs/api/"/>
> </javadoc>
> </target>
>
> <!--
> ============================================================ =======
> TARGET : copy-jars
> ============================================================ =======
> -->
> <target name="copy-jars" description="Copy .jar files into lib, so
> that the same files are available to build as in the runtime
environment.">
> <jarlib-resolve property="${dependency.ant.library}"
> failOnError="false" checkExtension="false">
> <
|
|
| |
Re: Ant can't find directory [message #173184 is a reply to message #172776] |
Thu, 12 August 2004 21:19  |
Eclipse User |
|
|
|
Originally posted by: mpjburke.verizon.net
Darin Swanson wrote:
> >
> > java -Xdebug -Xnoagent
> > -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend= y
> > -Dant.home=${ANT_HOME} org.apache.tools.ant.Main -verbose -propertyfile
> > /home/mburke/m7/workspace/JPOX/build.properties test
> >
> > after hardcoding the offending ${} I'm getting the 'can't find javac
> > compiler'
> > Thanks for the help.
> >
> >
> I looked at your buildfile and the property files and did not see anything
> obvious.
> Not being able to find a compiler for javac is most easily solved by
> ensuring that a tools.jar is on the classpath.
> I would recommend trying something slightly different if you wish to remote
> debug Ant starting from the commandline (of course I still recommend doing
> it from within Eclipse :-) )
> Take a look at the ant.bat file in the bin directory of your Ant install.
> I slightly modify this file and save it as something like debugant.bat.
> The modifications are to add the VM args for remote debugging. This ensures
> that the Java and Ant classpaths are setup correctly and in the same manner
> as when you run Ant normally from the commandline..
> I will attach the bat file I use for 1.6.1
> HTH
> Darins
Thanks Darins, adding tools.jar to the classpath got rid of the javac
error. Still running into those variable errors but that I can workaround.
|
|
|
Goto Forum:
Current Time: Fri Sep 26 04:14:01 EDT 2025
Powered by FUDForum. Page generated in 0.05065 seconds
|