maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r390295 - in /maven/maven-1/plugins/trunk/aspectj: ./ src/plugin-test/ src/plugin-test/src/test/org/apache/maven/aspectj/ xdocs/
Date Fri, 31 Mar 2006 01:22:18 GMT
Author: ltheussl
Date: Thu Mar 30 17:22:16 2006
New Revision: 390295

URL: http://svn.apache.org/viewcvs?rev=390295&view=rev
Log:
PR: MPASPECTJ-15
Submitted by: Alexey Dashkevich
New property maven.aspectj.dest to define output folder for aspectj:compile goal.

Modified:
    maven/maven-1/plugins/trunk/aspectj/plugin.jelly
    maven/maven-1/plugins/trunk/aspectj/plugin.properties
    maven/maven-1/plugins/trunk/aspectj/src/plugin-test/maven.xml
    maven/maven-1/plugins/trunk/aspectj/src/plugin-test/project.properties
    maven/maven-1/plugins/trunk/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java
    maven/maven-1/plugins/trunk/aspectj/xdocs/changes.xml
    maven/maven-1/plugins/trunk/aspectj/xdocs/properties.xml

Modified: maven/maven-1/plugins/trunk/aspectj/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/plugin.jelly?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/aspectj/plugin.jelly Thu Mar 30 17:22:16 2006
@@ -2,7 +2,7 @@
 
 <!-- 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -243,6 +243,18 @@
 
     <j:if test="${(shouldWeave == 'true') and (pom.build.unitTestSourceDirectory != '')}">
 
+      <j:choose>
+        <j:when test="${context.getVariable('maven.aspectj.dest') == null}">
+          <j:set var="maven.aspectj.dest" value="${maven.build.dest}"/>
+        </j:when>
+        <j:otherwise>
+          <attainGoal name="java:compile"/>
+          <ant:path id="build.dest" location="${maven.build.dest}"/>
+          <maven:addPath id="maven.dependency.classpath" refid="build.dest"/>
+        </j:otherwise>
+      </j:choose>
+
+
       <maven:get var="maven.test.compile.src.set"
         plugin="maven-test-plugin"
         property="maven.test.compile.src.set"/>
@@ -256,7 +268,7 @@
       <aspectj:compile
         sourcePathRefid="maven.test.compile.src.set"
         classpathRefid="testClasspath"
-        destDir="${maven.test.dest}"/>
+        destDir="${maven.aspectj.dest}"/>
 
     </j:if>
 

Modified: maven/maven-1/plugins/trunk/aspectj/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/plugin.properties?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/aspectj/plugin.properties Thu Mar 30 17:22:16 2006
@@ -1,5 +1,5 @@
 # -------------------------------------------------------------------
-# Copyright 2001-2004 The Apache Software Foundation.
+# Copyright 2001-2006 The Apache Software Foundation.
 # 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -67,6 +67,8 @@
 # If true, display speed information during weaving.
 maven.aspectj.time = false
 
+# The directory for compiled classes. By default maven.build.dest used.
+#maven.aspectj.dest=
 
 # If true, produce binaries that can only be used as input for the -injars or -inpath option
 maven.aspectj.noweave=false

