It would help to actually attach the patch :-)
Index: plugin.jelly
===================================================================
RCS file: /home/cvspublic/maven/src/plugins-build/dist/plugin.jelly,v
retrieving revision 1.11
diff -u -r1.11 plugin.jelly
--- plugin.jelly        16 Oct 2003 08:46:34 -0000      1.11
+++ plugin.jelly        21 Oct 2003 08:21:19 -0000
@@ -3,178 +3,223 @@
 <project 
   xmlns:j="jelly:core"
   xmlns:ant="jelly:ant"
+  xmlns:archive="dist:archive"
+  xmlns:define="jelly:define"
   xmlns:maven="jelly:maven"
   xmlns:deploy="deploy"
   xmlns:util="jelly:util">
 
+    <!--
+    | Archive taglib:
+    |  - copy-dependencies: copies dependencies for category groups
+    |            attributes: category, todir
+    |   - gzip: creates tar.gz distribution file
+    |            attributes: dir, name
+    |   - zip: creates zip distribution file   
+    |            attributes: dir, name
+    |   - install: copies distribution to local repo
+    |  - deploy: deploys distribution to remote repo
+    -->        
+    <define:taglib uri="dist:archive">
+        <define:tag name="copy-dependencies">
+            <j:if test="${projectDescriptor != null}">
+                <maven:pom var="pom" projectDescriptor="${projectDescriptor}"/>
+            </j:if>
+            <j:set var="mavenRepoLocal" 
value='${context.getVariable("maven.repo.local")}'/>
+            <j:forEach var="dependency" items="${pom.dependencies}">
+                <j:if test='${category.equals(dependency.getProperty("category"))}'>
+                    <j:set var="addDependencies" value='true'/>
+                </j:if>
+            </j:forEach>
+
+            <j:if test='${addDependencies == "true" }'>
+                <ant:mkdir dir="${todir}"/>
+                <ant:copy todir="${todir}" flatten="true">
+                    <ant:fileset dir="${mavenRepoLocal}">
+                        <j:forEach var="dependency" items="${pom.dependencies}">
+                            <j:if 
test='${category.equals(dependency.getProperty("category"))}'>
+                                <ant:include 
name="${dependency.artifactDirectory}/jars/${dependency.artifact}"/>
+                                <ant:include 
name="${dependency.artifactDirectory}/licenses/${dependency.artifactId}.license"/>
+                            </j:if>
+                        </j:forEach>
+                    </ant:fileset>
+                </ant:copy>
+            </j:if>
+        </define:tag>
+        <define:tag name="gzip">
+                       <ant:mkdir dir="${maven.dist.dir}"/>
+               <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${name}.tar">
+                <ant:tarfileset dir="${dir}" prefix="${name}"/>
+            </ant:tar>
+           <ant:gzip zipfile="${maven.dist.dir}/${name}.tar.gz"
+                        src="${maven.dist.dir}/${name}.tar"/>
+            <ant:delete file="${maven.dist.dir}/${name}.tar"/>
+        </define:tag>
+        <define:tag name="zip">
+                       <ant:mkdir dir="${maven.dist.dir}"/>
+            <ant:zip destfile="${maven.dist.dir}/${name}.zip">
+                <ant:zipfileset dir="${dir}" prefix="${name}"/>
+           </ant:zip>
+        </define:tag>
+        <define:tag name="install">
+               <j:if test="${type == 'gzip'}">
+                  <j:set var="artifact" value='${name}.tar.gz'/>
+               </j:if>
+               <j:if test="${type == 'zip'}">
+                  <j:set var="artifact" value='${name}.zip'/>
+               </j:if>
+            <j:set var="mavenRepoLocal" 
value='${context.getVariable("maven.repo.local")}'/>
+               <ant:copy file="${maven.dist.dir}/${artifact}"
+                                 
todir="${mavenRepoLocal}/${pom.groupId}/distributions"/>
+        </define:tag>
+        <define:tag name="deploy">
+               <j:if test="${type == 'gzip'}">
+                  <j:set var="artifact" value='${name}.tar.gz'/>
+               </j:if>
+               <j:if test="${type == 'zip'}">
+                  <j:set var="artifact" value='${name}.zip'/>
+               </j:if>
+                   <deploy:artifact artifact="${maven.dist.dir}/${artifact}"
+                         type="distributions"
+                 assureDirectoryCommand="mkdir -p"
+                 siteCommand="cd @deployDirectory@; chmod g+w ${artifact}; chgrp 
${maven.remote.group} ${artifact}"/>
+        </define:tag>
+    </define:taglib>
+
   <!-- ================================================================== -->
