]> source.dussan.org Git - aspectj.git/commitdiff
Bug 149289 "Support system and user aop.xml configuration files" (add META-INF/aop...
authormwebster <mwebster>
Wed, 23 Aug 2006 14:34:28 +0000 (14:34 +0000)
committermwebster <mwebster>
Wed, 23 Aug 2006 14:34:28 +0000 (14:34 +0000)
ajde/testdata/OutxmlTest/src-resources/META-INF/aop-ajc.xml [new file with mode: 0644]
ajde/testdata/OutxmlTest/src-resources/META-INF/aop.xml [deleted file]
ajde/testsrc/org/aspectj/ajde/OutxmlTest.java
bridge/src/org/aspectj/bridge/Constants.java [new file with mode: 0644]
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java
taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/ajde/testdata/OutxmlTest/src-resources/META-INF/aop-ajc.xml b/ajde/testdata/OutxmlTest/src-resources/META-INF/aop-ajc.xml
new file mode 100644 (file)
index 0000000..77505c7
--- /dev/null
@@ -0,0 +1,2 @@
+<aspectj>
+</aspectj>
\ No newline at end of file
diff --git a/ajde/testdata/OutxmlTest/src-resources/META-INF/aop.xml b/ajde/testdata/OutxmlTest/src-resources/META-INF/aop.xml
deleted file mode 100644 (file)
index 77505c7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<aspectj>
-</aspectj>
\ No newline at end of file
index b4fff912b6c8f4f9fef7d4a04a2604dad1297bb6..2c018de1bf3622abba49a72768622c7258242df1 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
+import org.aspectj.bridge.Constants;
 import org.aspectj.util.FileUtil;
 
 public class OutxmlTest extends AjdeTestCase {
@@ -26,7 +27,7 @@ public class OutxmlTest extends AjdeTestCase {
        public static final String PROJECT_DIR = "OutxmlTest";
        public static final String BIN_DIR = "bin";
        public static final String OUTJAR_NAME = "/bin/test.jar"; 
-       public static final String DEFAULT_AOPXML_NAME = "META-INF/aop.xml"
+       public static final String DEFAULT_AOPXML_NAME = Constants.AOP_AJC_XML
        public static final String CUSTOM_AOPXML_NAME = "custom/aop.xml"; 
 
        /*
diff --git a/bridge/src/org/aspectj/bridge/Constants.java b/bridge/src/org/aspectj/bridge/Constants.java
new file mode 100644 (file)
index 0000000..b68dc4a
--- /dev/null
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Matthew Webster - initial implementation
+ *******************************************************************************/
+package org.aspectj.bridge;
+
+public class Constants {
+
+       /* Default resource names for user and generate aop.xml file */
+       public final static String AOP_USER_XML = "META-INF/aop.xml";
+    public final static String AOP_AJC_XML = "META-INF/aop-ajc.xml";
+
+}
index 20d57f3e7decc1b26020bd5274f1157a3d08f172..2e53d0cfa56fdecaccda8dcd8a92407417911482 100644 (file)
@@ -28,6 +28,7 @@ import java.util.StringTokenizer;
 
 import org.aspectj.asm.IRelationship;
 import org.aspectj.bridge.AbortException;
+import org.aspectj.bridge.Constants;
 import org.aspectj.bridge.ISourceLocation;
 import org.aspectj.util.LangUtil;
 import org.aspectj.weaver.ICrossReferenceHandler;
@@ -52,7 +53,7 @@ import org.aspectj.weaver.tools.WeavingAdaptor;
  */
 public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
 
-    private final static String AOP_XML = "META-INF/aop.xml";
+    private final static String AOP_XML = Constants.AOP_USER_XML + ";" + Constants.AOP_AJC_XML;
 
     private boolean initialized;
     
index 4aff85e3867bc10f61a38c725367def886f8c1ae..4b2c82c13affd22b0cbcb2dfa65f7df1ae8cb802 100644 (file)
@@ -493,7 +493,7 @@ public class BuildArgParser extends Main {
                                        showError("-outjar requires jar path argument");
                                }
                        } else if (arg.equals("-outxml")) { 
-                buildConfig.setOutxmlName("META-INF/aop.xml");  
+                buildConfig.setOutxmlName(org.aspectj.bridge.Constants.AOP_AJC_XML);  
                        } else if (arg.equals("-outxmlfile")) { 
                                if (args.size() > nextArgIndex) {
                                        String name = ((ConfigParser.Arg)args.get(nextArgIndex)).getValue();
index 17ae5b01b360584e7436af1c21e7b5d4d9427ffa..4ec4e5e789dc6f5ad9b555971485d2ff7e34458e 100644 (file)
@@ -497,7 +497,7 @@ public class BuildArgParserTestCase extends TestCase {
                IMessageHolder messageHolder = new MessageHandler();
                AjBuildConfig config = genBuildConfig(new String[] { "-outxml", "-showWeaveInfo" }, messageHolder);
         assertTrue("Warnings: " + messageHolder,!messageHolder.hasAnyMessage(IMessage.WARNING, true));
-               assertEquals("Wrong outxml","META-INF/aop.xml",config.getOutxmlName());
+               assertEquals("Wrong outxml","META-INF/aop-ajc.xml",config.getOutxmlName());
                assertTrue("Following option currupted",config.getShowWeavingInformation());
        }
        
index 74dcd34a47189b67b2f4f86c1fb8f1a37ded333f..cf93e775db1e6ed807553efb05813779c5d7aef5 100644 (file)
@@ -786,8 +786,8 @@ public class AjcTaskTest extends TestCase {
                AjcTask task = getTask("showweaveinfo.lst",destDir);
                task.setOutxml(true);
                checkRun(task,null);
-               File outxmlFile = new File(destDir,"META-INF/aop.xml");
-               assertTrue("META-INF/aop.xml missing",outxmlFile.exists());
+               File outxmlFile = new File(destDir,"META-INF/aop-ajc.xml");
+               assertTrue("META-INF/aop-ajc.xml missing",outxmlFile.exists());
        }
        
        public void testOutxmlFile () {
index e241d5f550a6217568ac5d7ab511c33061947303..c76470168309551f59e3a98dd422a298f559bee2 100644 (file)
@@ -1656,7 +1656,7 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                int aspectCount = 0;
                File aopXML = new File(getWorkingDir().getAbsolutePath() 
                                + File.separatorChar + projectName + File.separatorChar 
-                               + "bin" + File.separatorChar + "META-INF" + File.separatorChar + "aop.xml");
+                               + "bin" + File.separatorChar + "META-INF" + File.separatorChar + "aop-ajc.xml");
 
                if (!aopXML.exists()) {
                        fail("Expected file " + aopXML.getAbsolutePath() + " to exist but it doesn't");