maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Patterson" <doug.patter...@gmx.net>
Subject [PATCH] excluding attribute for Eclipse plugin
Date Mon, 02 Jun 2003 21:51:41 GMT
The Eclipse plugin creates a .classpath file with tags like:

<classpathentry kind="src" path="src/java">

Eclipse also supports an excluding attribute that filters out any files
matching the supplied pattern. I tweaked plugin.jelly (patch below) to check
for a maven.eclipse.exclude property in project.properties and modify
kind="src" entries accordingly. For example:

maven.eclipse.exclude=**/.svn/*    # Stop Eclipse complaining about Subversion files

Hope this is useful to someone!

Doug

Index: plugin.jelly
===================================================================
RCS file: /home/cvspublic/maven/src/plugins-build/eclipse/plugin.jelly,v
retrieving revision 1.16
diff -u -r1.16 plugin.jelly
--- plugin.jelly 9 May 2003 14:03:58 -0000 1.16
+++ plugin.jelly 2 Jun 2003 20:52:13 -0000
@@ -56,7 +56,10 @@
     description="Generate Eclipse .classpath file">

     <ant:echo>Creating ${basedir}/.classpath ...</ant:echo>
-
+
+    <!-- Check for maven.eclipse.exclude property -->
+    <j:set var="excludeX" value="${maven.eclipse.exclude}X"/>
+
     <j:file name="${basedir}/.classpath" prettyPrint="true" xmlns="dummy">
       <classpath>
         <j:if test="${sourcesPresent}">
@@ -70,7 +73,14 @@
               -->
              <j:set var="srcDir" value="${srcDir.substring(1)}"/>
           </j:if>
-          <classpathentry kind="src" path="${srcDir}"/>
+          <j:choose>
+            <j:when test="${excludeX != 'X'}">
+              <classpathentry kind="src" excluding="${maven.eclipse.exclude}" path="${srcDir}"/>
+            </j:when>
+            <j:otherwise>
+              <classpathentry kind="src" path="${srcDir}"/>
+            </j:otherwise>
+          </j:choose>
         </j:if>

         <j:if test="${unitTestSourcesPresent}">
@@ -82,7 +92,14 @@
              <!-- cut off also slash or backslash -->
              <j:set var="testSrcDir" value="${testSrcDir.substring(1)}"/>
           </j:if>
-          <classpathentry kind="src" path="${testSrcDir}"/>
+          <j:choose>
+            <j:when test="${excludeX != 'X'}">
+              <classpathentry kind="src" excluding="${maven.eclipse.exclude}" path="${testSrcDir}"/>
+            </j:when>
+            <j:otherwise>
+              <classpathentry kind="src" path="${testSrcDir}"/>
+            </j:otherwise>
+          </j:choose>
          <!-- 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


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


Mime
View raw message