dion        2003/07/09 00:21:03

  Modified:    src/plugins-build/repository plugin.jelly
  Log:
  Use param-check tag for validation
  
  Revision  Changes    Path
  1.21      +18 -25    maven/src/plugins-build/repository/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/repository/plugin.jelly,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- plugin.jelly      1 Apr 2003 00:49:17 -0000       1.20
  +++ plugin.jelly      9 Jul 2003 07:21:03 -0000       1.21
  @@ -5,6 +5,7 @@
     xmlns:define="jelly:define"
     xmlns:dummy="dummy"
     xmlns:j="jelly:core"
  +  xmlns:m="maven"
     xmlns:repository="repository"
     xmlns:u="jelly:util"
     xmlns:x="jelly:xml">
  @@ -105,19 +106,6 @@
         <j:set var="${var}" value="${snapAndJar[0]}.${snapAndJar[1]}" scope="parent"/>
       </define:tag>
             
  -  <!--
  -   ! @name     the name of the value being checked
  -   ! @value    the value that musn't be empty
  -   ! @message  the message to be displayed when value is empty
  -   !-->
  -    <define:tag name="required">
  -      <j:if test="${empty(message)}">
  -        <j:set var="message">'${name}' must be specified</j:set>
  -      </j:if>
  -      <j:if test="${empty(value)}">
  -        <fail>${message}</fail>
  -      </j:if>
  -    </define:tag>
     </define:taglib>
   
     <goal name="repository:audit-create-licenses"
  @@ -133,7 +121,7 @@
        ! parse audit file
        ! run ssh to create each <groupId>/licenses directory.
        !-->
  -    <repository:required name="directoryName" value="${directoryName}" />
  +    <m:param-check value="${directoryName}" fail="true" message="'directoryName' 
must be specified"/>
       <repository:parseAudit var="audit"/>
       <!-- see if the user specified a starting project -->
       <j:set var="processing" value="true" />
  @@ -222,7 +210,7 @@
     <!-- expects groupId to be set -->
     <goal name="repository:audit-copy-license"
       description="copy the license for the specified groupId to the repository">
  -    <repository:required name="groupId" value="${groupId}" />
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
   
       <!--
        ! parse audit file
  @@ -250,7 +238,8 @@
     <goal name="repository:audit-generate-pom"
       description="generate a pom for the groupId provided, based on the audit file">
   
  -    <repository:required name="groupId" value="${groupId}" />
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
  +
       <repository:parseAudit var="audit"/>
        <x:forEach var="project" select="$audit/licenses/project">
          <j:set var="group"><x:expr select="$project/groupId"/></j:set>
  @@ -289,7 +278,9 @@
     <!-- expects groupId to be set -->
     <goal name="repository:create-project"
       description="create a project, specified by groupId, in the repository">
  -    <repository:required name="groupId" value="${groupId}" />
  +
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
  +
       <repository:exec>
         cd ${maven.repo.central.directory};
         mkdir ${groupId};
  @@ -308,7 +299,8 @@
     <goal name="repository:delete-project"
       description="delete a project, specified by groupId, in the repository">
       
  -    <repository:required name="groupId" value="${groupId}" />
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
  +
       <repository:exec>
         cd ${maven.repo.central.directory};
         rm -rf ${groupId};
  @@ -322,8 +314,9 @@
     <goal name="repository:copy-snapshot-jar"
       description="copy a snapshot jar, specified by groupId and artifact, to the 
repository">
       
  -    <repository:required name="artifact" value="${artifact}" />
  -    <repository:required name="groupId" value="${groupId}" />
  +    <m:param-check value="${artifact}" fail="true" message="'artifact' must be 
specified"/>
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
  +
       <j:if test="${empty(artifactId)}">
         <j:set var="artifactId">${groupId}</j:set>
       </j:if>
  @@ -355,8 +348,8 @@
     <goal name="repository:copy-jar"
       description="copy a jar, specified by groupId and artifact, to the repository">
   
  -    <repository:required name="artifact" value="${artifact}" />
  -    <repository:required name="groupId" value="${groupId}" />
  +    <m:param-check value="${artifact}" fail="true" message="'artifact' must be 
specified"/>
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
   
       <j:set var="type" value="jar" />
       
  @@ -369,9 +362,9 @@
     <goal name="repository:copy-artifact"
       description="copy an artifact, specified by groupId, artifact and type, to the 
repository">
   
  -    <repository:required name="artifact" value="${artifact}" />
  -    <repository:required name="groupId" value="${groupId}" />
  -    <repository:required name="type" value="${type}" />
  +    <m:param-check value="${artifact}" fail="true" message="'artifact' must be 
specified"/>
  +    <m:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
  +    <m:param-check value="${type}" fail="true" message="'type' must be specified" />
   
       <j:set var="directory" 
value="${maven.repo.central.directory}/${groupId}/${type}s/" />
       <repository:exec command="mkdir -p ${directory}; chmod g+ws ${directory}; chgrp 
${maven.repository.group} ${directory}"/>
  
  
  

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

Reply via email to