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/08/04 21:18:19 UTC

svn commit: r1369451 - in /incubator/easyant/plugins/trunk: abstract-package/ abstract-package/src/ abstract-package/src/main/ abstract-package/src/main/resources/ abstract-package/src/test/ abstract-package/src/test/antunit/ package-jar/src/main/resou...

Author: jlboudart
Date: Sat Aug  4 21:18:19 2012
New Revision: 1369451

URL: http://svn.apache.org/viewvc?rev=1369451&view=rev
Log:
Add abstract package module and update test cases

Added:
    incubator/easyant/plugins/trunk/abstract-package/
    incubator/easyant/plugins/trunk/abstract-package/module.ivy
    incubator/easyant/plugins/trunk/abstract-package/src/
    incubator/easyant/plugins/trunk/abstract-package/src/main/
    incubator/easyant/plugins/trunk/abstract-package/src/main/resources/
    incubator/easyant/plugins/trunk/abstract-package/src/main/resources/abstract-package.ant
      - copied, changed from r1369450, incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant
    incubator/easyant/plugins/trunk/abstract-package/src/test/
    incubator/easyant/plugins/trunk/abstract-package/src/test/antunit/
    incubator/easyant/plugins/trunk/abstract-package/src/test/antunit/abstract-package-test.xml
      - copied, changed from r1369450, incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml
Modified:
    incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant
    incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml

Added: incubator/easyant/plugins/trunk/abstract-package/module.ivy
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/abstract-package/module.ivy?rev=1369451&view=auto
==============================================================================
--- incubator/easyant/plugins/trunk/abstract-package/module.ivy (added)
+++ incubator/easyant/plugins/trunk/abstract-package/module.ivy Sat Aug  4 21:18:19 2012
@@ -0,0 +1,33 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
+<ivy-module version="2.0" xmlns:ea="http://www.easyant.org"> 
+    <info organisation="org.apache.easyant.plugins" module="abstract-package" revision="0.9">
+           <description>Abstract base plugin, that any modules providing
+           packaging features should include.  abstract-package
+           defines common configuration properties governing packaging</description>
+           <ea:build organisation="org.apache.easyant.buildtypes" module="build-std-ant-plugin" revision="0.1"/>
+        </info>
+        <configurations>
+                <conf name="default" description="runtime dependencies artifact can be used with this conf"/>
+                <conf name="test" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases."/>
+                <conf name="provided" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
+        </configurations>
+    <publications>
+        <artifact type="ant"/>
+    </publications>
+    
+</ivy-module>

Copied: incubator/easyant/plugins/trunk/abstract-package/src/main/resources/abstract-package.ant (from r1369450, incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant)
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/abstract-package/src/main/resources/abstract-package.ant?p2=incubator/easyant/plugins/trunk/abstract-package/src/main/resources/abstract-package.ant&p1=incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant&r1=1369450&r2=1369451&rev=1369451&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant (original)
+++ incubator/easyant/plugins/trunk/abstract-package/src/main/resources/abstract-package.ant Sat Aug  4 21:18:19 2012
@@ -14,50 +14,43 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project name="org.apache.easyant.plugins#package-jar"
+<project name="org.apache.easyant.plugins#abstract-provisioning"
+    xmlns:ac="antlib:net.sf.antcontrib"
     xmlns:ea="antlib:org.apache.easyant">
 
     <ea:core-version requiredrevision="[0.9,+]" />
+    <ea:import mrid="org.apache.easyant.plugins#abstract-compile;0.9" />
 
-    <extension-point name="package-jar:jar-ready" />
-
-    <target name="package-jar:init">
-        <ea:parameter property="target.artifacts.main.jar.name" default="${module.name}.jar" description="main artifact file name" />
+    <extension-point name="abstract-package:package-ready" depends="abstract-compile:compile-finished"/>
+    <extension-point name="abstract-package:package-finished" depends="abstract-package:package-ready" />
 
+    <target name="abstract-package:init">
         <ea:parameter property="target.artifacts" default="${target}/artifacts" description="destination directory for target artifacts"/>
+    </target>
 
-        <ea:parameter property="target.main.artifact" required="false" description="the location of the main artifact" 
-            default="${target.artifacts}/${target.artifacts.main.jar.name}"/>
-
-        <ea:parameter property="target.main.classes" required="true" 
-            description="directory where compiled classes that should be packaged are" />
-
-        <ea:parameter property="manifest.file" required="true"
-            description="the file used to generate manifest" />
-
-        <ea:parameter property="package.jar.includes.pattern" default="**/*" 
-            description="Pattern describing files included in the output jar" />
-        <ea:parameter property="package.jar.excludes.pattern" default="" 
-            description="Pattern describing files excluded in the output jar" />
-
-        <ea:parameter property="package.metainf.basedir" default="${basedir}" 
+    <target name="abstract-package:compute-metainf" depends="abstract-package:package-ready">
+        <ea:parameter property="package.metainf.basedir" default="${basedir}"
                 description="basedir of the metainf fileset"/>
