You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Brown, Carlton" <Ca...@BellSouth.com> on 2005/11/22 02:44:20 UTC

Question on how to to debug mapper issues

As I'm learning Ant, one thing I miss bitterly is the ability to print,
echo, or otherwise inspect every piece of data in order to see where
things are going wrong.  I'm having some trouble with a mapper
statement, and if anybody could tell me how to observe what's getting
matched by the asterisk, that would be great.

 

For example, if I had a fragment like:

 

                        <uptodate property="is.uptodate">

                                    <srcfiles dir="src"
includes="*.java"/> 

                                    <mapper type="glob" from="*.java"
to="build/classes/*.class"/>

                        </uptodate>

 

Some variations of the above task don't work, and I'd be so happy if I
could see what my "to" and "from" attributes are evaluating to.  It
would be great if there were some way to echo out the asterisk value,
unfortunately I haven't come across a way to do that.   If anybody has
an answer, I'd be much appreciative.

 

Somebody is bound to point out that the above task works as written,
which is true.   So I'll mention that what I'm trying to do is compare
subdirectories of the src structure rather than the entire thing.  By
varying the dir attribute of the srcfiles task in parallel with the "to"
attribute of the mapper task, I can get as far as 3 subdirectories deep.
But if I try to drill farther than the parent of the directory
containing the actual *.class files, the property doesn't get set.   So
I'm trying to figure out why this is happening. 

 

-Carlton


Re: Question on how to to debug mapper issues

Posted by Doug <dk...@telusplanet.net>.
<echo message="soup"/>

I think. well give a try & pray.

On November 21, 2005 06:44 pm, Brown, Carlton wrote:
> As I'm learning Ant, one thing I miss bitterly is the ability to print,
> echo, or otherwise inspect every piece of data in order to see where
> things are going wrong.  I'm having some trouble with a mapper
> statement, and if anybody could tell me how to observe what's getting
> matched by the asterisk, that would be great.
>
>
>
> For example, if I had a fragment like:
>
>
>
>                         <uptodate property="is.uptodate">
>
>                                     <srcfiles dir="src"
> includes="*.java"/>
>
>                                     <mapper type="glob" from="*.java"
> to="build/classes/*.class"/>
>
>                         </uptodate>
>
>
>
> Some variations of the above task don't work, and I'd be so happy if I
> could see what my "to" and "from" attributes are evaluating to.  It
> would be great if there were some way to echo out the asterisk value,
> unfortunately I haven't come across a way to do that.   If anybody has
> an answer, I'd be much appreciative.
>
>
>
> Somebody is bound to point out that the above task works as written,
> which is true.   So I'll mention that what I'm trying to do is compare
> subdirectories of the src structure rather than the entire thing.  By
> varying the dir attribute of the srcfiles task in parallel with the "to"
> attribute of the mapper task, I can get as far as 3 subdirectories deep.
> But if I try to drill farther than the parent of the directory
> containing the actual *.class files, the property doesn't get set.   So
> I'm trying to figure out why this is happening.
>
>
>
> -Carlton

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


RE: Question on how to to debug mapper issues

Posted by Bill Rich <bi...@wilandra.com>.
Have you tried the verbose (-v) or debug (-d) command line options? Be
warned, they put a lot of stuff on the console. When I use them I redirect
the console to a file then browse it with an editor.

HTH  Bill 

-----Original Message-----
From: Brown, Carlton [mailto:Carlton.Brown@BellSouth.com] 
Sent: Monday, November 21, 2005 5:44 PM
To: user@ant.apache.org
Subject: Question on how to to debug mapper issues

As I'm learning Ant, one thing I miss bitterly is the ability to print,
echo, or otherwise inspect every piece of data in order to see where things
are going wrong.  I'm having some trouble with a mapper statement, and if
anybody could tell me how to observe what's getting matched by the asterisk,
that would be great.

 

For example, if I had a fragment like:

 

                        <uptodate property="is.uptodate">

                                    <srcfiles dir="src"
includes="*.java"/> 

                                    <mapper type="glob" from="*.java"
to="build/classes/*.class"/>

                        </uptodate>

 

Some variations of the above task don't work, and I'd be so happy if I could
see what my "to" and "from" attributes are evaluating to.  It would be great
if there were some way to echo out the asterisk value,
unfortunately I haven't come across a way to do that.   If anybody has
an answer, I'd be much appreciative.

 

Somebody is bound to point out that the above task works as written,
which is true.   So I'll mention that what I'm trying to do is compare
subdirectories of the src structure rather than the entire thing.  By
varying the dir attribute of the srcfiles task in parallel with the "to"
attribute of the mapper task, I can get as far as 3 subdirectories deep.
But if I try to drill farther than the parent of the directory
containing the actual *.class files, the property doesn't get set.   So
I'm trying to figure out why this is happening. 

 

-Carlton




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


Re: Question on how to to debug mapper issues

Posted by Ivan Ivanov <ra...@yahoo.com>.
Hello,

in most cases I have found that running ant in verbose
or in debug mode by supplying -v or -d options
corresoindingly helps find what is going wrong.

In your case, I can make only the following random
guesses:
1) Are your java sources located in src/ directly? If
you have some packages than you have to declare
<srcfiles> in the following way:
<srcfiles dir="src" includes="**/*.java"/>
2) I found that using relative locations in "to"
attribute of <mapper> to be tricky. I would rewrite it
a little bit:

<property name="project.classes"
location="build/classes"/>
<uptodate property="is.uptodate">
  <srcfile dir="src" includes="**/*.java"/> 
  <mapper type="glob" from="*.java" 
     to="${project.classes}/*.class"/>
</uptodate>

Regards
Ivan

--- "Brown, Carlton" <Ca...@BellSouth.com>
wrote:

> As I'm learning Ant, one thing I miss bitterly is
> the ability to print,
> echo, or otherwise inspect every piece of data in
> order to see where
> things are going wrong.  I'm having some trouble
> with a mapper
> statement, and if anybody could tell me how to
> observe what's getting
> matched by the asterisk, that would be great.
> 
>  
> 
> For example, if I had a fragment like:
> 
>  
> 
>                         <uptodate
> property="is.uptodate">
> 
>                                     <srcfiles
> dir="src"
> includes="*.java"/> 
> 
>                                     <mapper
> type="glob" from="*.java"
> to="build/classes/*.class"/>
> 
>                         </uptodate>
> 
>  
> 
> Some variations of the above task don't work, and
> I'd be so happy if I
> could see what my "to" and "from" attributes are
> evaluating to.  It
> would be great if there were some way to echo out
> the asterisk value,
> unfortunately I haven't come across a way to do
> that.   If anybody has
> an answer, I'd be much appreciative.
> 
>  
> 
> Somebody is bound to point out that the above task
> works as written,
> which is true.   So I'll mention that what I'm
> trying to do is compare
> subdirectories of the src structure rather than the
> entire thing.  By
> varying the dir attribute of the srcfiles task in
> parallel with the "to"
> attribute of the mapper task, I can get as far as 3
> subdirectories deep.
> But if I try to drill farther than the parent of the
> directory
> containing the actual *.class files, the property
> doesn't get set.   So
> I'm trying to figure out why this is happening. 
> 
>  
> 
> -Carlton
> 
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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