mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Updating code for the new folder organization. This version should be able to compile and upload sketches, including libraries, but burning bootloaders won't work.
This commit is contained in:
@ -131,13 +131,13 @@ public class AvrdudeUploader extends Uploader {
|
||||
// avrdude will have been properly installed by the distribution's package
|
||||
// manager and should be able to find its config file.
|
||||
if(Base.isMacOS()) {
|
||||
commandDownloader.add("-C" + "tools/avr/etc/avrdude.conf");
|
||||
commandDownloader.add("-C" + "hardware/tools/avr/etc/avrdude.conf");
|
||||
}
|
||||
else if(Base.isWindows()) {
|
||||
String userdir = System.getProperty("user.dir") + File.separator;
|
||||
commandDownloader.add("-C" + userdir + "tools/avr/etc/avrdude.conf");
|
||||
commandDownloader.add("-C" + userdir + "hardware/tools/avr/etc/avrdude.conf");
|
||||
} else {
|
||||
commandDownloader.add("-C" + "tools/avrdude.conf");
|
||||
commandDownloader.add("-C" + "hardware/tools/avrdude.conf");
|
||||
}
|
||||
|
||||
if (Preferences.getBoolean("upload.verbose")) {
|
||||
|
@ -87,13 +87,13 @@ public class Compiler implements MessageConsumer {
|
||||
// }
|
||||
String avrBasePath;
|
||||
if(Base.isMacOS()) {
|
||||
avrBasePath = new String("tools/avr/bin/");
|
||||
avrBasePath = new String("hardware/tools/avr/bin/");
|
||||
}
|
||||
else if(Base.isLinux()) {
|
||||
avrBasePath = new String("");
|
||||
}
|
||||
else {
|
||||
avrBasePath = new String(userdir + "tools/avr/bin/");
|
||||
avrBasePath = new String(userdir + "hardware/tools/avr/bin/");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1447,7 +1447,7 @@ public class Editor extends JFrame
|
||||
public void run() {
|
||||
try {
|
||||
if (!sketch.handleRun(new Target(
|
||||
System.getProperty("user.dir") + File.separator + "lib" +
|
||||
System.getProperty("user.dir") + File.separator + "hardware" +
|
||||
File.separator + "targets", Preferences.get("build.target"))))
|
||||
return;
|
||||
|
||||
@ -2056,7 +2056,7 @@ public class Editor extends JFrame
|
||||
//boolean success = sketch.isLibrary() ?
|
||||
//sketch.exportLibrary() : sketch.exportApplet();
|
||||
boolean success = sketch.exportApplet(new Target(
|
||||
System.getProperty("user.dir") + File.separator + "lib" +
|
||||
System.getProperty("user.dir") + File.separator + "hardware" +
|
||||
File.separator + "targets", Preferences.get("build.target")));
|
||||
if (success) {
|
||||
message("Done uploading.");
|
||||
|
@ -320,13 +320,13 @@ public class Library implements MessageConsumer{
|
||||
String userdir = System.getProperty("user.dir") + File.separator;
|
||||
String avrBasePath;
|
||||
if(Base.isMacOS()) {
|
||||
avrBasePath = new String("tools/avr/bin/");
|
||||
avrBasePath = new String("hardware/tools/avr/bin/");
|
||||
}
|
||||
else if(Base.isLinux()) {
|
||||
avrBasePath = new String("");
|
||||
}
|
||||
else {
|
||||
avrBasePath = new String(userdir + "tools/avr/bin/");
|
||||
avrBasePath = new String(userdir + "hardware/tools/avr/bin/");
|
||||
}
|
||||
|
||||
String[] baseCompileCommandC = new String[] {
|
||||
|
@ -45,10 +45,10 @@ public class LibraryManager {
|
||||
{
|
||||
String userDir = System.getProperty("user.dir") + File.separator;
|
||||
libDir = new File(
|
||||
((!Base.isMacOS()) ? "" : userDir) + "lib" + File.separator +
|
||||
"targets" + File.separator + "libraries");
|
||||
((!Base.isMacOS()) ? "" : userDir) + "hardware" + File.separator +
|
||||
"libraries");
|
||||
target = new Target(
|
||||
System.getProperty("user.dir") + File.separator + "lib" +
|
||||
System.getProperty("user.dir") + File.separator + "hardware" +
|
||||
File.separator + "targets", Preferences.get("build.target"));
|
||||
refreshLibraries();
|
||||
}
|
||||
|
@ -42,13 +42,13 @@ public class Sizer implements MessageConsumer {
|
||||
String userdir = System.getProperty("user.dir") + File.separator;
|
||||
String avrBasePath;
|
||||
if(Base.isMacOS()) {
|
||||
avrBasePath = new String("tools/avr/bin/");
|
||||
avrBasePath = new String("hardware/tools/avr/bin/");
|
||||
}
|
||||
else if(Base.isLinux()) {
|
||||
avrBasePath = new String("");
|
||||
}
|
||||
else {
|
||||
avrBasePath = new String(userdir + "tools/avr/bin/");
|
||||
avrBasePath = new String(userdir + "hardware/tools/avr/bin/");
|
||||
}
|
||||
String commandSize[] = new String[] {
|
||||
avrBasePath + "avr-size",
|
||||
|
@ -87,7 +87,7 @@ public class Sketchbook {
|
||||
examplesPath = examplesFolder.getAbsolutePath();
|
||||
|
||||
librariesFolder = new File(System.getProperty("user.dir"),
|
||||
"lib" + File.separator + "targets" + File.separator + "libraries");
|
||||
"hardware" + File.separator + "libraries");
|
||||
librariesPath = librariesFolder.getAbsolutePath();
|
||||
|
||||
String sketchbookPath = Preferences.get("sketchbook.path");
|
||||
|
@ -100,13 +100,13 @@ public abstract class Uploader implements MessageConsumer {
|
||||
|
||||
String avrBasePath;
|
||||
if(Base.isMacOS()) {
|
||||
avrBasePath = new String("tools/avr/bin/");
|
||||
avrBasePath = new String("hardware/tools/avr/bin/");
|
||||
}
|
||||
else if(Base.isLinux()) {
|
||||
avrBasePath = new String("");
|
||||
}
|
||||
else {
|
||||
avrBasePath = new String(userdir + "tools/avr/bin/");
|
||||
avrBasePath = new String(userdir + "hardware/tools/avr/bin/");
|
||||
}
|
||||
|
||||
commandArray[0] = avrBasePath + commandArray[0];
|
||||
|
@ -77,7 +77,7 @@ public class ExportFolder {
|
||||
editor.handleOpen(path);
|
||||
// success may not be that useful, usually an ex is thrown
|
||||
success = editor.sketch.exportApplet(new Target(
|
||||
System.getProperty("user.dir") + File.separator + "lib" +
|
||||
System.getProperty("user.dir") + File.separator + "hardware" +
|
||||
File.separator + "targets", Preferences.get("build.target")));
|
||||
if (!success) break;
|
||||
//System.out.println("success was " + success);
|
||||
|
Reference in New Issue
Block a user