Hi Gents,

FROM OUR DOCS....

A good build environment needs to be easily portable from machine to
machine. Developers are picky about laying out directories their own way.
This configure task was inspired by the linux configure command. Where,
before doing a source tree build we need to inspect a users evironment for
the third-party libs needed to complete a build. Externalizing the transient
pieces of your build enviroment help mitigate diverse user environments.
This task will bootstrap your development environment by creating
aproperties file that contains transient items such as compiler settings and
classpaths. This task uses the inherient search capabilites of patterns and
filesets. See ANT docs for description(s) of patternset and fileset.


Attached files:
**************************************************

org.apache.tools.ant.taskdefs.optional.ConfigurTask.java
org.apache.tools.ant.taskdefs.optional.PathProperty.java

configure.xml (example)
configure.html (Docs)
**************************************************

Cheers,
Martin Gee

Attachment: ConfigureTask.java
Description: Binary data

Attachment: PathProperty.java
Description: Binary data

<project name="configure" default="configure" basedir=".">

<!-- ======================================================= -->
<!-- This task creates and configures build.properties  	    -->
<!-- ======================================================= -->
<target name="configure">

	<configure target="${basedir}/build.properties" prompt="on">
		<property name="build.compiler" value="jikes"/>
		<property name="debug" value="on"/>
		<property name="optimize" value="on"/>
		<property name="deprecation" value="on"/>

		<pathproperty name="root" value="${basedir}"/>
		<pathproperty name="src" value="${basedir}"/>
		<pathproperty name="docs" value="${basedir}/docs"/>
		<pathproperty name="classes" value="${basedir}/classes"/>
		<pathproperty name="build" value="${basedir}/build"/>

		<pathproperty name="classpath">
			<path>
				<pathelement location="${basedir}" />

				<fileset dir="${SDKS_HOME}">
					<include name="**/j2ee.jar"/>
					<include name="XML*/xerces.jar"/>
					<include name="XML*/xml4j.jar"/>
					<include name="**/rt.jar"/>
				</fileset>

			</path>
		</pathproperty>

	</configure>
</target>
</project>
Title: configure

configure

Description

A good build environment needs to be easily portable from machine to machine. Developers
are picky about laying out directories their own way. This configure task was inspired by the
linux configure command. Where, before doing a source tree build weneed to inspect a
users evironment for the third-party libs needed to complete a build. Externalizing the transient pieces
of your build enviroment help mitigate diverse user environments. 

This task will bootstrap your development environment by creating aproperties
file that contains transient items such as compiler settings and classpaths. This
task uses the inherient search capabilites of patterns and filesets.See ANT docs for
description(s) of patternset and fileset.

Parameters

 

Attribute

Description

Required

target

The properties file you wish to create.

yes

prompt

Goes interative if pathproperties aren't found.

yes

Elements

 

Element

Description

Required

property

Creates a name value pair in the target.

No

pathproperty

Creates an entry in the properties file that is path savy.

No

echo

echos comments to the properties file.

No

Example

Typically you will create a configure.xml script that will create the target properties file.
Then your build.xml scripts will reference the target properties fileforit's transient
properties.

  <configure target="${basedir}/build.properties" />
      <property name="build.compiler" value="jikes" />
      <property name="debug" value="on">
      <pathproperty name="root" value="${basedir}" />
      <pathproperty name="classpath" />
        <path>
          <pathelememt location="${basedir}" />
          <fileset dir="${TOOLS_HOME}" />
            <include name="**/j2ee.jar" />
            <include name="**/rt.jar" />
          <fileset />
        </path>
      <pathproperty/> 
  </configure>

 

Reply via email to