ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "peter" <>
Subject mirroring src directory
Date Tue, 18 Sep 2001 08:53:53 GMT

I'm trying a write a simple ant buildfile that complies my java classes from
a src dir into a classes dir.  I've already created the src directory and
its sub dirs, and have created the classes dir which exactly mirrors the dir
structure of src.

src---                                  classes---
        |                                                |
        -controller                                 -controller
        -beans---                                  -beans---
                      |                                                |
                      -formbeans                                -formbeans
                      -statebeans                                -statebeans
                      -sessionbeans                            -sessionbeans

The problem is that when i run ant on my build.xml file the src files are
only compiled to the classes directory and not to any sub dirs under the
classes dir, thus not mirroring the true dir structure of the src dir.  Here
is my build file:

<project name="simple" default="build" basedir=".">

  <target name="init">
    <property name="src" value="src" />
    <property name="dest" value="classes" />

  <target name="build" depends="init">
    <javac  srcdir="${src}" destdir="${dest}">
      <include name="controller/**"/>
      <include name="beans/statebeans/**"/>
      <include name="beans/sessionbeans/**"/>
      <include name="beans/formbeans/**"/>
        <pathelement location="struts.jar"/>
        <pathelement location="commons-beanutils.jar"/>
        <pathelement location="commons-collections.jar"/>
        <pathelement location="commons-digester.jar"/>
        <pathelement location="${src}"/>




View raw message