----- Original Message -----
From: "Christophe Beljouani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 10:11 AM
Subject: Re: ant.properties


> Hi,
>
> I'm new to ant. and wonder if the build.xfm file can be generated
automatically
> from source code. The source code I'm working on has a directory structure
that
> matches the package names, a tool could analyze this code, determine which
> classes use which classes and generate a build.xfm file, is such a tool
> available somewhere or in development ?

There is a GUI in *early* Development which should do something like this
someday. (It's called antidode and available thru ant CVS).

Regarding dependencied: Ant does not use dependencies by default (there is
an optional task which could do this, but I have never used it).

To get started you could use a simple build.xml and modifiy it to meet your
needs. As an example I have attached the build.xml from IBM's BSF which is a
simple one and does just compile there source-tree and creates a jar-file.

If you have more questions or suggestions what should be included in the ant
distribution to get new users started feel free to post them to the list
again.

Hope this helps.

Nico

<project name="BSF" default="main" basedir=".">

  <target name="main">

    <property name="src.dir" value="src"/>
    <property name="lib.dir" value="lib"/>
    <property name="build.dir" value="../build/bsf"/>

    <!-- ================================================================= -->
    <!-- Determine what optional components are available                  -->
    <!-- ================================================================= -->

    <available property="jacl.present" 
               classname="tcl.lang.JACL"/>

    <available property="jpython.present" 
               classname="org.python.util.PythonInterpreter"/>

    <available property="netrexx.present" 
               classname="netrexx.lang.Rexx"/>

    <available property="rhino.present" 
               classname="org.mozilla.javascript.Scriptable"/>

    <available property="tcl.present" 
               classname="tcl.lang.Command"/>

    <!-- ================================================================= -->
    <!-- Compile bsf                                                       -->
    <!-- ================================================================= -->

    <mkdir dir="${build.dir}" />

    <copydir src="${src.dir}" dest="${build.dir}">
      <include name="**/*.properties" />
    </copydir>

    <javac srcdir="${src.dir}" destdir="${build.dir}">
      <include name="**/*.java" />

      <!-- optionally include engines based on dependencies being present -->
      <exclude name="**/jacl/**" unless="jacl.present" />
      <exclude name="**/javascript/**" unless="rhino.present" />
      <exclude name="**/jpython/**" unless="jpython.present" />
      <exclude name="**/netrexx/**" unless="netrexx.present" />
      <exclude name="**/tcl/**" unless="tcl.present" />
      <exclude name="**/xslt/**" unless="xalan.present" />

    </javac>

    <!-- ================================================================= -->
    <!-- Produce a jar file                                                -->
    <!-- ================================================================= -->

    <mkdir dir="${lib.dir}" />
    <jar jarfile="${lib.dir}/bsf.jar" basedir="${build.dir}" />

  </target>

  <target name="clean">
    <deltree dir="${build.dir}"/>
    <delete file="${lib.dir}/bsf.jar"/>
  </target>

</project>

Reply via email to