Modified: maven/maven-1/plugins/trunk/aspectj/src/plugin-test/maven.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/src/plugin-test/maven.xml?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/src/plugin-test/maven.xml (original)
+++ maven/maven-1/plugins/trunk/aspectj/src/plugin-test/maven.xml Thu Mar 30 17:22:16 2006
@@ -1,6 +1,6 @@
 <!-- 
 /*
- * Copyright 2004 The Apache Software Foundation.
+ * Copyright 2004-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,5 +41,9 @@
     <attainGoal name="test:single"/>
     <attainGoal name="clean"/>
   </goal>
+
+  <preGoal name="test:compile">
+    <attainGoal name="aspectj"/>
+  </preGoal>
 
 </project>

Modified: maven/maven-1/plugins/trunk/aspectj/src/plugin-test/project.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/src/plugin-test/project.properties?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/src/plugin-test/project.properties (original)
+++ maven/maven-1/plugins/trunk/aspectj/src/plugin-test/project.properties Thu Mar 30 17:22:16
2006
@@ -13,4 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # -------------------------------------------------------------------
-maven.junit.fork=true
\ No newline at end of file
+maven.junit.fork=true
+maven.aspectj.dest=target/test-classes
\ No newline at end of file

Modified: maven/maven-1/plugins/trunk/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java
(original)
+++ maven/maven-1/plugins/trunk/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java
Thu Mar 30 17:22:16 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.aspectj;
 
 /* ====================================================================
- *   Copyright 2004 The Apache Software Foundation.
+ *   Copyright 2004-2006 The Apache Software Foundation.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  */
 import junit.framework.TestCase;
 
+import java.util.Enumeration;
+import java.net.URL;
+
 public class AspectTest extends TestCase
 {
 
@@ -59,7 +62,24 @@
             assertEquals(EXCEPTION_MESSAGE, expected.getMessage());
         }
     }
-    
+
+    public void testTestDest() throws Exception
+    {
+         Enumeration enum = getClass().getClassLoader().getResources("org/apache/maven/aspectj/AspectTest.class"
);
+         String testFile = getClass().getClassLoader().getResource( "org/apache/maven/aspectj/TestA.class"
).getFile();
+
+         int count = 0;
+        //check that aspect TestA placed only in the same folder that AspectTest
+         while ( enum.hasMoreElements() )
+         {
+             URL aspectURL = (URL) enum.nextElement();
+             assertEquals( aspectURL.getFile().substring( 0, aspectURL.getFile().indexOf(
"/AspectTest.class" ) ),
+                     testFile.substring( 0, testFile.indexOf( "/TestA.class" ) ) );
+             count++;
+         }
+         assertEquals( 1, count );
+    }
+
     public void someMethod()
     {
     }

Modified: maven/maven-1/plugins/trunk/aspectj/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/xdocs/changes.xml?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/aspectj/xdocs/changes.xml Thu Mar 30 17:22:16 2006
@@ -2,7 +2,7 @@
 
 <!-- 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
   </properties>
   <body>
     <release version="4.0-SNAPSHOT" date="in SVN">
+      <action dev="ltheussl" type="add" issue="MPASPECTJ-15" due-to="Alexey Dashkevich">New
property <code>maven.aspectj.dest</code> to define output folder for <code>aspectj:compile</code>
goal.</action>
       <action dev="ltheussl" type="fix" issue="MPASPECTJ-14" due-to="Alexey Dashkevich">Unable
to weave only sources defined in argument files. New property <code>maven.aspectj.src.argfilesOnly</code>.</action>
       <action dev="ltheussl" type="add" issue="MPASPECTJ-23" due-to="Shinobu Kawai Yoshida">Add
a report for the plugin.</action>
       <action dev="carlos" type="update" issue="MPASPECTJ-21">Upgraded to AspectJ 1.5.0</action>

Modified: maven/maven-1/plugins/trunk/aspectj/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/aspectj/xdocs/properties.xml?rev=390295&r1=390294&r2=390295&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/aspectj/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/aspectj/xdocs/properties.xml Thu Mar 30 17:22:16 2006
@@ -2,7 +2,7 @@
 
 <!-- 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -68,6 +68,15 @@
             If true, only sources that are defined in argument files will be weaved.
             By default, weave sources from argument files and from build-
             or test sources path.
+          </td>
+        </tr>
+
+        <tr>
+          <td>maven.aspectj.dest</td>
+          <td>Yes</td>
+          <td>
+            The directory for compiled classes.
+            Defaults to <code>maven.build.dest</code>.
           </td>
         </tr>
 



Mime
View raw message