Bug 30606 - [PATCH] Ability to specify actual executable for <javadoc>
Summary: [PATCH] Ability to specify actual executable for <javadoc>
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.2
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.6.3
Assignee: Ant Notifications List
URL:
Keywords:
: 22244 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-11 22:37 UTC by Jesse Glick
Modified: 2005-03-30 10:00 UTC (History)
2 users (show)



Attachments
Suggested patch (2.55 KB, patch)
2004-08-11 22:40 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-08-11 22:37:39 UTC
Currently it seems there is no way to specify the exact executable used to
implement <javadoc>. This can be a major problem if you want to run Ant on one
JDK (e.g. 1.4.2) while generating Javadoc for a project using another JDK (e.g.
1.5.0 beta). For example, there is no way to make 1.4.2's javadoc tool handle
1.5 generic sources. (-bootclasspath is no help: this does not change where the
classes for the tool itself are loaded from.) Without this patch, it is thus
impossible to make <javadoc> generate Javadoc for 1.5 generic sources when
running Ant itself on a 1.4 or earlier VM. You need to use <exec> or <apply> or
similar, which of course loses all the readability and error-checking of the
normal task.

Provides some parity with the 'executable' attribute of <javac>.

Patch was lightly tested on Linux using 1.4.2 vs. 1.5.0 b62; seems to work as
desired.

Note that whatever bits of logic disable certain flags that are not supported by
the "current" Javadoc version, will not be accurate if using an explicit
executable. I think in practice this would not be a problem; the user would need
to not attempt to set optional attributes (or nested elements) on <javadoc> that
might not work in the target Javadoc version.

Impact on NetBeans IDE 4.0:

http://www.netbeans.org/issues/show_bug.cgi?id=46901
Comment 1 Jesse Glick 2004-08-11 22:40:51 UTC
Created attachment 12397 [details]
Suggested patch
Comment 2 Stefan Bodewig 2005-03-16 16:55:43 UTC
*** Bug 22244 has been marked as a duplicate of this bug. ***
Comment 3 Jesse Glick 2005-03-29 16:57:37 UTC
Working on a patch for this for 1.7. Any opinions on whether this would be
appropriate to merge to 1.6.3 or not? Patch effects:

- adds 'executable' attribute, default is still Ant's JDK's javadoc

- cleans up code by dropping JDK 1.1 support completely (except for old="true")
- since we dropped JDK 1.1 support for Ant 1.6, this was a no-op anyway

- disables JDK version checks in case 'executable' is specified, i.e. old="true"
will pass -1.1 unconditionally, and 1.4-specific parameters will be passed
unconditionally if specified
Comment 4 Jesse Glick 2005-03-29 20:24:04 UTC
Checking in WHATSNEW;
/home/cvs/ant/WHATSNEW,v  <--  WHATSNEW
new revision: 1.797; previous revision: 1.796
done
More commits to come...
Checking in docs/manual/CoreTasks/javadoc.html;
/home/cvs/ant/docs/manual/CoreTasks/javadoc.html,v  <--  javadoc.html
new revision: 1.33; previous revision: 1.32
done
More commits to come...
Checking in src/main/org/apache/tools/ant/taskdefs/Javadoc.java;
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v  <-- 
Javadoc.java
new revision: 1.140; previous revision: 1.139
done
Comment 5 Stefan Bodewig 2005-03-30 15:02:39 UTC
+1 on merging - if possible before Antoine cuts the RC.
Comment 6 Jesse Glick 2005-03-30 19:00:37 UTC
OK, will merge then. Strictly speaking it's an RFE, yet when you need it and
don't have it, the alternative - using <apply> - is really hairy, as we found:

http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl?r1=1.26&r2=1.28


So the merge:

Checking in WHATSNEW;
/home/cvs/ant/WHATSNEW,v  <--  WHATSNEW
new revision: 1.503.2.211; previous revision: 1.503.2.210
done
More commits to come...
Checking in docs/manual/CoreTasks/javadoc.html;
/home/cvs/ant/docs/manual/CoreTasks/javadoc.html,v  <--  javadoc.html
new revision: 1.26.2.7; previous revision: 1.26.2.6
done
More commits to come...
Checking in src/main/org/apache/tools/ant/taskdefs/Javadoc.java;
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v  <-- 
Javadoc.java
new revision: 1.124.2.8; previous revision: 1.124.2.7
done


Misc. trunk cleanups:

Checking in WHATSNEW;
/home/cvs/ant/WHATSNEW,v  <--  WHATSNEW
new revision: 1.799; previous revision: 1.798
done
More commits to come...
Checking in docs/manual/CoreTasks/javadoc.html;
/home/cvs/ant/docs/manual/CoreTasks/javadoc.html,v  <--  javadoc.html
new revision: 1.34; previous revision: 1.33
done
More commits to come...
Checking in src/main/org/apache/tools/ant/taskdefs/Javadoc.java;
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v  <-- 
Javadoc.java
new revision: 1.141; previous revision: 1.140
done