ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suu_q...@non.agilent.com
Subject RE: <javac> not creating package subdirectories
Date Thu, 09 Jan 2003 16:26:18 GMT

Million thanks to Matt and Antoine Levy-Lambert for your answers

Suu

> -----Original Message-----
> From: Matt Moran [mailto:matt@mattnliz.net]
> Sent: Wednesday, January 08, 2003 8:01 PM
> To: Ant Users List
> Subject: Re: <javac> not creating package subdirectories
> 
> 
> I'm not an expert, but it's unclear to me why you expect this 
> to work.  If
> you execute javac from the command line, does it create the 
> directories for
> you?  (When I try something similar, it doesn't happen that 
> way.  The .class
> file is put in the same directory as the .java file.)

	Good Reason: been away from Java development since 1999. 
	Long term memory gone.

> Also, from http://jakarta.apache.org/ant/manual/CoreTasks/javac.html
> "When the source files are part of a package, the directory 
> structure of the
> source tree should follow the package hierarchy."

Antoine>Yes, in good Java practice, your source file should be
Antoine>${src}/api/enCommerce/getAccess/API/User/MyFile.java

	Thanks, I vaguely remember reading that somewhere. That's why I tried it.

> ----- Original Message -----
> From: <suu_quan@non.agilent.com>
> To: <ant-user@jakarta.apache.org>
> Sent: Wednesday, January 08, 2003 6:36 PM
> Subject: <javac> not creating package subdirectories
> 
> 
> > the following task (only 1 java file)
> >
> > <javac srcdir="${src}/api" optimize="on" classpathref="classpath"/>
> >
> > creates a .class file in the ${src}/api directory, even 
> though the java
> file has this statement
> >
> > package enCommerce.getAccess.API.User;
> >
> > I expect it to create the directories 
> enCommerce/getAccess/API/User and
> put the class file there.
> >
> > That screws up my following task
> >     <jar destfile="${distr}/getextapi.jar"  filesonly="true">
> >         <fileset dir="${src}/api">
> >                 <include name="**/*.class"/>
> >         </fileset>
> >     </jar>
> >
> > what did I not do right?
> > Should I organize the source directory structure according 
> to the package
> structure?
> >
> > I move the java file to 
> ${src}/api/enCommerce/getAccess/API/User/*.java
> > and I got the desired result.

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message