-  <!-- D I S T R I B U T I O N S                                          -->
+  <!--  B U I L D   D I S T R I B U T I O N S                             -->
   <!-- ================================================================== -->
 
   <goal
+    name="dist:build-setup"
+    prereqs="scm:checkout-project"
+    description="Set up directories for a distribution build">
+    <ant:delete dir="${maven.dist.dir}"/>
+    <ant:mkdir dir="${maven.dist.dir}"/>
+  </goal>
+
+
+  <goal
     name="dist:prepare-bin-filesystem"
-    prereqs="xdoc:init, jar:jar, javadoc:generate"
+    prereqs="dist:build-setup"
     description="Builds the binary distribution file system.">
     
-    <!--
-    
-    This is the directory where everything is copied to so that it can
-    be archived.
-    
-    -->
-    
-    <ant:delete dir="${maven.dist.bin.assembly.dir}"/>
-    <ant:mkdir dir="${maven.dist.bin.assembly.dir}"/>
+    <ant:mkdir dir="${maven.dist.dir.bin}"/>
 
     <ant:echo>
       +-------------------------------------------------------+
       | C R E A T I N G  B I N A R Y  D I S T R I B U T I O N |
       +-------------------------------------------------------+
     </ant:echo>
+ 
+    <!-- 
+        Execute prereqs goals on scm codebase -
+        will include javadoc:install when it will be fixed
+        (at present it requires a maven.war.build.dir to be set)
+    -->   
+    <j:set var="prereqGoals" value="jar:install"/> 
+    <!--j:set var="prereqGoals" value="jar:install,javadoc:install"/--> 
+       <maven:maven
+      descriptor="${maven.dist.scm.dir}/project.xml"
+      goals="${prereqGoals}"
+      ignoreFailures="false"/>
 
-    <ant:copy todir="${maven.dist.bin.assembly.dir}">
-      <ant:fileset dir=".">
+ 
+    <!-- Copy text files -->
+    <ant:copy todir="${maven.dist.dir.bin}">
+      <ant:fileset dir="${maven.dist.scm.dir}">
         <ant:include name="README.txt"/>
         <ant:include name="LICENSE*"/>
       </ant:fileset>
     </ant:copy>
 
-    <!-- Copy Jars -->
-    <ant:copy todir="${maven.dist.bin.assembly.dir}">
-      <ant:fileset dir="${maven.build.dir}">
+       <!-- Copy jar and javadoc artifact -->
+    <j:set var="mavenRepoLocal" value='${context.getVariable("maven.repo.local")}'/>
+    <ant:copy todir="${maven.dist.dir.bin}">
+      <ant:fileset dir="${mavenRepoLocal}/${pom.groupId}">
         <ant:include name="${maven.final.name}.jar"/>
+        <ant:include name="${maven.final.name}_javadoc.jar"/>
       </ant:fileset>
     </ant:copy>
 
-    <!-- Copy documentation -->
-    <j:set var="docsDest" value="${maven.docs.dest}"/>
-    <ant:copy todir="${maven.dist.bin.assembly.dir}/docs">
-      <ant:fileset dir="${docsDest}">
-        <ant:include name="**"/>
-      </ant:fileset>
-    </ant:copy>
+    <!-- Copy dependencies -->
+    <util:tokenize var="categories" delim="," 
trim="true">${maven.dist.dependencies.categories}</util:tokenize>
+    <j:forEach var="category" items="${categories}">
+               <util:tokenize var="pair" delim=":" 
trim="true">${category}</util:tokenize>
+               <j:set var="name" value="${pair.get(0)}"/>
+               <j:set var="path" value="${pair.get(1)}"/>
+               <archive:copy-dependencies category="${name}" 
todir="${maven.dist.dir.bin}/${path}"/>
+    </j:forEach> 
   </goal>
 
   <goal
     name="dist:prepare-src-filesystem"
+    prereqs="dist:build-setup"
     description="Builds the source distribution file system.">
 
