Revision: 8960
Author: gwt.mirror...@gmail.com
Date: Wed Oct  6 13:42:42 2010
Log: Create the list of packages to javadoc dynamically
Link out to JSON and JSR 303 javadoc on the Web

Review at http://gwt-code-reviews.appspot.com/944802

Review by: j...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8960

Added:
 /trunk/doc/find-packages.sh
 /trunk/doc/json-package-list
 /trunk/doc/json-package-list/package-list
 /trunk/doc/validation-package-list
 /trunk/doc/validation-package-list/package-list
Deleted:
 /trunk/doc/packages.properties
Modified:
 /trunk/doc/build.xml

=======================================
--- /dev/null
+++ /trunk/doc/find-packages.sh Wed Oct  6 13:42:42 2010
@@ -0,0 +1,93 @@
+#!/bin/bash
+set noglob
+
+OUTFILE=packages.properties
+TMPFILE=/tmp/gwt-javadoc-packages$$
+
+# Regex patterns to exclude from the list of packages
+EXCLUSIONS="\
+^com\.example\.|\
+^com\.google\.gwt\.dev(\.|$)|\
+^com\.google\.gwt\.emul\.|\
+^com\.google\.gwt\.examples(\.|$)|\
+^com\.google\.gwt\.i18n\.server(\.|$)|\
+^com\.google\.gwt\.i18n\.tools|\
+^com\.google\.gwt\.lang|\
+^com\.google\.gwt\.junit(\.|$)|\
+^com\.google\.gwt\.resources\.css(\.|$)|\
+^com\.google\.gwt\.resources\.rg(\.|$)|\
+^com\.google\.gwt\.rpc\.client\.ast(\.|$)|\
+^com\.google\.gwt\.soyc(\.|$)|\
+^com\.google\.gwt\.validation(.|$)|\
+^com\.google\.gwt\.user\.client\.rpc\.core\.|\
+^javax\.|\
+^junit\.|\
+^org\.|\
+\.impl(\.|$)|\
+\.rebind(\.|$)"
+
+# Generate the packages.properties file
+# Changes to LANG_PKGS and USER_CLASSES go here
+# Note that line continuation backslashes must be escaped
+cat > ${OUTFILE} <<EOF
+# THIS FILE IS AUTOMATICALLY GENERATED
+#
+# This file contains all of the user javadoc packages
+#
+# JRE emulation packages
+LANG_PKGS=\\
+java.lang;\\
+java.lang.annotation;\\
+java.io;\\
+java.sql;\\
+java.util
+# The last package should not have a trailing semicolon
+
+# Individual classes to include when we don't want to include an entire package
+USER_CLASSES=\\
+\${gwt.root}/user/src/com/google/gwt/junit/tools/GWTTestSuite.java:\\
+\${gwt.root}/user/src/com/google/gwt/i18n/rebind/LocaleUtils.java:\\
+\${gwt.root}/user/src/com/google/gwt/i18n/server/GwtLocaleFactoryImpl.java:\\
+\${gwt.root}/user/src/com/google/gwt/i18n/server/GwtLocaleImpl.java
+
+# Packages to include
+USER_PKGS=\\
+EOF
+
+rm -f ${TMPFILE}
+
+# Create a list of all packages with at least one Java source file
+# List all source files
+for dir in ../user/src ../user/javadoc ../user/super ../dev/core/src ../dev/core/super
+do
+(cd ${dir}; find . -name '*.java') >> ${TMPFILE}
+done
+
+cat ${TMPFILE} | \
+# Remove source file names
+sed 's@/[-A-Za-z0-9_]*\.java$@@'| \
+# Removce initial './'
+sed s...@^\./@@ | \
+# Remove .../super/ and .../translatable prefixes
+sed s...@^.*/super/@@ | \
+sed s...@^.*/translatable/@@ | \
+# Change slashes to dots
+sed s@/@....@g | \
+# Remove excluded patters
+egrep -v ${EXCLUSIONS} > ${TMPFILE}-2
+mv ${TMPFILE}-2 ${TMPFILE}
+
+# Re-add whitelisted packages that would otherwise be excluded
+echo com.google.gwt.i18n.rebind.format >> ${TMPFILE}
+echo com.google.gwt.i18n.rebind.keygen >> ${TMPFILE}
+echo com.google.gwt.junit.client >> ${TMPFILE}
+
+# Sort, uniqify, and add ';\' to each line except the last
+cat ${TMPFILE} | \
+sort | \
+uniq | \
+sed '$q;s...@$@;\\@' >> ${OUTFILE}
+echo '# The last package should not have a trailing semicolon' >> ${OUTFILE}
+
+# Clean up
+rm -f ${TMPFILE}
=======================================
--- /dev/null
+++ /trunk/doc/json-package-list/package-list   Wed Oct  6 13:42:42 2010
@@ -0,0 +1,1 @@
+org.json
=======================================
--- /dev/null
+++ /trunk/doc/validation-package-list/package-list     Wed Oct  6 13:42:42 2010
@@ -0,0 +1,2 @@
+javax.validation
+javax.validation.constraints
=======================================
--- /trunk/doc/packages.properties      Tue Oct  5 11:17:27 2010
+++ /dev/null
@@ -1,87 +0,0 @@
-# This file contains all of the user javadoc packages.
-LANG_PKGS=\
-java.lang;\
-java.lang.annotation;\
-java.io;\
-java.sql;\
-java.util
-# The last package should not have a trailing semicolon
-
-# Individual classes to include when we don't want to include an entire package.
-USER_CLASSES=\
-${gwt.root}/user/src/com/google/gwt/junit/tools/GWTTestSuite.java:\
-${gwt.root}/user/src/com/google/gwt/i18n/rebind/LocaleUtils.java:\
-${gwt.root}/user/src/com/google/gwt/i18n/server/GwtLocaleFactoryImpl.java:\
-${gwt.root}/user/src/com/google/gwt/i18n/server/GwtLocaleImpl.java
-
-USER_PKGS=\
-com.google.gwt.animation.client;\
-com.google.gwt.app.client;\
-com.google.gwt.app.place;\
-com.google.gwt.benchmarks;\
-com.google.gwt.benchmarks.client;\
-com.google.gwt.cell.client;\
-com.google.gwt.core.client;\
-com.google.gwt.core.client.prefetch;\
-com.google.gwt.core.ext;\
-com.google.gwt.core.ext.linker;\
-com.google.gwt.core.ext.soyc;\
-com.google.gwt.core.ext.typeinfo;\
-com.google.gwt.core.linker;\
-com.google.gwt.debug.client;\
-com.google.gwt.dom.client;\
-com.google.gwt.editor.client;\
-com.google.gwt.editor.client.adapters;\
-com.google.gwt.editor.client.testing;\
-com.google.gwt.editor.client.ui;\
-com.google.gwt.event.dom.client;\
-com.google.gwt.event.logical.shared;\
-com.google.gwt.event.shared;\
-com.google.gwt.event.shared.testing;\
-com.google.gwt.http.client;\
-com.google.gwt.i18n.client;\
-com.google.gwt.i18n.client.constants;\
-com.google.gwt.i18n.rebind.format;\
-com.google.gwt.i18n.rebind.keygen;\
-com.google.gwt.i18n.shared;\
-com.google.gwt.json.client;\
-com.google.gwt.jsonp.client;\
-com.google.gwt.junit.client;\
-com.google.gwt.layout.client;\
-com.google.gwt.logging.client;\
-com.google.gwt.logging.server;\
-com.google.gwt.logging.shared;\
-com.google.gwt.precompress.linker;\
-com.google.gwt.regexp.shared;\
-com.google.gwt.requestfactory.client;\
-com.google.gwt.requestfactory.client.testing;\
-com.google.gwt.requestfactory.server;\
-com.google.gwt.requestfactory.shared;\
-com.google.gwt.resources.client;\
-com.google.gwt.resources.ext;\
-com.google.gwt.rpc.client;\
-com.google.gwt.rpc.linker;\
-com.google.gwt.rpc.server;\
-com.google.gwt.safehtml.client;\
-com.google.gwt.safehtml.shared;\
-com.google.gwt.text.shared;\
-com.google.gwt.uibinder.attributeparsers;\
-com.google.gwt.uibinder.client;\
-com.google.gwt.uibinder.elementparsers;\
-com.google.gwt.user.cellview.client;\
-com.google.gwt.user.client;\
-com.google.gwt.user.client.rpc;\
-com.google.gwt.user.client.ui;\
-com.google.gwt.user.datepicker.client;\
-com.google.gwt.user.linker.rpc;\
-com.google.gwt.user.server;\
-com.google.gwt.user.server.rpc;\
-com.google.gwt.user.tools;\
-com.google.gwt.user.tools.util;\
-com.google.gwt.util;\
-com.google.gwt.util.regexfilter;\
-com.google.gwt.util.tools;\
-com.google.gwt.view.client;\
-com.google.gwt.xhr.client;\
-com.google.gwt.xml.client
-# The last package should not have a trailing semicolon
=======================================
--- /trunk/doc/build.xml        Wed Oct  6 10:05:51 2010
+++ /trunk/doc/build.xml        Wed Oct  6 13:42:42 2010
@@ -9,9 +9,6 @@
   <!-- Platform shouldn't matter here, just picking one -->
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev.jar" />

