savedArgs = new String[args.length];
System.arraycopy(args, 0, savedArgs, 0, savedArgs.length);
for (int i = 0; i < args.length; i++) {
- if ("-help".equals(args[i])) {
- // should be info, but handler usually suppresses
- MessageUtil.abort(handler, BuildArgParser.getUsage());
+// AMC - PR58681. No need to abort on -help as the Eclipse compiler does the right thing.
+// if ("-help".equals(args[i])) {
+// // should be info, but handler usually suppresses
+// MessageUtil.abort(handler, BuildArgParser.getUsage());
+// return true;
+// } else
+ if ("-X".equals(args[i])) {
+ // should be info, but handler usually suppresses
+ MessageUtil.abort(handler, BuildArgParser.getXOptionUsage());
return true;
}
}
return Main.bind("misc.usage");
}
+ public static String getXOptionUsage() {
+ return Main.bind("xoption.usage");
+ }
+
/**
* StringWriter sink for some errors.
* This only captures errors not handled by any IMessageHandler parameter
handler.handleMessage(errorMessage);
// MessageUtil.warn(handler, message);
}
-
+
protected File makeFile(File dir, String name) {
name = name.replace('/', File.separatorChar);
File ret = new File(name);
\t (<level> may be ignore, warning, or error)\n\
\t-Xlintfile <file> specify properties file to set per-message levels\n\
\t (cf org/aspectj/weaver/XlintDefault.properties)\n\
+\t-X print help on non-standard options\n\
\n\
Standard Eclipse compiler options:\n\
\ Options enabled by default are prefixed with ''+''\n\
\ -v -version print compiler version\n\
\ -showversion print compiler version and continue\n
+xoption.usage = {compiler.name} non-standard options:\n\
+\n\
+\t-XnoInline don't inline advice\n\
+\t-XlazyTjp create thisJoinPoint objects lazily\n\
+\t-Xreweavable create class files that can be subsequently rewoven\n\
+\t by AspectJ\n\
+\t-Xreweavable:compress as above, but also compress the reweaving information\n\
+\t-XnoWeave compile classes but do not weave. Deprecated, use\n\
+\t reweavable instead.\n
## options not documented above (per ..ajdt.ajc.BuildArgParser.java):
-# -XincrementalFile, -XnoWeave, -XserializableAspects, -XnoInline, -Xreweavable[:compress]
+# -XincrementalFile, -XjavadocsInModel
###############################################################################
# Copyright (c) 2000, 2004 IBM Corporation and others.
*/
public void run(String[] args, IMessageHolder holder) {
if (LangUtil.isEmpty(args)) {
- args = new String[] { "-help" };
+ args = new String[] { "-?" };
} else if (controller.running()) {
fail(holder, "already running with controller: " + controller, null);
return;
// default package
+
import junit.framework.*;
import junit.framework.Test;
suite.addTest(org.aspectj.ajdt.ajc.AjdtAjcTests.suite());
suite.addTest(org.aspectj.ajdt.internal.compiler.batch.AjdtBatchTests.suite());
suite.addTest(org.aspectj.ajdt.internal.core.builder.AjdtBuilderTests.suite());
+ suite.addTestSuite(org.aspectj.tools.ajc.MainTest.class);
return suite;
}
*
*/
public class MainTest extends TestCase {
-
+
public void testMainbare() {
ArrayList list = new ArrayList();
- Main.bareMain(new String[] {"-help"}, false, list, null, null, null);
- assertTrue(1 == list.size());
- Object o = list.get(0);
+// Usage now printed by Eclipse compiler so doesn't appear here in our message list
+// Main.bareMain(new String[] {"-help"}, false, list, null, null, null);
+// assertTrue(1 == list.size());
+ Main.bareMain(new String[] {"-X"}, false, list, null, null, null);
+ assertTrue(1 == list.size()); Object o = list.get(0);
assertTrue(o instanceof String);
- assertTrue(-1 != ((String)o).indexOf("-aspectpath"));
- assertTrue(-1 != ((String)o).indexOf("-incremental"));
+// assertTrue(-1 != ((String)o).indexOf("-aspectpath"));
+// assertTrue(-1 != ((String)o).indexOf("-incremental"));
}
}