Browse Source

split extraoptions in <csc>, PR 23599

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277937 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
6c0ec57e6e
3 changed files with 30 additions and 2 deletions
  1. +3
    -0
      WHATSNEW
  2. +13
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  3. +14
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java

+ 3
- 0
WHATSNEW View File

@@ -264,6 +264,9 @@ Other changes:
* <rexec> with a single command should now work with unusal login * <rexec> with a single command should now work with unusal login
dialogs without special read/write pairs. Bugzilla Report 26632. dialogs without special read/write pairs. Bugzilla Report 26632.


* <csc>'s extraoptions can now contain multiple arguments.
Bugzilla Report 23599.

Fixed bugs: Fixed bugs:
----------- -----------




+ 13
- 2
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ import java.util.Hashtable;


import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project; 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.Path;
import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.EnumeratedAttribute; import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -469,6 +470,16 @@ public abstract class DotnetCompile
} }
} }


/**
* 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. * Set the destination directory of files to be compiled.
@@ -831,7 +842,7 @@ public abstract class DotnetCompile
command.addArgument(getAdditionalModulesParameter()); command.addArgument(getAdditionalModulesParameter());
command.addArgument(getDebugParameter()); command.addArgument(getDebugParameter());
command.addArgument(getDefinitionsParameter()); command.addArgument(getDefinitionsParameter());
command.addArgument(getExtraOptionsParameter());
command.addArguments(getExtraOptionsParameters());
command.addArgument(getMainClassParameter()); command.addArgument(getMainClassParameter());
command.addArgument(getOptimizeParameter()); command.addArgument(getOptimizeParameter());
command.addArgument(getDestFileParameter()); command.addArgument(getDestFileParameter());


+ 14
- 0
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java View File

@@ -201,6 +201,20 @@ public class NetCommand {
} }
} }


/**
* 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, * concatenate two strings together and add them as a single argument,
* but only if argument2 is non-null and non-zero length * but only if argument2 is non-null and non-zero length


Loading…
Cancel
Save