ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@mad.scientist.com>
Subject Re: cvs commit:jakarta-ant/src/main/org/apache/tools/ant/taskdefs Javadoc.java
Date Sun, 16 Jul 2000 03:11:17 GMT
At 09:47  15/7/00 -0500, you wrote:
>Yea, I thought about that 10 seconds after I hit
>'send', so I changed the source path to "com",
>which was closer, but still not right.
>
>After your message, I changed it to "./" and
>it STILL didn't work, but it found a WHOLE
>lot more files it could not evaluate the
>package for, and then it croaked...again,
>because there were no packagenames passed
>to javadoc. Something tells me I could just
>fork a JVM with the right commands and
>it would work (since it's working in a Makefile...)
>but Ant is doing some pre-processing, and either
>I'm not invoking it right, or it's losing track of what
>it's doing as it pre-processes....

I think the trouble lies at Javadoc.getPackageName() in lines
                if (line.trim().startsWith("package ") ||
                    line.trim().startsWith("package\t")) {
                    name = line.substring(8, line.indexOf(";")).trim();
                    break;
                }

Could it be that your package lines don't  start with either of these
patterns ?

Try changing it to something like 

final String cleanLine = line.trim();
if ( cleanLine.startsWith("package") {
   int start = 8;
   while( Character.isWhitespace( cleanLine.charAt(start) ) ) start++;
   final int end = line.indexOf(";");
   if( -1 == end ) {
	throw new Exception( "Task does not deal with multi-line package
declarations");
   }
   name = line.substring(start, end).trim();
   break;
}


I haven't got a compiler handy but that *should* do the trick. Have a shot
and if it works send patch to list :P


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Mime
View raw message