mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Fixing whitespace in Compiler.java.
This commit is contained in:
parent
3dc7fc0781
commit
f2010ebd2b
@ -99,7 +99,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
List commandAR = new ArrayList(baseCommandAR);
|
List commandAR = new ArrayList(baseCommandAR);
|
||||||
commandAR.add(file.getAbsolutePath());
|
commandAR.add(file.getAbsolutePath());
|
||||||
execAsynchronously(commandAR);
|
execAsynchronously(commandAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. compile the libraries, outputting .o files to: <buildPath>/<library>/
|
// 2. compile the libraries, outputting .o files to: <buildPath>/<library>/
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
findFilesInFolder(new File(libraryFolder, "utility"), "cpp", false)));
|
findFilesInFolder(new File(libraryFolder, "utility"), "cpp", false)));
|
||||||
// other libraries should not see this library's utility/ folder
|
// other libraries should not see this library's utility/ folder
|
||||||
includePaths.remove(includePaths.size() - 1);
|
includePaths.remove(includePaths.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. compile the sketch (already in the buildPath)
|
// 3. compile the sketch (already in the buildPath)
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
execAsynchronously(commandObjcopy);
|
execAsynchronously(commandObjcopy);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<File> compileFiles(String avrBasePath,
|
private List<File> compileFiles(String avrBasePath,
|
||||||
@ -201,7 +201,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
execAsynchronously(getCommandCompilerC(avrBasePath, includePaths,
|
execAsynchronously(getCommandCompilerC(avrBasePath, includePaths,
|
||||||
file.getAbsolutePath(),
|
file.getAbsolutePath(),
|
||||||
objectPath));
|
objectPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (File file : cppSources) {
|
for (File file : cppSources) {
|
||||||
String objectPath = buildPath + File.separator + file.getName() + ".o";
|
String objectPath = buildPath + File.separator + file.getName() + ".o";
|
||||||
@ -209,10 +209,10 @@ public class Compiler implements MessageConsumer {
|
|||||||
execAsynchronously(getCommandCompilerCPP(avrBasePath, includePaths,
|
execAsynchronously(getCommandCompilerCPP(avrBasePath, includePaths,
|
||||||
file.getAbsolutePath(),
|
file.getAbsolutePath(),
|
||||||
objectPath));
|
objectPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
return objectPaths;
|
return objectPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean firstErrorFound;
|
boolean firstErrorFound;
|
||||||
@ -229,9 +229,9 @@ public class Compiler implements MessageConsumer {
|
|||||||
if (verbose || Preferences.getBoolean("build.verbose")) {
|
if (verbose || Preferences.getBoolean("build.verbose")) {
|
||||||
for(int j = 0; j < command.length; j++) {
|
for(int j = 0; j < command.length; j++) {
|
||||||
System.out.print(command[j] + " ");
|
System.out.print(command[j] + " ");
|
||||||
}
|
}
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
firstErrorFound = false; // haven't found any errors yet
|
firstErrorFound = false; // haven't found any errors yet
|
||||||
secondErrorFound = false;
|
secondErrorFound = false;
|
||||||
@ -244,7 +244,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
RunnerException re = new RunnerException(e.getMessage());
|
RunnerException re = new RunnerException(e.getMessage());
|
||||||
re.hideStackTrace();
|
re.hideStackTrace();
|
||||||
throw re;
|
throw re;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageSiphon in = new MessageSiphon(process.getInputStream(), this);
|
MessageSiphon in = new MessageSiphon(process.getInputStream(), this);
|
||||||
MessageSiphon err = new MessageSiphon(process.getErrorStream(), this);
|
MessageSiphon err = new MessageSiphon(process.getErrorStream(), this);
|
||||||
@ -275,14 +275,14 @@ public class Compiler implements MessageConsumer {
|
|||||||
if (result > 1) {
|
if (result > 1) {
|
||||||
// a failure in the tool (e.g. unable to locate a sub-executable)
|
// a failure in the tool (e.g. unable to locate a sub-executable)
|
||||||
System.err.println(command[0] + " returned " + result);
|
System.err.println(command[0] + " returned " + result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
RunnerException re = new RunnerException("Error compiling.");
|
RunnerException re = new RunnerException("Error compiling.");
|
||||||
re.hideStackTrace();
|
re.hideStackTrace();
|
||||||
throw re;
|
throw re;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -319,7 +319,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
if (partialStartIndex != -1) {
|
if (partialStartIndex != -1) {
|
||||||
fileIndex = 0;
|
fileIndex = 0;
|
||||||
} else {
|
} else {
|
||||||
// wasn't there, check the other (non-pde) files in the sketch.
|
// wasn't there, check the other (non-pde) files in the sketch.
|
||||||
// iterate through the project files to see who's causing the trouble
|
// iterate through the project files to see who's causing the trouble
|
||||||
for (int i = 0; i < sketch.getCodeCount(); i++) {
|
for (int i = 0; i < sketch.getCodeCount(); i++) {
|
||||||
@ -332,7 +332,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
fileIndex = i;
|
fileIndex = i;
|
||||||
//System.out.println("fileIndex is " + fileIndex);
|
//System.out.println("fileIndex is " + fileIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//+ className + ".java";
|
//+ className + ".java";
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
System.err.print(s1);
|
System.err.print(s1);
|
||||||
//firstErrorFound = true;
|
//firstErrorFound = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lineNumber;
|
int lineNumber;
|
||||||
try {
|
try {
|
||||||
@ -361,7 +361,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
System.err.print(s1);
|
System.err.print(s1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//System.out.println("pde / line number: " + lineNumber);
|
//System.out.println("pde / line number: " + lineNumber);
|
||||||
|
|
||||||
@ -372,15 +372,15 @@ public class Compiler implements MessageConsumer {
|
|||||||
if (sketch.getCode(i).getPreprocOffset() < lineNumber) {
|
if (sketch.getCode(i).getPreprocOffset() < lineNumber) {
|
||||||
fileIndex = i;
|
fileIndex = i;
|
||||||
//System.out.println("i'm thinkin file " + i);
|
//System.out.println("i'm thinkin file " + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
// XXX: DAM: if the lineNumber is less than sketch.getCode(0).getPreprocOffset()
|
// XXX: DAM: if the lineNumber is less than sketch.getCode(0).getPreprocOffset()
|
||||||
// we shouldn't subtract anything from it, as the error is above the
|
// we shouldn't subtract anything from it, as the error is above the
|
||||||
// location where the function prototypes and #include "WProgram.h"
|
// location where the function prototypes and #include "WProgram.h"
|
||||||
// were inserted.
|
// were inserted.
|
||||||
lineNumber -= sketch.getCode(fileIndex).getPreprocOffset();
|
lineNumber -= sketch.getCode(fileIndex).getPreprocOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
//String s2 = s1.substring(colon + 2);
|
//String s2 = s1.substring(colon + 2);
|
||||||
int err = s1.indexOf(":");
|
int err = s1.indexOf(":");
|
||||||
@ -391,7 +391,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
if (firstErrorFound) {
|
if (firstErrorFound) {
|
||||||
secondErrorFound = true;
|
secondErrorFound = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if executing at this point, this is *at least* the first error
|
// if executing at this point, this is *at least* the first error
|
||||||
firstErrorFound = true;
|
firstErrorFound = true;
|
||||||
@ -472,7 +472,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
for (int i = 0; i < includePaths.size(); i++) {
|
for (int i = 0; i < includePaths.size(); i++) {
|
||||||
baseCommandCompilerCPP.add("-I" + (String) includePaths.get(i));
|
baseCommandCompilerCPP.add("-I" + (String) includePaths.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
baseCommandCompilerCPP.add(sourceName);
|
baseCommandCompilerCPP.add(sourceName);
|
||||||
baseCommandCompilerCPP.add("-o"+ objectName);
|
baseCommandCompilerCPP.add("-o"+ objectName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user