Author: bodewig Date: Mon Jan 22 20:26:06 2007 New Revision: 498915 URL: http://svn.apache.org/viewvc?view=rev&rev=498915 Log: make commands work in directories with spaces when using a response file as well, Issue 41387
Modified: ant/antlibs/dotnet/trunk/changes.xml ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/NetCommand.java Modified: ant/antlibs/dotnet/trunk/changes.xml URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/changes.xml?view=diff&rev=498915&r1=498914&r2=498915 ============================================================================== --- ant/antlibs/dotnet/trunk/changes.xml (original) +++ ant/antlibs/dotnet/trunk/changes.xml Mon Jan 22 20:26:06 2007 @@ -22,6 +22,11 @@ </properties> <release version="SVN trunk" date="unpublished"> + <action type="fix" issue="41387"> + The compilation tasks failed if the source files resided in a + directory with spaces in its full path and a response file was + used. + </action> </release> <release version="1.0" date="2006-11-06"> Modified: ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/NetCommand.java URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/NetCommand.java?view=diff&rev=498915&r1=498914&r2=498915 ============================================================================== --- ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/NetCommand.java (original) +++ ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/NetCommand.java Mon Jan 22 20:26:06 2007 @@ -42,6 +42,7 @@ import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; import org.apache.tools.ant.taskdefs.LogStreamHandler; +import org.apache.tools.ant.taskdefs.condition.Os; import org.apache.tools.ant.types.Commandline; /** @@ -58,6 +59,12 @@ private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); + private static final boolean IS_WINDOWS; + + static { + IS_WINDOWS = Os.isFamily("windows"); + } + /** * owner project */ @@ -351,7 +358,14 @@ PrintWriter out = new PrintWriter(new BufferedOutputStream(fos)); //start at 1 because element 0 is the executable name for (int i = 1; i < commands.length; ++i) { - out.println(commands[i]); + if (IS_WINDOWS && commands[i].indexOf(" ") > -1) { + String q = commands[i].indexOf("\"") > -1 ? "'" : "\""; + out.print(q); + out.print(commands[i]); + out.println(q); + } else { + out.println(commands[i]); + } } out.flush(); out.close(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]