diff options
author | acolyer <acolyer> | 2006-01-30 17:32:43 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2006-01-30 17:32:43 +0000 |
commit | 3ea3c39aec3ca5c187e98ef82a8d56959c63ae71 (patch) | |
tree | 58190c47bc0f9f1c626ac92b0b2fc9c263d97db3 /taskdefs/src | |
parent | e8ce7c29343baed3b22173ec76a23e852ffbd12e (diff) | |
download | aspectj-3ea3c39aec3ca5c187e98ef82a8d56959c63ae71.tar.gz aspectj-3ea3c39aec3ca5c187e98ef82a8d56959c63ae71.zip |
support for messageHolder attribute even when forking (see corresponding change in ajc.Main)
Diffstat (limited to 'taskdefs/src')
-rw-r--r-- | taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java index 27fc98cbc..1498820eb 100644 --- a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -1320,10 +1320,6 @@ public class AjcTask extends MatchingTask { * or if failonerror and there were compile errors. */ protected void executeInOtherVM(String[] args) { - if (null != messageHolder) { - this.logger.warning("message holder ignored when forking: " - + messageHolder.getClass().getName()); - } javaCmd.setClassname(org.aspectj.tools.ajc.Main.class.getName()); final Path vmClasspath = javaCmd.createClasspath(getProject()); @@ -1358,14 +1354,20 @@ public class AjcTask extends MatchingTask { File tempFile = null; int numArgs = args.length; args = GuardedCommand.limitTo(args, MAX_COMMANDLINE, getLocation()); + if (args.length != numArgs) { tempFile = new File(args[1]); } try { + boolean setMessageHolderOnForking = (this.messageHolder != null); String[] javaArgs = javaCmd.getCommandline(); - String[] both = new String[javaArgs.length + args.length]; + String[] both = new String[javaArgs.length + args.length + (setMessageHolderOnForking ? 2 : 0)]; System.arraycopy(javaArgs,0,both,0,javaArgs.length); System.arraycopy(args,0,both,javaArgs.length,args.length); + if (setMessageHolderOnForking) { + both[both.length - 2] = "-messageHolder"; + both[both.length - 1] = this.messageHolder.getClass().getName(); + } // try to use javaw instead on windows if (both[0].endsWith("java.exe")) { String path = both[0]; |