dion        2003/03/12 16:31:30

  Modified:    src/plugins-build/repository plugin.jelly
  Log:
  Update exec tag to include body if set
  
  Revision  Changes    Path
  1.10      +48 -15    jakarta-turbine-maven/src/plugins-build/repository/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/repository/plugin.jelly,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- plugin.jelly      12 Mar 2003 16:47:02 -0000      1.9
  +++ plugin.jelly      13 Mar 2003 00:31:30 -0000      1.10
  @@ -14,6 +14,11 @@
        ! @param command the command to execute
        !-->
       <define:tag name="exec">
  +       <!-- allow either command attribute or use body of exec tag -->
  +       <j:if test="${empty(command)}">
  +         <j:set var="command" trim="yes"><define:invokeBody/></j:set>
  +       </j:if>
  +       <echo>Executing '${command}' remotely</echo>
          <exec dir="." executable="${maven.ssh.executable}">
            <arg line='${maven.repo.central} -l ${maven.username} "${command}"'/>
          </exec>
  @@ -161,7 +166,6 @@
            <repository:urlFileName url="${file}" var="fileName"/>
            <j:set var="command" value="cd ${directory}"/>
            <j:set var="command" value="${command};ln -s ${fileName} 
${group}.license"/>
  -         <echo>Executing '${command}' remotely</echo>
            <repository:exec command="${command}" />
          </j:if>
        </x:forEach>
  @@ -214,7 +218,6 @@
       <j:set var="command" value="${command};chmod g+ws ${groupId}"/>
       <j:set var="command" value="${command};chmod -R g+w ${groupId}"/>
       <j:set var="command" value="${command};chmod -R a+r ${groupId}"/>
  -    <echo>executing '${command}' remotely</echo>
       <repository:exec command="${command}" />
     </goal>
   
  @@ -226,13 +229,15 @@
       </j:if>
       <j:set var="command" value="cd ${maven.repo.central.directory}"/>
       <j:set var="command" value="${command};rm -rf ${groupId}" />
  -    <echo>executing '${command}' remotely</echo>
       <repository:exec command="${command}" />
     </goal>
     
  -  <!-- this is pretty much a copy of whats in jar:deploy-snapshot -->
  -  <goal name="repository:deploy-snapshot-jar"
  -    description="deploy a snapshot jar, specified by groupId and artifact, to the 
repository">
  +  <!-- 
  +   ! this is pretty much a copy of whats in jar:deploy-snapshot, except
  +   ! this uses any old file for copying, not just the output of the project
  +   !-->
  +  <goal name="repository:copy-snapshot-jar"
  +    description="copy a snapshot jar, specified by groupId and artifact, to the 
repository">
       
       <j:if test="${empty(artifact)}">
         <fail>artifact must be specified</fail>
  @@ -256,15 +261,43 @@
       <u:file name="${artifact}" var="artifactFile"/>
       <j:set var="artifactName">${artifactFile.canonicalFile.name}</j:set>
   
  -    <j:set var="command" value="cd ${directory}"/>
  -    <j:set var="command" value="${command};md5sum ${artifactName} | sed 's/ .*$//' 
> ${artifactName}.md5" />
  -    <j:set var="command" value="${command};ln -sf ${artifactName} 
${artifactId}-SNAPSHOT.jar"/>
  -    <j:set var="command" value="${command};ln -sf ${artifactName}.md5 
${artifactId}-SNAPSHOT.jar.md5"/>
  -    <j:set var="command" value="${command};echo ${snapshotVersion} > 
${artifactId}-snapshot-version"/>
  -    <j:set var="command" value="${command};chmod g+w *"/>
  -    <j:set var="command" value="${command};chgrp ${maven.repository.group} *"/>
  -    <echo>Executing '${command}' remotely</echo>
  -    <repository:exec command="${command}" />
  +    <repository:exec>
  +      cd ${directory};
  +      md5sum ${artifactName} | sed 's/ .*$//' > ${artifactName}.md5;
  +      ln -sf ${artifactName} ${artifactId}-SNAPSHOT.jar;
  +      ln -sf ${artifactName}.md5 ${artifactId}-SNAPSHOT.jar.md5;
  +      echo ${snapshotVersion} > ${artifactId}-snapshot-version;
  +      chgrp ${maven.repository.group} *;
  +      chmod g+w *;
  +      chmod a+r *;
  +    </repository:exec>
  +  </goal>
  +
  +  <!-- 
  +   ! this uses any old file for copying
  +   !-->
  +  <goal name="repository:copy-jar"
  +    description="copy a jar, specified by groupId and artifact, to the repository">
  +    <j:if test="${empty(artifact)}">
  +      <fail>artifact must be specified</fail>
  +    </j:if>
  +    <j:if test="${empty(groupId)}">
  +      <fail>groupId must be specified</fail>
  +    </j:if>
  +
  +    <j:set var="directory" value="${maven.repo.central.directory}/${groupId}/jars/" 
/>
  +    <repository:copy from="${artifact}" toFileOrDir="${directory}" />
  +
  +    <u:file name="${artifact}" var="artifactFile"/>
  +    <j:set var="artifactName">${artifactFile.canonicalFile.name}</j:set>
  +
  +    <repository:exec>
  +      cd ${directory};
  +      md5sum ${artifactName} | sed 's/ .*$//' > ${artifactName}.md5;
  +      chgrp ${maven.repository.group};
  +      chmod g+w;
  +      chmod a+r
  +    </repository:exec>
     </goal>
     
   </project>
  
  
  

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

Reply via email to