-  <!-- This file controls the contents of the javadoc -->
-  <property file="packages.properties" />
-
   <!--
     *** Note that if the USER_SOURCE_PATH paths are updated,
     the fileset dependencies in the outofdate tags in the
@@ -42,6 +39,7 @@
     <path refid="USER_SOURCE_PATH" />
   </path>

+  <!-- Rebuild the javadoc if a source file is newer than the index-->
   <target name="javadoc">
     <outofdate>
       <sourcefiles>
@@ -71,35 +69,51 @@
       </targetfiles>
       <sequential>
         <echo>Building javadoc</echo>
- <java classpathref="DOC_PATH" classname="com.google.doctool.custom.GWTJavaDoclet" fork="yes" failonerror="true">
-          <jvmarg value="-Xmx1024m" />
-          <arg value="-quiet" />
-          <arg value="-notimestamp" />
-          <arg value="-source" />
-          <arg value="1.5" />
-          <arg value="-windowtitle" />
-          <arg value="Google Web Toolkit Javadoc" />
-          <arg value="-doctitle" />
-          <arg value="Google Web Toolkit API Reference" />
-          <arg value="-header" />
-          <arg value="GWT ${gwt.version}" />
-          <arg value="-encoding"/>
-          <arg value="UTF-8"/>
-          <arg value="-d" />
-          <arg value="${project.build}/javadoc" />
-          <arg value="-classpath" />
-          <arg pathref="USER_CLASS_PATH" />
-          <arg value="-sourcepath" />
-          <arg pathref="USER_SOURCE_PATH" />
-          <arg value="-examplepackages" />
- <arg value="com.google.gwt.examples;com.google.gwt.examples.i18n;com.google.gwt.examples.http.client;com.google.gwt.examples.rpc.server;com.google.gwt.examples.benchmarks;com.google.gwt.examples.cell;com.google.gwt.examples.cellview;com.google.gwt.examples.view" />
-          <arg value="-packages" />
-          <arg value="${USER_PKGS};${USER_CLASSES}" />
-        </java>
+        <antcall target="makeJavadoc" />
       </sequential>
     </outofdate>
   </target>

