You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2003/03/18 07:40:01 UTC

cvs commit: maven/src/plugins-build/repository plugin.jelly

dion        2003/03/17 22:40:00

  Modified:    src/plugins-build/repository plugin.jelly
  Log:
  bad attempt at getting file properties remotely
  
  Revision  Changes    Path
  1.17      +61 -6     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- plugin.jelly	17 Mar 2003 13:21:26 -0000	1.16
  +++ plugin.jelly	18 Mar 2003 06:39:59 -0000	1.17
  @@ -81,6 +81,32 @@
       </define:tag>
   
       <!--
  +     ! test if a file exists in the remote repo
  +     ! @param name the file to check
  +     ! @param var the variable to set to true or false
  +     !-->
  +    <define:tag name="fileExists">
  +       <exec dir="." executable="${maven.ssh.executable}" resultproperty="result">
  +         <arg line='-l ${maven.username} ${maven.repo.central} "test -f ${name}"'/>
  +       </exec>
  +       <ant:echo>Result from ssh is '${result}'</ant:echo>
  +       <j:set var="${var}" scope="parent" value="${result == '0'}"/>
  +    </define:tag>
  +
  +    <!--
  +     ! test if a directory exists in the remote repo
  +     ! @param name the directory to check
  +     ! @param var the variable to set to true or false
  +     !-->
  +    <define:tag name="directoryExists">
  +       <exec dir="." executable="${maven.ssh.executable}" resultproperty="result">
  +         <arg line='-l ${maven.username} ${maven.repo.central} "test -d ${name}"'/>
  +       </exec>
  +       <ant:echo>Result from ssh is '${result}'</ant:echo>
  +       <j:set var="${var}" scope="parent" value="${result == '0'}"/>
  +    </define:tag>
  +
  +    <!--
        ! place the file name portion of a url into a variable
        ! @param url the URL to process
        ! @param var the variable to place the filename into
  @@ -134,15 +160,26 @@
        ! run ssh to create each <groupId>/licenses directory.
        !-->
       <repository:required name="directoryName" value="${directoryName}" />
  -
       <repository:parseAudit var="audit"/>
  +    <!-- see if the user specified a starting project -->
  +    <j:set var="processing" value="true" />
  +    <j:if test="${!empty(startProject)}">
  +      <j:set var="processing" value="false"/>
  +    </j:if>
       
       <x:forEach var="group" select="$audit/licenses/project/groupId">
  -      <j:set var="directory" 
  -        value="${maven.repo.central.directory}/${group.text}/${directoryName}" />
  -      <echo>Ensuring directory '${directory}' exists</echo>
  -      <repository:exec 
  -        command="mkdir -p ${directory};chmod g+ws ${directory};chgrp ${maven.repository.group} ${directory};" />
  +      <echo>Processing project ${group.text}</echo>
  +      <j:if test="${!processing and group.text.equals(startProject)}">
  +        <j:set var="processing" value="true"/>
  +      </j:if>
  +
  +      <j:if test="${processing}">
  +        <j:set var="directory" 
  +          value="${maven.repo.central.directory}/${group.text}/${directoryName}" />
  +        <echo>Ensuring directory '${directory}' exists</echo>
  +        <repository:exec 
  +          command="mkdir -p ${directory};chmod g+ws ${directory};chgrp ${maven.repository.group} ${directory};" />
  +      </j:if>
       </x:forEach>
     </goal>
     
  @@ -257,6 +294,24 @@
        </x:forEach>
     </goal>
   
  +  <goal name="repository:audit-copy-poms" 
  +    description="">
  +    
  +    <repository:directoryExists var="central"
  +      name="${maven.repo.central.directory}" />
  +    <ant:echo>central = '${central}'</ant:echo>
  +    <repository:fileExists var="ant151"
  +      name="${maven.repo.central.directory}/ant/jars/ant-1.5.1.jar" />
  +    <ant:echo>ant151 = '${ant151}'</ant:echo>
  +    <repository:directoryExists var="badcentral"
  +      name="${maven.repo.central.directory}/grunk" />
  +    <ant:echo>badcentral = '${badcentral}'</ant:echo>
  +    <repository:fileExists var="ant171"
  +      name="${maven.repo.central.directory}/ant/jars/ant-1.7.1.jar" />
  +    <ant:echo>ant171 = '${ant171}'</ant:echo>
  +
  +  </goal>
  +   
     <goal name="repository:audit-generate-poms"
       description="generate a pom for all the groupId's in the audit file">
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org