Remove sourceModifications management in the plugin.
It created a lot of problems (MPJAVADOC-28, MPJAVADOC-29). git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
f75a0a6150
commit
5b2162e21e
11 files changed
+33
-103
No files matched your search
+9
-81
@@ -36,7 +36,6 @@
|
||||
<!-- internal variables -->
|
||||
<j:set var="internal.javadoc.jar" value="${maven.build.dir}/${maven.final.name}_javadoc.jar"/>
|
||||
<j:set var="internal.javadoc.needed" value="null"/>
|
||||
<j:set var="internal.javadoc.src.modifs" value="false"/>
|
||||
<j:set var="internal.javadoc.src.set" value="${context.getAntProject().getReferences().get('maven.compile.src.set')}"/>
|
||||
<j:set var="internal.javadoc.working.dir" value="${maven.build.dir}/javadoc"/>
|
||||
|
||||
@@ -75,7 +74,6 @@ maven.javadoc.windowtitle = [${maven.javadoc.windowtitle}]
|
||||
==================================
|
||||
internal.javadoc.jar = [${internal.javadoc.jar}]
|
||||
internal.javadoc.needed = [${internal.javadoc.needed}]
|
||||
internal.javadoc.src.modifs = [${internal.javadoc.src.modifs}]
|
||||
internal.javadoc.src.set = [${internal.javadoc.src.set}]
|
||||
internal.javadoc.working.dir = [${internal.javadoc.working.dir}]
|
||||
</ant:echo>
|
||||
@@ -99,61 +97,29 @@ internal.javadoc.working.dir = [${internal.javadoc.working.dir}]
|
||||
|
||||
<j:when test="${internal.javadoc.needed != null}">
|
||||
<!-- We have already decided if javadoc is needed -->
|
||||
<j:if test="${maven.javadoc.debug}"><ant:echo>${internal.javadoc.needed} not null</ant:echo></j:if>
|
||||
<j:if test="${maven.javadoc.debug}"><ant:echo>internal.javadoc.needed not null : ${internal.javadoc.needed}</ant:echo></j:if>
|
||||
</j:when>
|
||||
|
||||
<j:otherwise>
|
||||
<!-- Create a patternset for source modifications -->
|
||||
<patternset id="source.modifications">
|
||||
<ant:include name="**/*.java"/>
|
||||
<!-- handle source modifications -->
|
||||
<j:forEach var="sm" items="${pom.build.sourceModifications}">
|
||||
<ant:available property="classPresent" classname="${sm.className}"/>
|
||||
<j:if test="${classPresent != 'true'}">
|
||||
<j:forEach var="exclude" items="${sm.excludes}">
|
||||
<ant:exclude name="${exclude}"/>
|
||||
</j:forEach> <!-- end sourceModification exclude -->
|
||||
<j:forEach var="include" items="${sm.includes}">
|
||||
<ant:include name="${include}"/>
|
||||
</j:forEach> <!-- end sourceModification include -->
|
||||
</j:if>
|
||||
</j:forEach> <!-- end sourceModification -->
|
||||
</patternset>
|
||||
|
||||
<!-- test if sourceModifications are defined -->
|
||||
<j:if test="${pom.build.sourceModifications != null && !pom.build.sourceModifications.isEmpty()}">
|
||||
<j:set var="internal.javadoc.src.modifs" scope="parent" value="true"/>
|
||||
</j:if>
|
||||
|
||||
<j:if test="${maven.javadoc.debug}">
|
||||
<ant:echo>internal.javadoc.src.modifs is ${internal.javadoc.src.modifs}</ant:echo>
|
||||
</j:if>
|
||||
<j:otherwise>
|
||||
|
||||
<!-- Tokenize the set of directories -->
|
||||
<util:tokenize var="sources.dirs" delim="${path.separator}">${internal.javadoc.src.set}</util:tokenize>
|
||||
|
||||
<!-- Counter used to name filesets -->
|
||||
<j:set var="src.set.counter" value="0"/>
|
||||
|
||||
|
||||
<!-- For each directory -->
|
||||
<j:forEach var="dir" items="${sources.dirs}">
|
||||
<!-- If we have not already find sources -->
|
||||
<j:if test="${internal.javadoc.needed != true}">
|
||||
<!-- We construct the fileset -->
|
||||
<ant:fileset id="${src.set.counter}" dir="${dir}">
|
||||
<patternset refid="source.modifications"/>
|
||||
</ant:fileset>
|
||||
|
||||
<ant:fileScanner var="sources">
|
||||
<ant:fileset refid="${src.set.counter}" />
|
||||
<ant:fileset dir="${dir}" include="**/*.java"/>
|
||||
</ant:fileScanner>
|
||||
|
||||
<j:set var="internal.javadoc.needed" scope="parent"
|
||||
value="${sources.iterator().hasNext()}" />
|
||||
|
||||
<j:set var="src.set.counter" value="${src.set.counter + 1}"/>
|
||||
</j:if>
|
||||
</j:forEach> <!-- dir in maven.compile.src.set -->
|
||||
</j:forEach> <!-- dir in internal.javadoc.src.set -->
|
||||
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
@@ -272,31 +238,9 @@ internal.javadoc.working.dir = [${internal.javadoc.working.dir}]
|
||||
verbose="${maven.javadoc.debug}"
|
||||
>
|
||||
|
||||
<j:if test="${internal.javadoc.src.modifs == true}">
|
||||
<j:if test="${maven.javadoc.debug}">
|
||||
<ant:echo>Javadoc uses a fileset</ant:echo>
|
||||
</j:if>
|
||||
<!-- Tokenize the set of directories -->
|
||||
<util:tokenize var="sources.dirs" delim="${path.separator}">${internal.javadoc.src.set}</util:tokenize>
|
||||
|
||||
<j:forEach var="dir" items="${sources.dirs}">
|
||||
|
||||
<echo>[${dir}] added to javadoc sources</echo>
|
||||
<ant:fileset dir="${dir}">
|
||||
<patternset refid="source.modifications"/>
|
||||
</ant:fileset>
|
||||
|
||||
</j:forEach> <!-- dir in maven.compile.src.set -->
|
||||
</j:if>
|
||||
|
||||
<j:if test="${internal.javadoc.src.modifs != true}">
|
||||
<j:if test="${maven.javadoc.debug}">
|
||||
<ant:echo>Javadoc uses a source path</ant:echo>
|
||||
</j:if>
|
||||
<ant:sourcepath>
|
||||
<ant:path refid="maven.compile.src.set"/>
|
||||
</ant:sourcepath>
|
||||
</j:if>
|
||||
<ant:sourcepath>
|
||||
<ant:path refid="maven.compile.src.set"/>
|
||||
</ant:sourcepath>
|
||||
|
||||
<j:if test="${context.getVariable('maven.javadoc.source') != null}">
|
||||
<ant:setProperty name="source" value="${maven.javadoc.source}" />
|
||||
@@ -421,22 +365,6 @@ internal.javadoc.working.dir = [${internal.javadoc.working.dir}]
|
||||
inputText="${inputText}"
|
||||
output="${genDocs}/javadoc.xml"/>
|
||||
|
||||
<j:if test="${internal.javadoc.src.modifs}">
|
||||
<!--
|
||||
Because we use in the javadoc task a fileset and not a packageset
|
||||
(to allow sourceModifications) the javadoc doesn't copy
|
||||
automatically doc-files directories.
|
||||
We must do it manually.
|
||||
-->
|
||||
<util:tokenize var="sources.dirs" delim="${path.separator}">${internal.javadoc.src.set}</util:tokenize>
|
||||
<ant:copy todir="${maven.javadoc.destdir}">
|
||||
<j:forEach var="dir" items="${sources.dirs}">
|
||||
<ant:fileset dir="${dir}">
|
||||
<ant:include name="**/doc-files/**/*"/>
|
||||
</ant:fileset>
|
||||
</j:forEach>
|
||||
</ant:copy>
|
||||
</j:if>
|
||||
</j:if>
|
||||
|
||||
<j:if test="not ${internal.javadoc.needed}">
|
||||
@@ -525,4 +453,4 @@ internal.javadoc.working.dir = [${internal.javadoc.working.dir}]
|
||||
<goal name="javadoc:generate" prereqs="maven-javadoc-plugin:report"/>
|
||||
<goal name="javadoc" prereqs="maven-javadoc-plugin:report"/>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -34,10 +34,10 @@
|
||||
<!-- assert that doc-files are copied - Issue MPJAVADOC-24 -->
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven/doc-files/example.txt"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven2/doc-files/example.txt"/>
|
||||
<!-- assert that javadoc for classes Dummy, Dummy2, Dummy3 are generated -->
|
||||
<!-- assert that javadoc for classes Dummy, Dummy2, Dummy3, Dummy4 are generated -->
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven/Dummy.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven/Dummy2.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven2/Dummy3.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven2/Dummy4.html"/>
|
||||
</goal>
|
||||
|
||||
<goal name="test-javadoc-multi-src">
|
||||
@@ -52,17 +52,18 @@
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven/doc-files/example.txt"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven2/doc-files/example.txt"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven3/doc-files/example.txt"/>
|
||||
<!-- assert that javadoc for classes Dummy, Dummy2, Dummy3, Dummy5, Dummy6 are generated -->
|
||||
<!-- assert that javadoc for classes Dummy, Dummy2, Dummy3, Dummy4, Dummy5, Dummy6 are generated -->
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven/Dummy.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven/Dummy2.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven2/Dummy3.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven2/Dummy4.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven3/Dummy5.html"/>
|
||||
<assert:assertFileExists file="${maven.javadoc.destdir}/org/apache/maven3/Dummy6.html"/>
|
||||
</goal>
|
||||
|
||||
<goal name="test-javadoc-jar">
|
||||
<delete file="${maven.build.dir}/${maven.final.name}_javadoc.jar" failonerror="false"/>
|
||||
<delete file="${maven.build.dir}/${maven.final.name}_javadoc.jar" failonerror="false"/>
|
||||
<attainGoal name="javadoc:jar"/>
|
||||
<assert:assertFileExists file="${maven.build.dir}/${maven.final.name}_javadoc.jar"/>
|
||||
</goal>
|
||||
</project>
|
||||
</project>
|
||||
@@ -54,13 +54,5 @@
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src/main</sourceDirectory>
|
||||
<sourceModifications>
|
||||
<sourceModification>
|
||||
<className>org.apache.maven.Dummy</className>
|
||||
<excludes>
|
||||
<exclude>**/Dummy4.*</exclude>
|
||||
</excludes>
|
||||
</sourceModification>
|
||||
</sourceModifications>
|
||||
</build>
|
||||
</project>
|
||||
</project>
|
||||
@@ -1,4 +1,7 @@
|
||||
<html>
|
||||
<head></head>
|
||||
<body>Package documentation.<br/> <a href="doc-files/example.txt">example.txt in doc-files directory.</a></body>
|
||||
<body>
|
||||
Package documentation. <br/>
|
||||
<a href="doc-files/example.txt">example.txt</a> in doc-files directory.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,7 @@
|
||||
<html>
|
||||
<head></head>
|
||||
<body>Package documentation.<br/> <a href="doc-files/example.txt">example.txt in doc-files directory.</a></body>
|
||||
<body>
|
||||
Package documentation. <br/>
|
||||
<a href="doc-files/example.txt">example.txt</a> in doc-files directory.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,7 @@
|
||||
<html>
|
||||
<head></head>
|
||||
<body>Package documentation.<br/> <a href="doc-files/example.txt">example.txt in doc-files directory.</a></body>
|
||||
<body>
|
||||
Package documentation. <br/>
|
||||
<a href="doc-files/example.txt">example.txt</a> in doc-files directory.
|
||||
</body>
|
||||
</html>
|
||||
@@ -29,7 +29,7 @@
|
||||
<action dev="aheritier" type="add">Add the property maven.javadoc.debug to print informations to debug the plugin.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPJAVADOC-26" due-to="Denis McLaughlin">Fix the needed flag when there's an empty sources directory.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPJAVADOC-24">doc-files directories contents are correctly copied.</action>
|
||||
<action dev="brett" type="fix" issue="MPJAVADOC-5">Add support for multiple source directories.</action>
|
||||
<action dev="brett" type="fix" issue="MPJAVADOC-5">Add support for multiple source directories. SourceModifications aren't supported !!!</action>
|
||||
</release>
|
||||
<release version="1.5" date="2004-05-15">
|
||||
<action dev="dion" type="fix">javadoc:jar changed to place the jar in maven.build.dir</action>
|
||||
|
||||
@@ -59,4 +59,4 @@
|
||||
</goal>
|
||||
</goals>
|
||||
</body>
|
||||
</document>
|
||||
</document>
|
||||
@@ -44,4 +44,4 @@
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
</document>
|
||||
@@ -31,4 +31,4 @@
|
||||
<item name="Properties" href="/properties.html" />
|
||||
</menu>
|
||||
</body>
|
||||
</project>
|
||||
</project>
|
||||
@@ -307,4 +307,4 @@ maven.javadoc.offlineLinks=http://java.sun.com/j2se/1.4.2/docs/api/#/opt/java-ap
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
</document>
|
||||
Reference in new issue
Block a user