-    <!-- S O U R C E  D I S T R I B U T I O N -->
-
-    <ant:delete dir="${maven.dist.src.assembly.dir}" />
-    <ant:mkdir dir="${maven.dist.src.assembly.dir}" />
-
     <ant:echo>
       +-------------------------------------------------------+
       | C R E A T I N G  S O U R C E  D I S T R I B U T I O N |
       +-------------------------------------------------------+
     </ant:echo>
 
-    <ant:copy todir="${maven.dist.src.assembly.dir}">
-      <ant:fileset dir=".">
-        <ant:include name="README.txt"/>
-        <ant:include name="LICENSE*"/>
-        <ant:include name="project.properties"/>
-        <ant:include name="maven.xml"/>
-        <ant:include name="project.xml"/>
-      </ant:fileset>
-    </ant:copy>
-
     <ant:available property="maven.dist.build.xml.avail"
-               file="${basedir}/build.xml"/>
+               file="${maven.dist.scm.dir}/build.xml"/>
 
-    <j:choose>
-      <j:when test="${maven.dist.build.xml.avail}">
-        <ant:copy todir="${maven.dist.src.assembly.dir}" file="${basedir}/build.xml"/>
-      </j:when>
-      <j:otherwise>
-        <j:if test="${sourcesPresent == 'true'}">
-          <attainGoal name="ant:generate-build"/>
-          <ant:move 
-            file="${basedir}/build.xml"
-            tofile="${maven.dist.src.assembly.dir}/build.xml"/>
-        </j:if>
-      </j:otherwise>
-    </j:choose>
-
-    <!-- Copy Source -->
-    <util:available file="${maven.src.dir}">
-      <ant:copy todir="${maven.dist.src.assembly.dir}/src">
-        <ant:fileset dir="${maven.src.dir}" />
-      </ant:copy>
-    </util:available>
-  </goal>
 
-  <goal name="dist"
-    prereqs="dist:build"
-    description="Build a complete distribution.">
-  </goal>
-        
-  <goal
-    name="dist:build"
-    prereqs="dist:build-bin,dist:build-src"
-    description="Build a complete distribution.">
-  </goal>
+    <j:if test="${maven.dist.build.xml.avail != 'true'}">
+      <!-- ant:generate-build is broken -->
+         <!--maven:maven
+       descriptor="${maven.dist.scm.dir}/project.xml"
+       goals="ant:generate-build"
+       ignoreFailures="false"/-->
+    </j:if>
 
-  <goal
-    name="dist:build-setup"
-    description="Set up directories for a distribution build">
-    <ant:delete dir="${maven.dist.dir}"/>
-    <ant:mkdir dir="${maven.dist.dir}"/>
   </goal>
 
   <goal
     name="dist:build-bin"
-    prereqs="dist:build-setup,dist:prepare-bin-filesystem"
+    prereqs="dist:prepare-bin-filesystem"
     description="Build the binary distribution.">
+       <echo>Building binary distribution ${maven.dist.name.bin}</echo>
 
-    <!-- Create a tar.gz file -->
-    <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
-      <ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
-    </ant:tar>
-
-    <ant:gzip 
-      zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
-      src="${maven.dist.dir}/${maven.final.name}.tar"
-    />
-    
-    <ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
-
-    <!-- Create a zip file -->
-    <ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
-      <ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
-    </ant:zip>
+    <archive:gzip name="${maven.dist.name.bin}" dir="${maven.dist.dir.bin}"/>
+    <archive:install name="${maven.dist.name.bin}" type="gzip"/>
+    <archive:zip name="${maven.dist.name.bin}" dir="${maven.dist.dir.bin}"/>
+    <archive:install name="${maven.dist.name.bin}" type="zip"/>
   </goal>
 
   <goal
     name="dist:build-src"
-    prereqs="dist:build-setup,dist:prepare-src-filesystem"
-    description="Build the source distribution.">
+    prereqs="dist:prepare-src-filesystem"
+    description="Build the source distribution from filesystem">
+       <echo>Building source distribution ${maven.dist.name.src}</echo>
  
