aheritier    2004/07/29 15:59:24

  Modified:    javadoc  plugin.jelly project.xml
               javadoc/xdocs changes.xml properties.xml
  Added:       javadoc/src/plugin-test/test05 .cvsignore maven.xml
                        project.xml
               javadoc/src/plugin-test/test05/src/main Dummy.java
                        Dummy2.java
               javadoc/src/plugin-test/test05/src/main/test Dummy3.java
                        package.html
               javadoc/src/plugin-test/test05/src/main/test/doc-files
                        example.txt
  Log:
  MPJAVADOC-36 : fix error when the package isn't defined in the POM.
  
  Revision  Changes    Path
  1.52      +19 -4     maven-plugins/javadoc/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/javadoc/plugin.jelly,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- plugin.jelly      13 Jul 2004 12:20:03 -0000      1.51
  +++ plugin.jelly      29 Jul 2004 22:59:24 -0000      1.52
  @@ -79,6 +79,10 @@
   maven.javadoc.version             = [${maven.javadoc.version}]
   maven.javadoc.windowtitle         = [${maven.javadoc.windowtitle}]
   ==================================
  +=== Project descriptor         ===
  +==================================
  +pom.package                       = [${pom.package}]
  +==================================
   === javadoc internal variables ===
   ==================================
   internal.javadoc.jar              = [${internal.javadoc.jar}]
  @@ -105,7 +109,7 @@
           <j:otherwise>
           
             <!-- test if sourceModifications are defined -->
  -          <j:if test="${pom.build.sourceModifications!=null &amp;&amp; 
!pom.build.sourceModifications.isEmpty()}">
  +          <j:if test="${pom.build.sourceModifications!=null and 
!pom.build.sourceModifications.isEmpty()}">
               <j:if test="${maven.javadoc.debug}"><ant:echo>sourceModifications 
used.</ant:echo></j:if>
               <util:tokenize var="sources.dirs" 
delim="${path.separator}">${context.getAntProject().getReferences().get('maven.compile.src.set')}</util:tokenize>
               <ant:copy todir="${internal.javadoc.src.tmp}">
  @@ -148,11 +152,13 @@
               <!-- If we have not already find sources -->
               <j:if test="${internal.javadoc.needed != true}">
                 <!-- We construct the fileset -->
  -              <j:set var="includes" value="**/*.java" />
                 <util:replace var="packageDir" newChar="/" oldChar="." 
value="${pom.package}" />
                 <j:if test="${!empty(packageDir)}">
                   <j:set var="includes" value="${packageDir}/**/*.java" />
                 </j:if>
  +              <j:if test="${empty(packageDir)}">
  +                <j:set var="includes" value="**/*.java" />
  +              </j:if>
                 <ant:fileScanner var="sources">
                   <ant:fileset dir="${dir}">
                     <ant:include name="${includes}" />
  @@ -269,9 +275,18 @@
   
         <ant:mkdir dir="${internal.javadoc.working.dir}" />
         <ant:record name="${internal.javadoc.working.dir}/report.txt" action="start" 
