Hi Peter,
You need to have the appropriate package structure in place for your classes. e.g. If there is a class BeanA in the folder ${src}/beans/formbeans then you package BeanA.java appropriately (say have "package /usr/home/peter/beans/formbeans;" as the first line). Thereafter compilation in ant will recreate the directory structure as required on its own. There is actually no need to for you to create the directory structure under ${classes}.
Regards
_____________________________________
Kapil Singh Pawar
Consultant - Integration
i2 Technologies India Private Ltd.
1 Primrose Road
Bangalore 560 025, INDIA
Email: [EMAIL PROTECTED]
Tel: +91 80 558 1487-90 ext. 2416
| "peter" <[EMAIL PROTECTED]>
09/18/01 02:23 PM
|
To: <[EMAIL PROTECTED]> cc: Subject: mirroring src directory |
Hi
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>
<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/**"/>
<classpath>
<pathelement location="struts.jar"/>
<pathelement location="commons-beanutils.jar"/>
<pathelement location="commons-collections.jar"/>
<pathelement location="commons-digester.jar"/>
<pathelement location="${src}"/>
</classpath>
</javac>
</target>
</project>
Thanks
Peter
