8010495: Update JAXP NetBeans project - add support for generating javadoc
authordfuchs
Fri, 19 Apr 2013 17:22:36 +0200
changeset 17265 a1a60bcda09e
parent 17264 3aff554ad461
child 17266 14d12c1724ce
child 18359 1fb5a3289fd0
8010495: Update JAXP NetBeans project - add support for generating javadoc Summary: Make it possible to use NetBeans to edit the jaxp sources and to generate a preview of the associated javadoc. Reviewed-by: joehw, alanb
jaxp/build.xml
jaxp/nbproject/project.xml
--- a/jaxp/build.xml	Wed Apr 17 15:23:19 2013 +0200
+++ b/jaxp/build.xml	Fri Apr 19 17:22:36 2013 +0200
@@ -176,4 +176,42 @@
         <echo message="+---------------------------------------+"/>
     </target>
 
+    <target name="javadoc" depends="init" description="Build basic Javadoc for public packages.">
+        <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
+        <!-- Note: even with this default value, includes/excludes
+         from share.src.dir get javadoc'd; see packageset below -->
+        <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
+        <property name="javadoc.dir" value="${build.dir}/docs/api"/>
+        <property name="includes" value="**"/>
+        <javadoc destdir="${javadoc.dir}" source="1.5"
+            windowtitle="UNOFFICIAL" failonerror="true" use="true"
+            author="false" version="false"
+            packagenames="${javadoc.packagenames}">
+            <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
+            <arg line="${javadoc.options}"/>
+            <bootclasspath>
+                <path location="${java.home}/lib/rt.jar"/>
+                <path location="${build.classes.dir}"/>
+            </bootclasspath>
+            <sourcepath>
+                <pathelement location="${jaxp.src.dir}"/>
+            </sourcepath>
+            <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
+            <!-- means that {@link some.package} will not work, which is no good. -->
+            <!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
+            <!-- which also causes duplicates in the class index for included files.) -->
+            <packageset dir="${jaxp.src.dir}" includes="${includes}" excludes="${excludes}">
+                <or>
+                    <filename name="javax/"/>
+                    <filename name="org/w3c/"/>
+                    <filename name="org/xml/sax/"/>
+                </or>
+            </packageset>
+        </javadoc>
+    </target>
+    <target name="javadoc-nb" depends="javadoc" if="netbeans.home">
+        <property name="javadoc.dir=" value="${build.dir}/docs/api"/>
+        <nbbrowse file="${javadoc.dir}/index.html"/>
+    </target>
+
 </project>
--- a/jaxp/nbproject/project.xml	Wed Apr 17 15:23:19 2013 +0200
+++ b/jaxp/nbproject/project.xml	Fri Apr 19 17:22:36 2013 +0200
@@ -15,6 +15,12 @@
                     <location>.</location>
                     <encoding>UTF-8</encoding>
                 </source-folder>
+                <source-folder>
+                    <label>src</label>
+                    <type>java</type>
+                    <location>src</location>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
             </folders>
             <ide-actions>
                 <action name="build">
@@ -27,9 +33,16 @@
                     <target>clean</target>
                     <target>build</target>
                 </action>
+                <action name="javadoc">
+                    <target>javadoc-nb</target>
+                </action>
             </ide-actions>
             <view>
                 <items>
+                    <source-folder style="packages">
+                        <label>src</label>
+                        <location>src</location>
+                    </source-folder>
                     <source-file>
                         <location>build.xml</location>
                     </source-file>
@@ -38,11 +51,16 @@
                     <ide-action name="build"/>
                     <ide-action name="rebuild"/>
                     <ide-action name="clean"/>
+                    <ide-action name="javadoc"/>
                 </context-menu>
             </view>
             <subprojects/>
         </general-data>
-        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
+            <compilation-unit>
+                <package-root>src</package-root>
+            </compilation-unit>
+        </java-data>
         <preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">
             <module name="org-netbeans-modules-editor-indent"/>
         </preferences>