-        <ea:parameter property="package.metainf.includes.pattern" default="NOTICE,LICENSE" 
+        <ea:parameter property="package.metainf.includes.pattern" default="NOTICE,LICENSE"
                 description="Pattern describing files included in the META-INF of the package"/>
-        <ea:parameter property="package.metainf.excludes.pattern" default="" 
+        <ea:parameter property="package.metainf.excludes.pattern" default=""
                 description="Pattern describing files excluded in the META-INF of the package"/>
 
         <fileset id="package.metainf.fileset" dir="${package.metainf.basedir}" includes="${package.metainf.includes.pattern}" excludes="${package.metainf.excludes.pattern}"/>
-
     </target>
 
-    <target name="package-jar:jar" depends="package-jar:init,package-jar:jar-ready" description="package project as a JAR" unless="skip.jar.package">
-        <mkdir dir="${target.artifacts}" />
-        <jar destfile="${target.main.artifact}" manifest="${manifest.file}" 
-            basedir="${target.main.classes}" includes="${package.jar.includes.pattern}"
-            excludes="${package.jar.excludes.pattern}">
-            <metainf refid="package.metainf.fileset"/>
-        </jar>
+
+    <target name="abstract-package:register-artifact" extensionOf="abstract-package:package-finished">
+         <ea:parameter property="target.main.artifact" required="true" description="the location of the main artifact"/>
+         <ea:parameter property="publish.main.type" default="jar" description="default type for main artifacts"/>
+         <ea:parameter property="publish.main.confs" default="default" description="default configurations for main artifacts"/>
+         <ea:parameter property="project.ivy.instance" default="project.ivy.instance" description="the ivy instance name for your project" />
+         
+
+         <ea:registerartifact type="${publish.main.type}" confs="${publish.main.confs}" settingsRef="${project.ivy.instance}"/>
+
     </target>
 
+
+
 </project>

Copied: incubator/easyant/plugins/trunk/abstract-package/src/test/antunit/abstract-package-test.xml (from r1369450, incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml)
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/abstract-package/src/test/antunit/abstract-package-test.xml?p2=incubator/easyant/plugins/trunk/abstract-package/src/test/antunit/abstract-package-test.xml&p1=incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml&r1=1369450&r2=1369451&rev=1369451&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml (original)
+++ incubator/easyant/plugins/trunk/abstract-package/src/test/antunit/abstract-package-test.xml Sat Aug  4 21:18:19 2012
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project name="org.apache.easyant.plugins;package-jar-test" 
+<project name="org.apache.easyant.plugins;abstract-package-test" 
     xmlns:au="antlib:org.apache.ant.antunit" 
     xmlns:ivy="antlib:org.apache.ivy.ant"
     xmlns:ea="antlib:org.apache.easyant">
@@ -25,7 +25,7 @@
     <ea:configure-easyant-ivy-instance />
     <!-- import our local plugin -->
     <ea:import-test-module moduleIvy="../../../module.ivy" sourceDirectory="../../main/resources"/>
-
+   
     <!-- Defines a setUp / tearDown (before each test) that cleans the environnement --> 
     <target name="clean" description="remove stale build artifacts before / after each test">
         <delete dir="${basedir}" includeemptydirs="true">
@@ -34,29 +34,19 @@
         </delete>
     </target>
     
-    <target name="setUp" depends="clean">
-       <property name="target.main.classes" value="${target}/classes"/>
-       <mkdir dir="${target.main.classes}"/>
-       <property name="manifest.file" value="${target}/MANIFEST.MF"/>
-       <echo file="${manifest.file}"/>
- 
-    </target>
+    <target name="setUp" depends="clean"/>
     <target name="tearDown" depends="clean"/>
     
-    <target name="test-package-jar:init" depends="package-jar:init">
-        <au:assertPropertyEquals name="target.artifacts.main.jar.name" value="${module.name}.jar"/>
+    <target name="test-abstract-package:init" depends="abstract-package:init">
         <au:assertPropertyEquals name="target.artifacts" value="${target}/artifacts"/>
-        <au:assertPropertyEquals name="target.main.artifact" value="${target.artifacts}/${target.artifacts.main.jar.name}"/>
-        <au:assertPropertyEquals name="package.jar.includes.pattern" value="**/*"/>
-        <au:assertPropertyEquals name="package.jar.excludes.pattern" value=""/>
+    </target>
+
+    <target name="test-abstract-package:compute-metainf" depends="abstract-package:compute-metainf">
         <au:assertPropertyEquals name="package.metainf.basedir" value="${basedir}"/>
         <au:assertPropertyEquals name="package.metainf.includes.pattern" value="NOTICE,LICENSE"/>
         <au:assertPropertyEquals name="package.metainf.excludes.pattern" value=""/>
         <au:assertReferenceSet refid="package.metainf.fileset"/>
     </target>
 
