summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java12
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java6
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties12
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java2
-rw-r--r--org.aspectj.ajdt.core/testsrc/EajcModuleTests.java2
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java14
6 files changed, 36 insertions, 12 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java
index a04231cd2..080192767 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java
@@ -44,9 +44,15 @@ public class AjdtCommand implements ICommand {
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;
}
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
index d010975a4..3d795f25f 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
@@ -50,6 +50,10 @@ public class BuildArgParser extends Main {
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
@@ -557,7 +561,7 @@ public class BuildArgParser extends Main {
handler.handleMessage(errorMessage);
// MessageUtil.warn(handler, message);
}
-
+
protected File makeFile(File dir, String name) {
name = name.replace('/', File.separatorChar);
File ret = new File(name);
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
index 29c7020b7..90c527234 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
@@ -36,6 +36,7 @@ AspectJ-specific options:\n\
\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\
@@ -115,8 +116,17 @@ Standard Eclipse compiler options:\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.
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java
index 600962c20..de78dbae0 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java
@@ -260,7 +260,7 @@ public class Main {
*/
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;
diff --git a/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java b/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java
index d2347fd87..4d342ce4b 100644
--- a/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java
+++ b/org.aspectj.ajdt.core/testsrc/EajcModuleTests.java
@@ -14,6 +14,7 @@
// default package
+
import junit.framework.*;
import junit.framework.Test;
@@ -24,6 +25,7 @@ public class EajcModuleTests extends TestCase {
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;
}
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java
index 29d64c27c..13d7216dd 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java
@@ -20,14 +20,16 @@ import junit.framework.TestCase;
*
*/
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"));
}
}