/>
  +
  +      <j:choose>
  +        <j:when test="${pom.package != null and !pom.package.equals('')}">
  +          <j:set var="packageNamesValue" value="${pom.package}.*" />
  +        </j:when>
  +        <j:otherwise>
  +          <j:set var="packageNamesValue" value="*" />
  +        </j:otherwise>
  +      </j:choose>
         
         <ant:javadoc
  -        packagenames="${pom.package}.*"
  +        packagenames="${packageNamesValue}"
           destdir="${maven.javadoc.destdir}"
           author="${maven.javadoc.author}"
           public="${maven.javadoc.public}"
  @@ -291,7 +306,7 @@
           <ant:sourcepath>
             <ant:path refid="internal.javadoc.sources"/>
           </ant:sourcepath>
  -        
  +
           <j:if test="${context.getVariable('maven.javadoc.source') != null}">
             <ant:setProperty name="source" value="${maven.javadoc.source}" />
           </j:if>
  
  
  
  1.43      +2 -2      maven-plugins/javadoc/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/javadoc/project.xml,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- project.xml       13 Jul 2004 12:22:27 -0000      1.42
  +++ project.xml       29 Jul 2004 22:59:24 -0000      1.43
  @@ -23,7 +23,7 @@
     <pomVersion>3</pomVersion>
     <id>maven-javadoc-plugin</id>
     <name>Maven Javadoc Plug-in</name>
  -  <currentVersion>1.6.1</currentVersion>
  +  <currentVersion>1.7-SNAPSHOT</currentVersion>
     <description/>
     <shortDescription>Produce Javadocs and report</shortDescription>
     <url>http://maven.apache.org/reference/plugins/javadoc/</url>
  @@ -87,7 +87,6 @@
         <organization>Zenplex</organization>
         <roles>
           <role>Architect</role>
  -        <role>Release Manager</role>
         </roles>
       </developer>
       <developer>
  @@ -114,6 +113,7 @@
         <email>[EMAIL PROTECTED]</email>
         <roles>
           <role>Developer</role>
  +        <role>Release Manager</role>
         </roles>
       </developer>
     </developers>
  
  
  
  1.1                  maven-plugins/javadoc/src/plugin-test/test05/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  gump.xml
  *.log
  targetdist
  dist
  target
  
  
  
  1.1                  maven-plugins/javadoc/src/plugin-test/test05/maven.xml
  
  Index: maven.xml
  ===================================================================
  <!-- 
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  <project xmlns:util="jelly:util"
           xmlns:maven="jelly:maven"
           xmlns:j="jelly:core"
           xmlns:assert="assert"
           xmlns:ant="jelly:ant">
           
    <goal name="testPlugin">
      <delete dir="${maven.build.dir}" failonerror="false"/>
      <delete file="${maven.build.dir}/${maven.final.name}_javadoc.jar" 
failonerror="false"/>
      <attainGoal name="javadoc"/>
      <assert:assertFileExists file="${maven.javadoc.destdir}/index.html"/>
      <!-- assert that doc-files are copied - Issue MPJAVADOC-24 -->
      <!-- Doesn't work actually in this case :-( -->
      <!-- <assert:assertFileExists 
file="${maven.javadoc.destdir}/test/doc-files/example.txt"/> -->
      <!-- assert that javadoc for classes Dummy, Dummy2, Dummy3 are generated -->
      <!-- Doesn't work actually in this case :-( -->
      <!-- <assert:assertFileExists file="${maven.javadoc.destdir}/Dummy.html"/> -->
      <!-- <assert:assertFileExists file="${maven.javadoc.destdir}/Dummy2.html"/> -->
      <assert:assertFileExists file="${maven.javadoc.destdir}/test/Dummy3.html"/>
    </goal>
  
  </project>
  
  
  1.1                  maven-plugins/javadoc/src/plugin-test/test05/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  
  <project>
    <pomVersion>3</pomVersion>
    <id>test-maven-javadoc-plugin-05</id>
    <name>Generates the Javadoc for a project without package in POM 
(MPJAVADOC-36)</name>
    <groupId>maven</groupId>
    <currentVersion>1.0-SNAPSHOT</currentVersion>
    <organization>
      <name>Apache Software Foundation</name>
      <url>http://www.apache.org/</url>
      <logo>http://maven.apache.org/images/apache-maven-project.png</logo>
    </organization>
    <inceptionYear>2001</inceptionYear>
    <logo>http://maven.apache.org/images/maven.jpg</logo>
    <description>Generates the Javadoc for a project without package in POM 
(MPJAVADOC-36)</description>
    <shortDescription>Generates the Javadoc for a project without package in POM 
