ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Blaschke <deb...@us.ibm.com>
Subject Re: useexternalfile change between 1.6.5 and 1.7.0?
Date Thu, 21 Feb 2008 17:58:19 GMT

Hi, more info below ... comments?  Thanks!

Peter Reilly wrote:
> Can you try to get a tar/zip file containing a project
> where this occurs.
>   
Simple to reproduce, just set useexternalfile=true and spread the 
doctitle or bottom tags across multiple lines:

            <doctitle>
            <![CDATA[<h1>My Project - ${Manifest.version}</h1>]]>
            </doctitle>
> There has been some changes to the javadoc task in 1.7.0 (fixing
> a number of bugs), but some issues may have been created.
>   
With Ant 1.6.5 the doctitle/bottom were passed on command line:

  [javadoc] Executing 'C:\progra~1\ibm\sdk-142\bin\javadoc.exe' with 
arguments:
  : :
  [javadoc] '-doctitle'
  [javadoc] '
  [javadoc]                  <h1>My Project - 2.0</h1>
  [javadoc]             '

while with Ant 1.7.0 they are passed in temp file (I changed code to NOT 
delete temp file and examined contents):

-doctitle '
                 <h1>My Project - 2.0</h1>
            '

so newlines within doctitle/bottom on command line are handled, but not 
so for temp file.  A simple patch to change newlines within quoted 
strings to literals:

--- Javadoc.java        Fri Jan 04 17:33:48 2008
+++ Javadoc.java.new    Thu Feb 21 11:38:43 2008
@@ -2224,6 +2224,9 @@ public class Javadoc extends Task {
         }
         buf.append(str);
         buf.append(delim);
+        if ((delim == '\'' || delim == '"') && str.indexOf('\n') != -1) {
+          return buf.toString().replaceAll("[\n]", "\\\\n");
+        }
         return buf.toString();
     }

seems to work and produces the same output in the html files.  With this 
patch, the multiple lines from above become a single line in the temp file:

-doctitle '\n                 <h1>My Project - 2.0</h1>\n            '

Not saying this is the best patch, but it gets things going in the right 
direction.
> Also, if possible, can you try a nightly build of ant, there has
> been some fixes in the javadoc task since ant 1.7.0.
>   
Got the latest (ant_20080221113427.tar.gz):

    Apache Ant version 1.8.0alpha compiled on February 21 2008

and the bug still occurs.
> Peter
>
> On Feb 5, 2008 2:36 AM, Dave Blaschke <debltc@us.ibm.com> wrote:
>   
>> Greetings -
>>
>> I am using Eclipse for a Java development project and Ant to build it.
>> The javadoc command for the project is rather lengthy so useexternalfile
>> is used.With Eclipse 3.2.2 and Ant 1.6.5 javadoc runs successfully, but
>> with Eclipse 3.3.1.1 and Ant 1.7.0 javadoc fails with the following error:
>>
>>   [javadoc] Generating Javadoc
>>   [javadoc] Javadoc execution
>>   [javadoc] javadoc: invalid flag: -
>>   [javadoc] usage: javadoc [options] [packagenames] [sourcefiles]
>> [classnames] [@files]
>>     :  :
>>
>> which indicates some corruption in the contents of the file.  Did
>> something change with the use of this option between 1.6.5 and 1.7.0?
>> Looked through bugs and mailing lists but didn't see anything similar.
>>
>> I am running on WinXP with IBM SDK 1.4.2.  Just for kicks I brought the
>> 1.6.5 plugin code over to Eclipse 3.3.1.1 and javadoc worked fine then too.
>>
>> Thanks in advance
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>   



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


Mime
View raw message