You are viewing a plain text version of this content. The canonical link for it is here.
Posted to easyant-commits@incubator.apache.org by jl...@apache.org on 2012/10/22 19:39:53 UTC

svn commit: r1401045 - in /incubator/easyant/plugins/trunk/easyant-plugin-documentation/src: main/resources/easyant-plugin-documentation.ant test/antunit/easyant-plugin-documentation-test.xml

Author: jlboudart
Date: Mon Oct 22 19:39:52 2012
New Revision: 1401045

URL: http://svn.apache.org/viewvc?rev=1401045&view=rev
Log:
Add package target in easyant-plugin-documentation

Modified:
    incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/main/resources/easyant-plugin-documentation.ant
    incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/test/antunit/easyant-plugin-documentation-test.xml

Modified: incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/main/resources/easyant-plugin-documentation.ant
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/main/resources/easyant-plugin-documentation.ant?rev=1401045&r1=1401044&r2=1401045&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/main/resources/easyant-plugin-documentation.ant (original)
+++ incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/main/resources/easyant-plugin-documentation.ant Mon Oct 22 19:39:52 2012
@@ -18,24 +18,37 @@
     xmlns:ea="antlib:org.apache.easyant">
     <ea:core-version requiredrevision="[0.9,+]" />
 
+    <ea:parameter property="target.documentation.dir" default="${target}/documentation"
+        description="directory where the documentation will be generated to" />
+
+
     <target name="easyant-plugin-documentation:report">
         <ea:parameter property="plugindoc.module.ivy" description="plugin's module ivy used to know dependencies"
             default="${basedir}/module.ivy" />
         <ea:parameter property="plugindoc.source.dir" description="plugin's source dirrectory used to know targets/extensionPoints etc..."
             required="true" />
         <ea:parameter property="plugindoc.main.confs" description="plugin's main conf" default="default" />
-        <ea:parameter property="plugindoc.todir" description="target directory where plugin doc will be generated"
-            required="true" />
         <ea:plugin-report moduleIvy="${plugindoc.module.ivy}" sourceDirectory="${plugindoc.source.dir}"
-            conf="${plugindoc.main.confs}" todir="${plugindoc.todir}" />
+            conf="${plugindoc.main.confs}" todir="${target.documentation.dir}" />
     </target>
 
-    <target name="easyant-plugin-documentation:register-artifact" depends="easyant-plugin-documentation:report">
-        <ea:parameter property="plugindoc.publish.type" default="html"
+    <target name="easyant-plugin-documentation:package" depends="easyant-plugin-documentation:report"
+        description="generate a package containing plugin documentation">
+        <ea:parameter property="target.artifacts" default="${target}/artifacts" description="destination directory for target artifacts" />
+        <mkdir dir="${target.artifacts}" />
+        <zip destfile="${target.artifacts}/${ivy.module}-documentation.zip">
+            <fileset dir="${target.documentation.dir}" erroronmissingdir="false" />
+        </zip>
+    </target>
+
+    <target name="easyant-plugin-documentation:register-artifact" depends="easyant-plugin-documentation:package">
+        <ea:parameter property="plugindoc.publish.type" default="zip"
             description="default type for plugin documentation artifacts" />
         <ea:parameter property="plugindoc.publish.confs" default="documentation"
             description="default configurations for plugin documentation artifacts" />
+        <ea:parameter property="project.ivy.instance" default="project.ivy.instance" description="the ivy instance name for your project" />
+
         <ea:registerartifact type="${plugindoc.publish.type}" confs="${publishdoc.publish.confs}"
             settingsRef="easyant.ivy.instance" />
     </target>
-</project>
\ No newline at end of file
+</project>

Modified: incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/test/antunit/easyant-plugin-documentation-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/test/antunit/easyant-plugin-documentation-test.xml?rev=1401045&r1=1401044&r2=1401045&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/test/antunit/easyant-plugin-documentation-test.xml (original)
+++ incubator/easyant/plugins/trunk/easyant-plugin-documentation/src/test/antunit/easyant-plugin-documentation-test.xml Mon Oct 22 19:39:52 2012
@@ -35,8 +35,6 @@
     <target name="setUp" depends="clean">
         <property name="plugindoc.module.ivy" value="${basedir}/sample-module.ivy" />
         <property name="plugindoc.source.dir" value="${basedir}/src/main/resources" />
-        <property name="plugindoc.todir" value="${target}/artifacts" />
-
     </target>
     <target name="tearDown" depends="clean" />
 
@@ -44,8 +42,14 @@
         <au:assertPropertyEquals name="plugindoc.module.ivy" value="${basedir}/sample-module.ivy" />
         <au:assertPropertyEquals name="plugindoc.source.dir" value="${basedir}/src/main/resources" />
         <au:assertPropertyEquals name="plugindoc.main.confs" value="default" />
-        <au:assertPropertyEquals name="plugindoc.todir" value="${target}/artifacts" />
-        <au:assertFileExists file="${target}/artifacts/org.apache.easyant.plugins-tinyplugin-default.html" />
+        <au:assertPropertyEquals name="target.documentation.dir" value="${target}/documentation" />
+        <au:assertFileExists file="${target}/documentation/org.apache.easyant.plugins-tinyplugin-default.html" />
+    </target>
+    
+    <target name="testeasyant-plugin-documentation:package" depends="easyant-plugin-documentation:package">
+        <au:assertPropertyEquals name="target.artifacts" value="${target}/artifacts" />
+        <au:assertFileExists file="${target.artifacts}"/>
+        <au:assertFileExists file="${target.artifacts}/${ivy.module}-documentation.zip"/>
     </target>
 
     <target name="prepare-register-artifact">
@@ -54,7 +58,8 @@
     </target>
 
     <target name="test-easyant-plugin-documentation:register-artifact" depends="prepare-register-artifact,easyant-plugin-documentation:register-artifact">
-        <au:assertPropertyEquals name="plugindoc.publish.type" value="html" />
+        <au:assertPropertyEquals name="plugindoc.publish.type" value="zip" />
         <au:assertPropertyEquals name="plugindoc.publish.confs" value="documentation" />
+        <au:assertPropertyEquals name="project.ivy.instance" value="project.ivy.instance"/>
     </target>
-</project>
\ No newline at end of file
+</project>