ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel H A Lima <l...@cit.com.br>
Subject Re: Newbie question - second try - re srcdir and destdir (edg)
Date Tue, 05 Aug 2003 22:22:26 GMT
    I have some suggestions (i hope at least one can help you)...

  ** Have you tried use -verbose option to see what javac task is doing ?

    You must got something like :
    [javac] foo/loo/moo/test.java added as 
/my_dir/my_app_dir/WEB-INF/classes/src/foo/loo/moo/test.class doesn't exist.

    If you got "src/foo/loo/moo/test.java", something is wrong :-)

    ** Your directory structure seems like the below ?

    -- my_app_dir
        |
        |__ build.xml
        |
        |__ src
        |
        |__ WEB-INF
               |
               |__ classes


    ** Are you invoking ant inside "my_app_dir" ? Like :

    [user@localhost] cd my_app_dir
    [user@localhost] ant compile

    ** Has your build.xml a target like :

    <target name="compile" depends="...">
        <javac srcdir="src" destdir="WEB-INF/classes" 
classpath="WEB-INF/classes:.."...

    ** You can use <echo message="My basedir=${basedir}"/> to discover 
your base directory

Ed Greenberg wrote:

>
>
> --On Tuesday, August 05, 2003 5:11 PM -0400 "Ciramella, EJ" 
> <ECiramella@emptoris.com> wrote:
>
>> Not the solution, but you don't need the "./".
>>
>> I think when you say /WEB-INF/classes, ant thinks the dirs are different
>> enough to warrant adding in src.  Try destdir="classes" and 
>> srcdir="src",
>> see what happens...
>>
>
> No luck with the above suggestion. It tries to create it under classes 
> at the same level as src. So the compilation doesn't go in WEB-INF 
> where it belongs.
>
>> -----Original Message-----
>> From: Ed Greenberg [mailto:edg@greenberg.org]
>> Sent: Tuesday, August 05, 2003 5:07 PM
>> To: user@ant.apache.org
>> Subject: Newbie question - second try - re srcdir and destdir (edg)
>>
>>
>>
>>
>> Here's my second try in which I remembered to paste in the line that
>> actually describes the problem :) I appreciate any help I can get.
>>
>>
>> I'm trying to understand my first ant scripts.
>>
>> I have
>> <project basedir="." default="all" name="myapp">
>>     ...
>>     <target depends="init" name="compile">
>>          <javac debug="true" deprecation="true"
>> destdir="./WEB-INF/classes" srcdir="./src"/>     </target>
>>     ...
>> </project>
>>
>> My build.xml sits in the same directory as src/ and WEB-INF/.
>>
>> I have one source file located in
>>     ./src/foo/loo/moo/test.java
>> When I execute this script, I get a directory tree created as
>>     ./WEB-INF/classes/src/foo/loo/moo/test.class
>>     
>>
>> I would have expected the compiler to create
>>     ./WEB-INF/classes/foo/loo/moo/test.class
>> given the statement in the ant manual that:
>>
>>   <javac srcdir="${src}"
>>          destdir="${build}"
>>          classpath="xyz.jar"
>>          debug="on"
>>   />
>> compiles all .java files under the ${src} directory,
>>                          ^^^^^
>> and stores the .class files in the ${build} directory.
>>
>> Can somebody tell me what I'm doing wrong?
>>
>> Thanks,
>> </edg>
>>
>> ---------- End Forwarded Message ----------
>>
>>
>>
>>



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


Mime
View raw message