(MPJAVADOC-36)</shortDescription>
    <url>http://maven.apache.org/reference/plugins/javadoc/index.html</url>
    <siteDirectory>/www/maven.apache.org/reference/plugins/javadoc/</siteDirectory>
    <repository>
      <connection>scm:cvs:pserver:[EMAIL 
PROTECTED]:/home/cvspublic:maven-plugins/javadoc/</connection>
      <url>http://cvs.apache.org/viewcvs/maven-plugins/javadoc/</url>
    </repository>
    <developers>
      <developer>
        <name>dIon Gillard</name>
        <id>dion</id>
        <email>[EMAIL PROTECTED]</email>
        <organization>Multitask Consulting</organization>
        <roles>
          <role>Documentation</role>
        </roles>
      </developer>
      <developer>
        <name>Arnaud Heritier</name>
        <id>aheritier</id>
        <email>[EMAIL PROTECTED]</email>
        <roles>
          <role>Developer</role>
        </roles>
      </developer>
    </developers>
  
    <build>
      <sourceDirectory>src/main</sourceDirectory>
    </build>
  </project>
  
  
  1.1                  maven-plugins/javadoc/src/plugin-test/test05/src/main/Dummy.java
  
  Index: Dummy.java
  ===================================================================
  public class Dummy
  {
      public String badChecky = "error";
  
      public Dummy() {}
  } 
  
  
  
  1.1                  
maven-plugins/javadoc/src/plugin-test/test05/src/main/Dummy2.java
  
  Index: Dummy2.java
  ===================================================================
  public class Dummy2
  {
      public String badChecky = "error";
  
      public Dummy dummy = new Dummy();
  } 
  
  
  
  1.1                  
maven-plugins/javadoc/src/plugin-test/test05/src/main/test/Dummy3.java
  
  Index: Dummy3.java
  ===================================================================
  package test;
  
  public class Dummy3
  {
      public String badChecky = "error";
  
      public Dummy3 dummy = new Dummy3();
  } 
  
  
  
  1.1                  
maven-plugins/javadoc/src/plugin-test/test05/src/main/test/package.html
  
  Index: package.html
  ===================================================================
  <html>
  <head></head>
  <body>
  Package documentation. <br/>
  <a href="doc-files/example.txt">example.txt</a> in doc-files directory.
  </body>
  </html>
  
  
  1.1                  
maven-plugins/javadoc/src/plugin-test/test05/src/main/test/doc-files/example.txt
  
  Index: example.txt
  ===================================================================
  This an example
  
  
  1.44      +4 -0      maven-plugins/javadoc/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/javadoc/xdocs/changes.xml,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- changes.xml       13 Jul 2004 12:22:27 -0000      1.43
  +++ changes.xml       29 Jul 2004 22:59:24 -0000      1.44
  @@ -25,6 +25,10 @@
       <author email="[EMAIL PROTECTED]">Emmanuel Venisse</author>
     </properties>
     <body>
  +    <release version="1.7" date="In CVS">
  +      <action dev="aheritier" type="fix" issue="MPJAVADOC-37">Default javadoc scope 
(package) can't be replaced by private or public.</action>
  +      <action dev="aheritier" type="fix" issue="MPJAVADOC-36">Javadoc fails if 
pom.package isn't specified.</action>
  +    </release>
       <release version="1.6.1" date="2004-07-13">
         <action dev="brett" type="fix">Correct check needed function for when package 
is given but there are not java files in it.</action>
       </release>
  
  
  
  1.19      +11 -1     maven-plugins/javadoc/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/javadoc/xdocs/properties.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- properties.xml    7 Jul 2004 23:01:13 -0000       1.18
  +++ properties.xml    29 Jul 2004 22:59:24 -0000      1.19
  @@ -316,17 +316,27 @@
       <section name="Other Settings">
         <table>
           <tr>
  -          <th>Property</th>
  +          <th>Type</th>
  +          <th>Name</th>
             <th>Optional?</th>
             <th>Description</th>
           </tr>
           <tr>
  +          <td>Property</td>
             <td>maven.compile.encoding</td>
             <td>Yes</td>
             <td>
               Sets the encoding of the .java files being documented (and compiled). 
             </td>
           </tr>
  +        <tr>
  +          <td>Project descriptor</td>
  +          <td>pom.package</td>
  +          <td>Yes</td>
  +          <td>
  +            The package used as root for the javadoc.
  +          </td>
  +        </tr>        
         </table>
       </section>    
     </body>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to