ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ylan Segal" <>
Subject RE: Checking if properties is set
Date Thu, 20 Sep 2001 16:07:00 GMT
Well Diane, it worked like a charm. Thank you very much. I have written the
target as you suggested and if not all properties are set, then the build
fails with a message saying what properties are needed. This exactly what I

Below is the actual xml portion if anyone is interested:

<target name="check" description="Checks weather project is ready for
	<echo message="Build started: ${DSTAMP}"/>
	<property name="check.src.home" value="$${src.home}"/>
	<property name="" value="$${}"/>
	<property name="check.dist.home" value="$${dist.home}"/>
	<property name="check.javadoc.home" value="$${javadoc.home"/>
	<property name="check.doccheck.home" value="$${doccheck.home}"/>
	<property name="check.packages" value="$${packages}"/>
	<property name="check.lib.home" value="$${lib.home}"/>
	<property name="check.extlibs.home" value="$${extlibs.home}"/>
	<condition property="">
			<equals arg1="${check.src.home}" arg2="${src.home}"/>
			<equals arg1="${}" arg2="${}"/>
			<equals arg1="${check.dist.home}" arg2="${dist.home}"/>
			<equals arg1="${check.javadoc.home}" arg2="${javadoc.home}"/>
			<equals arg1="${check.doccheck.home}" arg2="${docheck.home}"/>
			<equals arg1="${check.packages}" arg2="${packages}"/>
			<equals arg1="${check.lib.home}" arg2="${lib.home}"/>
			<equals arg1="${check.extlibs.home}" arg2="${extlibs.home}"/>

	<antcall target="help"/>

<target name="help" if="">
	Not all needed properties are set!!!
	This build file needs a build.properies file to set the following
		src.home - The source code (.java files) home. - Where the classes are compiled to.
		dist.home - The directory where distribution files are created.
		javadoc.home - The directory for the javadoc html.
		doccheck.home - The directory for the DocCheck html
		packages - the packages to compile, it accepts * (ie tv.*)
		lib.home - Directory where needed jar's are stored.
		extlibs.hom - Directory where needed jar's are copied from.

	Other properties can also be set in this file (like build.compiler, etc).
	<fail message="Not all needed properties are set!!!"/>

I made my other targets like prepare and clean depend on check, and it
appears to be working great.

Ylan Segal.

View raw message