+  <!-- Really rebuild the javadoc -->
+  <target name="makeJavadoc">
+    <exec executable="chmod">
+      <arg value="+x" />
+      <arg value="${gwt.root}/doc/find-packages.sh" />
+    </exec>
+    <exec executable="${gwt.root}/doc/find-packages.sh" />
+    <property file="packages.properties" />
+ <java classpathref="DOC_PATH" classname="com.google.doctool.custom.GWTJavaDoclet" fork="yes" failonerror="true">
+      <jvmarg value="-Xmx1024m" />
+      <arg value="-quiet" />
+      <arg value="-notimestamp" />
+      <arg value="-source" />
+      <arg value="1.5" />
+      <arg value="-windowtitle" />
+      <arg value="Google Web Toolkit Javadoc" />
+      <arg value="-doctitle" />
+      <arg value="Google Web Toolkit API Reference" />
+      <arg value="-header" />
+      <arg value="GWT ${gwt.version}" />
+      <arg value="-encoding"/>
+      <arg value="UTF-8"/>
+      <arg value="-d" />
+      <arg value="${project.build}/javadoc" />
+      <arg value="-linkoffline" />
+      <arg value="http://download.oracle.com/javaee/6/api/"; />
+      <arg value="validation-package-list" />
+      <arg value="-link" />
+      <arg value="http://www.json.org/javadoc"; />
+      <arg value="-classpath" />
+      <arg pathref="USER_CLASS_PATH" />
+      <arg value="-sourcepath" />
+      <arg pathref="USER_SOURCE_PATH" />
+      <arg value="-examplepackages" />
+ <arg value="com.google.gwt.examples;com.google.gwt.examples.i18n;com.google.gwt.examples.http.client;com.google.gwt.examples.rpc.server;com.google.gwt.examples.benchmarks;com.google.gwt.examples.cell;com.google.gwt.examples.cellview;com.google.gwt.examples.view" />
+      <arg value="-packages" />
+      <arg value="${USER_PKGS};${USER_CLASSES}" />
+    </java>
+  </target>
+
   <target name="emul-ezt">
     <outofdate>
       <sourcefiles>
@@ -112,6 +126,12 @@
       </targetfiles>
       <sequential>
         <echo>Building JRE emulation EZT</echo>
+        <exec executable="chmod">
+          <arg value="+x" />
+          <arg value="${gwt.root}/doc/find-packages.sh" />
+        </exec>
+        <exec executable="${gwt.root}/doc/find-packages.sh" />
+        <property file="packages.properties" />
<java classpathref="DOC_PATH" classname="com.google.doctool.JreDocTool" fork="yes" failonerror="true">
           <arg value="-out" />
           <arg value="${project.build}/emul-ezt/fragment.html" />

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to