@@ -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"; | |||
/* |
@@ -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"; | |||
} |
@@ -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; | |||
@@ -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(); |
@@ -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()); | |||
} | |||
@@ -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 () { |
@@ -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"); |