maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject cvs commit: maven/src/plugins-build/eclipse plugin.jelly
Date Fri, 09 May 2003 08:42:21 GMT
michal      2003/05/09 01:42:21

  Modified:    src/plugins-build/eclipse/xdocs changes.xml properties.xml
               src/plugins-build/eclipse plugin.jelly
  Log:
  Smarter generation of .classpath file.
  ${basedir} prefix is cut off if present in any path.
  Default locations of source and destination folder are used instead 
  of hardcoded paths like 'target/classes'.
  
  Revision  Changes    Path
  1.3       +6 -0      maven/src/plugins-build/eclipse/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/eclipse/xdocs/changes.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- changes.xml	8 Apr 2003 12:19:25 -0000	1.2
  +++ changes.xml	9 May 2003 08:42:21 -0000	1.3
  @@ -7,6 +7,12 @@
   
     <body>
       <release version="1.3" date="In CVS">
  +      <action dev="michal" type="add">
  +        Smarter generation of .classpath file.
  +        ${basedir} prefix is cut off if present in any path.
  +        Default Maven location of source and destination folder
  +        are used.
  +      </action>      
         <action dev="evenisse" type="add">
           Added dependency functionality between projects
         </action>
  
  
  
  1.5       +8 -1      maven/src/plugins-build/eclipse/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/eclipse/xdocs/properties.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- properties.xml	6 Mar 2003 12:57:30 -0000	1.4
  +++ properties.xml	9 May 2003 08:42:21 -0000	1.5
  @@ -40,12 +40,19 @@
           </tr>
           <tr>
             <td>maven.eclipse.output.dir</td>
  -          <td>Yes (default=target/classes)</td>
  +          <td>Yes (default=${maven.build.dest)</td>
             <td>
   			The directory to which Eclipse should output its classes.
   			By default this is the same directory as Maven generates its code
   			however this can be changed so that <code>maven clean</code>
   			does not interfere with Eclipse's build.
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.eclipse.test.output.dir</td>
  +          <td>Yes (default=${maven.test.dest} defined in test plugin)</td>
  +          <td>
  +			The directory to which Eclipse should output its test classes.
             </td>
           </tr>
         </table>
  
  
  
  1.15      +69 -23    maven/src/plugins-build/eclipse/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/eclipse/plugin.jelly,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- plugin.jelly	7 May 2003 17:54:22 -0000	1.14
  +++ plugin.jelly	9 May 2003 08:42:21 -0000	1.15
  @@ -48,34 +48,49 @@
       </j:file>
     </goal>
   	
  +
  +  <!--==================================================================-->
  +  <!-- Generate Eclipse  .classpath file                   -->
  +  <!--==================================================================-->    
     <goal name="eclipse:generate-classpath"
       description="Generate Eclipse .classpath file">
     
  -    <ant:echo>Creating ${basedir}/.classpath ...</ant:echo>
  -    
  -    <j:set var="outputDir" value="${maven.eclipse.output.dir}"/>
  -    <j:if test="${empty outputDir}">
  -      <j:set var="outputDir" value="target/classes"/>
  -    </j:if>
  +    <ant:echo>Creating ${basedir}/.classpath ...</ant:echo>               

       
       <j:file name="${basedir}/.classpath" prettyPrint="true" xmlns="dummy">
  -      <classpath>
  -
  -      <j:if test="${sourcesPresent}">
  -        <classpathentry kind="src" path="${pom.build.sourceDirectory}"/>
  -      </j:if>
  -
  -      <j:if test="${unitTestSourcesPresent}">
  -        <classpathentry kind="src" path="${pom.build.unitTestSourceDirectory}"/>
  -        <!-- Here are the rules:
  -             If the project has maven.eclipse.junit property, add that ver of junit
  -             If the project has maven.eclipse.junit property and it is empty, don't add
junit
  -             If the project has junit dep, use that.
  -             Use the test plugin version
  -          -->
  -        <j:set var="verX" value="${maven.eclipse.junit}X"/>
  +      <classpath>            
  +        <j:if test="${sourcesPresent}">
  +          <j:set var="srcDir" value="${pom.build.sourceDirectory}"/>
  +          <j:if test="${ srcDir.startsWith( basedir ) }">
  +             <ant:echo>Cutting of basedir from sourceDirectory</ant:echo>
  +             <j:set var="srcDir" value="${srcDir.substring(basedir.length())}"/>
            
  +             <!-- 
  +               cut off also slash or backslash from basedir. 
  +               Is there a way to make it in one step in Jelly?
  +              -->
  +             <j:set var="srcDir" value="${srcDir.substring(1)}"/>             
  +          </j:if>
  +          <classpathentry kind="src" path="${srcDir}"/>
  +        </j:if>
  +      
  +        <j:if test="${unitTestSourcesPresent}">
  +          <j:set var="testSrcDir" value="${pom.build.unitTestSourceDirectory}"/>
  +          <j:if test="${ testSrcDir.startsWith( basedir ) }">
  +             <ant:echo>Cutting of basedir from testSourceDirectory</ant:echo>
  +             <j:set var="testSrcDir" value="${testSrcDir.substring(basedir.length())}"/>
            
  +             <!-- cut off also slash or backslash -->
  +             <j:set var="testSrcDir" value="${testSrcDir.substring(1)}"/>       
     
  +          </j:if>
  +          <classpathentry kind="src" path="${testSrcDir}"/>
  +         <!-- Here are the rules:
  +              If the project has maven.eclipse.junit property, add that ver of junit
  +              If the project has maven.eclipse.junit property and it is empty, don't add
junit
  +              If the project has junit dep, use that.
  +              Use the test plugin version
  +           -->
  +         <j:set var="verX" value="${maven.eclipse.junit}X"/>
   
  -        <j:set var="depVersion">${pom.getPluginContext('maven-test-plugin').getVariable('plugin').getDependency('junit').getVersion()}</j:set>
  +         <j:set var="depVersion">${pom.getPluginContext('maven-test-plugin').getVariable('plugin').getDependency('junit').getVersion()}</j:set>
         
           <j:if test="${pom.getDependency('junit') != null}">
             <j:set var="depVersion" value="${pom.getDependency('junit').getVersion()}"/>
  @@ -112,8 +127,39 @@
           </j:forEach>
           
         <!-- add the unit test build directory so that any files generated via Maven are
available -->  
  -      <classpathentry kind="lib" path="target/test-classes"/>  
         
  +      
  +      <j:if test="${unitTestSourcesPresent}">
  +        <j:set var="testOutputDir" value="${maven.eclipse.test.output.dir}"/>
  +          <j:if test="${empty testOutputDir}">
  +            <j:set var="testOutputDir" 
  +                   value="${pom.getPluginContext('maven-test-plugin').getVariable('maven.test.dest')}"/>
     
  +          </j:if>
  +          <j:if test="${ testOutputDir.startsWith( basedir ) }">
  +            <ant:echo>Cutting of basedir from testOutputDir</ant:echo>
  +            <j:set var="testOutputDir" value="${testOutputDir.substring(basedir.length())}"/>
            
  +            <!-- 
  +              cut off also slash or backslash from basedir. 
  +              Is there a way to make it in one step in Jelly?
  +            -->
  +            <j:set var="testOutputDir" value="${testOutputDir.substring(1)}"/>  
          
  +          </j:if>  
  +          <classpathentry kind="lib" path="{$testOutputDir}"/>  
  +      </j:if>
  +      
  +      <j:set var="outputDir" value="${maven.eclipse.output.dir}"/>
  +        <j:if test="${empty outputDir}">
  +          <j:set var="outputDir" value="${maven.build.dest}"/>      
  +         </j:if>
  +         <j:if test="${ outputDir.startsWith( basedir ) }">
  +           <ant:echo>Cutting of basedir from outputDir</ant:echo>
  +           <j:set var="outputDir" value="${outputDir.substring(basedir.length())}"/>
            
  +           <!-- 
  +             cut off also slash or backslash from basedir. 
  +            Is there a way to make it in one step in Jelly?
  +           -->
  +           <j:set var="outputDir" value="${outputDir.substring(1)}"/>           
 
  +        </j:if>            
         <classpathentry kind="output" path="${outputDir}"/>
       </classpath>
     </j:file>  
  
  
  

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


Mime
View raw message