-    <target name="test-package-jar:jar" depends="package-jar:jar">
-        <au:assertFileExists file="${target.artifacts}"/>
-        <au:assertFileExists file="${target.main.artifact}"/>
-    </target>
+
 </project>

Modified: incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant?rev=1369451&r1=1369450&r2=1369451&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant (original)
+++ incubator/easyant/plugins/trunk/package-jar/src/main/resources/package-jar.ant Sat Aug  4 21:18:19 2012
@@ -18,20 +18,15 @@
     xmlns:ea="antlib:org.apache.easyant">
 
     <ea:core-version requiredrevision="[0.9,+]" />
+    <ea:import mrid="org.apache.easyant.plugins#abstract-package;0.9"/>
 
-    <extension-point name="package-jar:jar-ready" />
-
-    <target name="package-jar:init">
+    <target name="package-jar:init" depends="abstract-package:init,abstract-package:compute-metainf">
         <ea:parameter property="target.artifacts.main.jar.name" default="${module.name}.jar" description="main artifact file name" />
 
-        <ea:parameter property="target.artifacts" default="${target}/artifacts" description="destination directory for target artifacts"/>
-
-        <ea:parameter property="target.main.artifact" required="false" description="the location of the main artifact" 
-            default="${target.artifacts}/${target.artifacts.main.jar.name}"/>
+        <ea:parameter property="target.main.artifact" description="the location of the main artifact" default="${target.artifacts}/${target.artifacts.main.jar.name}"/>
 
         <ea:parameter property="target.main.classes" required="true" 
             description="directory where compiled classes that should be packaged are" />
-
         <ea:parameter property="manifest.file" required="true"
             description="the file used to generate manifest" />
 
@@ -40,18 +35,9 @@
         <ea:parameter property="package.jar.excludes.pattern" default="" 
             description="Pattern describing files excluded in the output jar" />
 
-        <ea:parameter property="package.metainf.basedir" default="${basedir}" 
-                description="basedir of the metainf fileset"/>
-        <ea:parameter property="package.metainf.includes.pattern" default="NOTICE,LICENSE" 
-                description="Pattern describing files included in the META-INF of the package"/>
-        <ea:parameter property="package.metainf.excludes.pattern" default="" 
-                description="Pattern describing files excluded in the META-INF of the package"/>
-
-        <fileset id="package.metainf.fileset" dir="${package.metainf.basedir}" includes="${package.metainf.includes.pattern}" excludes="${package.metainf.excludes.pattern}"/>
-
     </target>
 
-    <target name="package-jar:jar" depends="package-jar:init,package-jar:jar-ready" description="package project as a JAR" unless="skip.jar.package">
+    <target name="package-jar:jar" depends="package-jar:init,abstract-package:package-ready" description="package project as a JAR" unless="skip.jar.package" extensionOf="abstract-package:package-finished">
         <mkdir dir="${target.artifacts}" />
         <jar destfile="${target.main.artifact}" manifest="${manifest.file}" 
             basedir="${target.main.classes}" includes="${package.jar.includes.pattern}"

Modified: incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml?rev=1369451&r1=1369450&r2=1369451&view=diff
==============================================================================
--- incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml (original)
+++ incubator/easyant/plugins/trunk/package-jar/src/test/antunit/package-jar-test.xml Sat Aug  4 21:18:19 2012
@@ -45,14 +45,9 @@
     
     <target name="test-package-jar:init" depends="package-jar:init">
         <au:assertPropertyEquals name="target.artifacts.main.jar.name" value="${module.name}.jar"/>
-        <au:assertPropertyEquals name="target.artifacts" value="${target}/artifacts"/>
         <au:assertPropertyEquals name="target.main.artifact" value="${target.artifacts}/${target.artifacts.main.jar.name}"/>
         <au:assertPropertyEquals name="package.jar.includes.pattern" value="**/*"/>
         <au:assertPropertyEquals name="package.jar.excludes.pattern" value=""/>
-        <au:assertPropertyEquals name="package.metainf.basedir" value="${basedir}"/>
-        <au:assertPropertyEquals name="package.metainf.includes.pattern" value="NOTICE,LICENSE"/>
-        <au:assertPropertyEquals name="package.metainf.excludes.pattern" value=""/>
-        <au:assertReferenceSet refid="package.metainf.fileset"/>
     </target>
 
     <target name="test-package-jar:jar" depends="package-jar:jar">