-    <!-- Create a tar.gz file -->
-    <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
-      <ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
-    </ant:tar>
-
-    <ant:gzip 
-      zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz" 
-      src="${maven.dist.dir}/${maven.final.name}-src.tar"
-    />
-    
-    <ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
+    <archive:gzip name="${maven.dist.name.src}" dir="${maven.dist.scm.dir}"/>
+    <archive:install name="${maven.dist.name.src}" type="gzip"/>
+    <archive:zip name="${maven.dist.name.src}" dir="${maven.dist.scm.dir}"/>
+    <archive:install name="${maven.dist.name.src}" type="zip"/>
+  </goal>
+  
+  
+  <goal
+    name="dist:build"
+    prereqs="dist:build-bin,dist:build-src"
+    description="Build a complete distribution.">
+  </goal>
 
-    <!-- Create a zip file -->
-    <ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
-      <ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
-    </ant:zip>
 
+  <goal name="dist"
+    prereqs="dist:build"
+    description="Build a complete distribution.">
   </goal>
+        
 
   <!-- ================================================================== -->
   <!-- D E P L O Y  D I S T R I B U T I O N                               -->
   <!-- ================================================================== -->
 
-  <goal name="dist:deploy" description="Deploy a distribution">
+  <goal name="dist:deploy" description="Deploy distributions">
 
     <maven:user-check user="${maven.username}"/>
 
@@ -202,33 +247,23 @@
   </goal>
 
 
-  <goal name="dist:deploy-bin" description="Deploy a binary distribution">
+  <goal name="dist:deploy-bin" 
+        prereqs="dist:build-bin" 
+        description="Deploy binary distributions">
 
     <maven:user-check user="${maven.username}"/>
-
-    <attainGoal name="dist:build-bin"/>
-
-    <deploy:artifact
-      artifact="${maven.dist.dir}/${maven.final.name}.tar.gz"
-      type="distributions"
-      assureDirectoryCommand="mkdir -p"
-      siteCommand="cd @deployDirectory@;chmod -R g+u *;"
-    />
+    <archive:deploy name="${maven.dist.name.bin}" type="gzip"/>
+    <archive:deploy name="${maven.dist.name.bin}" type="zip"/>
 
   </goal>
 
-  <goal name="dist:deploy-src" description="Deploy a source distribution">
+  <goal name="dist:deploy-src" 
+        prereqs="dist:build-src" 
+        description="Deploy a source distribution">
 
     <maven:user-check user="${maven.username}"/>
-
-    <attainGoal name="dist:build-src"/>
-
-    <deploy:artifact
-      artifact="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
-      type="distributions"
-      assureDirectoryCommand="mkdir -p"
-      siteCommand="cd @deployDirectory@;chmod -R g+u *;"
-    />
+    <archive:deploy name="${maven.dist.name.src}" type="gzip"/>
+    <archive:deploy name="${maven.dist.name.src}" type="zip"/>
 
   </goal>
 
@@ -236,10 +271,10 @@
   <!-- D E P L O Y  S N A P S H O T  D I S T R I B U T I O N              -->
   <!-- ================================================================== -->
 
-  <maven:snapshot project="${pom}"/>    
 
   <goal name="dist:deploy-snapshot" description="Deploy a snapshot distribution">
     
+    <maven:snapshot project="${pom}"/>    
     <maven:user-check user="${maven.username}"/>
     
     <j:set var="maven.final.name" value="${snapshotSignature}"/>
Index: plugin.properties
===================================================================
RCS file: /home/cvspublic/maven/src/plugins-build/dist/plugin.properties,v
retrieving revision 1.4
diff -u -r1.4 plugin.properties
--- plugin.properties   16 Oct 2003 08:11:03 -0000      1.4
+++ plugin.properties   21 Oct 2003 08:21:19 -0000
@@ -10,3 +10,10 @@
 maven.dist.bin.assembly.dir=${maven.dist.assembly.dir}/bin/${maven.final.name}
 maven.dist.src.assembly.dir=${maven.dist.assembly.dir}/src/${maven.final.name}
 maven.dist.dir=${maven.build.dir}/distributions
+
+maven.dist.name.bin=${maven.final.name}
+maven.dist.name.src=${maven.final.name}-src
+maven.dist.dir.bin=${maven.build.dir}/${maven.dist.name.bin}
+maven.dist.dependencies.categories=shared:lib
+maven.dist.scm.dir=${maven.scm.checkout.dir}/${maven.scm.cvs.module}
+

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

Reply via email to