You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2005/03/14 12:46:02 UTC
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet DotnetCompile.java NetCommand.java
bodewig 2005/03/14 03:46:02
Modified: . WHATSNEW
src/main/org/apache/tools/ant/taskdefs/optional/dotnet
DotnetCompile.java NetCommand.java
Log:
split extraoptions in <csc>, PR 23599
Revision Changes Path
1.777 +3 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.776
retrieving revision 1.777
diff -u -r1.776 -r1.777
--- WHATSNEW 14 Mar 2005 11:34:58 -0000 1.776
+++ WHATSNEW 14 Mar 2005 11:46:00 -0000 1.777
@@ -264,6 +264,9 @@
* <rexec> with a single command should now work with unusal login
dialogs without special read/write pairs. Bugzilla Report 26632.
+* <csc>'s extraoptions can now contain multiple arguments.
+ Bugzilla Report 23599.
+
Fixed bugs:
-----------
1.26 +13 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
Index: DotnetCompile.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- DotnetCompile.java 14 Apr 2004 15:42:07 -0000 1.25
+++ DotnetCompile.java 14 Mar 2005 11:46:01 -0000 1.26
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation
+ * Copyright 2001-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -469,6 +470,16 @@
}
}
+ /**
+ * get any extra options or null for no argument needed, split
+ * them if they represent multiple options.
+ *
+ * @return The ExtraOptions Parameter to CSC
+ */
+ protected String[] getExtraOptionsParameters() {
+ String extra = getExtraOptionsParameter();
+ return extra == null ? null : Commandline.translateCommandline(extra);
+ }
/**
* Set the destination directory of files to be compiled.
@@ -831,7 +842,7 @@
command.addArgument(getAdditionalModulesParameter());
command.addArgument(getDebugParameter());
command.addArgument(getDefinitionsParameter());
- command.addArgument(getExtraOptionsParameter());
+ command.addArguments(getExtraOptionsParameters());
command.addArgument(getMainClassParameter());
command.addArgument(getOptimizeParameter());
command.addArgument(getDestFileParameter());
1.35 +14 -0 ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
Index: NetCommand.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- NetCommand.java 6 Jan 2005 12:05:03 -0000 1.34
+++ NetCommand.java 14 Mar 2005 11:46:01 -0000 1.35
@@ -202,6 +202,20 @@
}
/**
+ * add an argument to a command line; do nothing if the arg is null or
+ * empty string
+ *
+ *@param argument The feature to be added to the Argument attribute
+ */
+ public void addArguments(String[] arguments) {
+ if (arguments != null && arguments.length != 0) {
+ for (int i = 0; i < arguments.length; i++) {
+ addArgument(arguments[i]);
+ }
+ }
+ }
+
+ /**
* concatenate two strings together and add them as a single argument,
* but only if argument2 is non-null and non-zero length
*
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org