Browse Source

mcs on Linux doesn't like quotes in /references.

I guess it is a platform-depenent command line parsing issue rather
than Mono vs MS, so I madi it conditional on the OS.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278126 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
67776debe7
3 changed files with 27 additions and 7 deletions
  1. +1
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
  2. +8
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java
  3. +18
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java

+ 1
- 3
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java View File

@@ -33,8 +33,6 @@ package org.apache.tools.ant.taskdefs.optional.dotnet;

import java.io.File;

import org.apache.tools.ant.taskdefs.condition.Os;

// ====================================================================

/**
@@ -160,7 +158,7 @@ public class CSharp extends DotnetCompile {
unsafe = false;
noconfig = false;
definitions = null;
setExecutable(Os.isFamily("windows") ? "csc" : "mcs");
setExecutable(isWindows ? "csc" : "mcs");
}




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

@@ -18,6 +18,7 @@
package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.DirectoryScanner;
@@ -46,6 +47,13 @@ public class DotnetBaseMatchingTask extends MatchingTask {
*/
protected File srcDir;

/**
* Are we running on Windows?
*
* @since Ant 1.6.3
*/
protected static final boolean isWindows = Os.isFamily("windows");

/**
* Overridden because we need to be able to set the srcDir.
*/


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

@@ -219,7 +219,11 @@ public abstract class DotnetCompile
protected String getReferencesParameter() {
//bail on no references
if (notEmpty(references)) {
return REFERENCE_OPTION + '\"' + references + '\"';
if (isWindows) {
return REFERENCE_OPTION + '\"' + references + '\"';
} else {
return references;
}
} else {
return null;
}
@@ -270,7 +274,13 @@ public abstract class DotnetCompile
}

StringBuffer s = new StringBuffer(REFERENCE_OPTION);
s.append('\"').append(refpath).append('\"');
if (isWindows) {
s.append('\"');
}
s.append(refpath);
if (isWindows) {
s.append('\"');
}
return s.toString();
}

@@ -903,7 +913,7 @@ public abstract class DotnetCompile
if (isFileManagedBinary(file)) {
if (!firstEntry) {
referenceList.append(getReferenceDelimiter());
} else {
} else if (isWindows) {
referenceList.append('\"');
}
referenceList.append(file.toString());
@@ -918,7 +928,11 @@ public abstract class DotnetCompile
// a managed binary
if (!firstEntry) {
//add it all to an argument
command.addArgument(referenceList.toString() + '\"');
if (isWindows) {
command.addArgument(referenceList.toString() + '\"');
} else {
command.addArgument(referenceList.toString());
}
}
return filesOutOfDate;


Loading…
Cancel
Save