mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
SAM boards stop compiling due to way of handling params with spaces on different OSs. Fixed
This commit is contained in:
@ -54,6 +54,7 @@ import processing.app.preproc.PdePreprocessor;
|
|||||||
import processing.app.legacy.PApplet;
|
import processing.app.legacy.PApplet;
|
||||||
import processing.app.packages.LegacyUserLibrary;
|
import processing.app.packages.LegacyUserLibrary;
|
||||||
import processing.app.packages.UserLibrary;
|
import processing.app.packages.UserLibrary;
|
||||||
|
import processing.app.tools.ArgumentsWithSpaceAwareCommandLine;
|
||||||
|
|
||||||
public class Compiler implements MessageConsumer {
|
public class Compiler implements MessageConsumer {
|
||||||
|
|
||||||
@ -319,10 +320,10 @@ public class Compiler implements MessageConsumer {
|
|||||||
if (maxDataSize > 0) {
|
if (maxDataSize > 0) {
|
||||||
System.out
|
System.out
|
||||||
.println(I18n
|
.println(I18n
|
||||||
.format(
|
.format(
|
||||||
_("Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes."),
|
_("Global variables use {0} bytes ({2}%%) of dynamic memory, leaving {3} bytes for local variables. Maximum is {1} bytes."),
|
||||||
dataSize, maxDataSize, dataSize * 100 / maxDataSize,
|
dataSize, maxDataSize, dataSize * 100 / maxDataSize,
|
||||||
maxDataSize - dataSize));
|
maxDataSize - dataSize));
|
||||||
} else {
|
} else {
|
||||||
System.out.println(I18n
|
System.out.println(I18n
|
||||||
.format(_("Global variables use {0} bytes of dynamic memory."), dataSize));
|
.format(_("Global variables use {0} bytes of dynamic memory."), dataSize));
|
||||||
@ -736,9 +737,9 @@ public class Compiler implements MessageConsumer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CommandLine commandLine = new CommandLine(command[0]);
|
CommandLine commandLine = new ArgumentsWithSpaceAwareCommandLine(command[0]);
|
||||||
for (int i = 1; i < command.length; i++) {
|
for (int i = 1; i < command.length; i++) {
|
||||||
commandLine.addArgument(command[i]);
|
commandLine.addArgument(command[i], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int result;
|
int result;
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package processing.app.tools;
|
||||||
|
|
||||||
|
import org.apache.commons.exec.CommandLine;
|
||||||
|
import processing.app.BaseNoGui;
|
||||||
|
import processing.app.Platform;
|
||||||
|
import processing.app.helpers.OSUtils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class ArgumentsWithSpaceAwareCommandLine extends CommandLine {
|
||||||
|
|
||||||
|
public ArgumentsWithSpaceAwareCommandLine(String executable) {
|
||||||
|
super(executable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArgumentsWithSpaceAwareCommandLine(File executable) {
|
||||||
|
super(executable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArgumentsWithSpaceAwareCommandLine(CommandLine other) {
|
||||||
|
super(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommandLine addArgument(String argument, boolean handleQuoting) {
|
||||||
|
if (argument.contains(" ") && OSUtils.isWindows()) {
|
||||||
|
argument = argument.replaceAll("\"", "").replaceAll("'", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.addArgument(argument, handleQuoting);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user