brett       2004/03/10 03:06:50

  Modified:    .        Tag: MAVEN-1_0-BRANCH maven.xml
  Log:
  move install_repo generation from the bootstrap to the installer generation
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.97.2.17 +58 -4     maven/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven/maven.xml,v
  retrieving revision 1.97.2.16
  retrieving revision 1.97.2.17
  diff -u -r1.97.2.16 -r1.97.2.17
  --- maven.xml 5 Mar 2004 05:54:37 -0000       1.97.2.16
  +++ maven.xml 10 Mar 2004 11:06:50 -0000      1.97.2.17
  @@ -180,6 +180,13 @@
         </j:if>
       </j:forEach>
   
  +    <attainGoal name="maven:generate-install-scripts" />
  +    <ant:copy todir="${installerDir}/bin" 
file="${maven.build.dir}/install_repo.bat" />
  +    <ant:copy todir="${installerDir}/bin" file="${maven.build.dir}/install_repo.sh" 
/>
  +
  +    <ant:fixcrlf srcdir="${installerDir}" eol="crlf" includes="**/*.bat" />
  +    <ant:fixcrlf srcdir="${installerDir}" eol="lf" includes="**/*.sh,**/maven" />
  +
       <!-- TODO: check if this works when run by scm:perform-release -->
   
       <maven:reactor
  @@ -210,10 +217,6 @@
         </j:if>
       </j:forEach>
   
  -    <!-- TODO: install_repo script -->
  -
  -    <ant:fixcrlf srcdir="${installerDir}" eol="crlf" includes="**/*.bat" />
  -
       <ant:tar longfile="gnu" tarfile="${maven.build.dir}/installer/${tag}.tar">
         <ant:tarfileset dir="${installerDir}">
           <ant:exclude name="**/maven"/>
  @@ -243,6 +246,57 @@
       </ant:zip>
   
       <!-- TODO: nsis installer -->
  +  </goal>
  +
  +  <goal name="maven:generate-install-scripts">
  +    <j:file name="${maven.build.dir}/install_repo.sh" omitXmlDeclaration="true">
  +<j:whitespace>#!/bin/sh
  +REPO_DIR=$1
  +if [ -z "$REPO_DIR" ]; then echo "usage: $0 [repository directory]"; exit; fi
  +if [ -z "$MAVEN_HOME" ]; then echo "MAVEN_HOME must be set"; exit; fi
  +</j:whitespace>
  +<j:forEach var="lib" items="${pom.artifacts}">
  +  <j:set var="dep" value="${lib.dependency}" />
  +  <j:set var="libdir" value="lib" />
  +  <j:if test="${dep.getProperty('endorsed')=='true'}">
  +    <j:set var="libdir" value="lib/endorsed" />
  +  </j:if>
  +  <j:if test="${dep.type=='jar'}">
  +<j:whitespace>if [ ! -f 
$$REPO_DIR/${dep.groupId}/jars/${dep.artifactId}-${dep.version}.jar ]; then 
  +  mkdir -p $$REPO_DIR/${dep.groupId}/jars
  +  cp $$MAVEN_HOME/${libdir}/${dep.artifactId}-${dep.version}.jar 
$$REPO_DIR/${dep.groupId}/jars
  +fi
  +</j:whitespace>
  +  </j:if>
  +</j:forEach>
  +    </j:file>
  +
  +    <j:file name="${maven.build.dir}/install_repo.bat" omitXmlDeclaration="true">
  +      <j:whitespace>@ECHO OFF
  +if "%1"=="" goto usage
  +set REPO_DIR=%1
  +if "%MAVEN_HOME%"=="" goto MHusage
  +</j:whitespace>
  +<j:forEach var="lib" items="${pom.artifacts}">
  +  <j:set var="dep" value="${lib.dependency}" />
  +  <j:set var="libdir" value="lib" />
  +  <j:if test="${dep.getProperty('endorsed')=='true'}">
  +    <j:set var="libdir" value="lib\endorsed" />
  +  </j:if>
  +  <j:if test="${dep.type=='jar'}">
  +<j:whitespace>if not exist %REPO_DIR%\${dep.groupId}\jars mkdir 
%REPO_DIR%\${dep.groupId}\jars
  +if not exist "%REPO_DIR%\${dep.groupId}\jars\${dep.artifactId}-${dep.version}.jar" 
copy "%MAVEN_HOME%\${libdir}\${dep.artifactId}-${dep.version}.jar" 
"%REPO_DIR%\${dep.groupId}\jars"
  +</j:whitespace>
  +  </j:if>
  +</j:forEach>
  +<j:whitespace>goto end
  +:MHusage
  +echo MAVEN_HOME must be set
  +:usage
  +echo usage: %0 [repository directory]
  +:end
  +</j:whitespace>
  +    </j:file>
     </goal>
   </project>
   
  
  
  

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

Reply via email to