From 7959d85dd43e043169ddb0797408380e1fd9ec29 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 17 May 2013 12:09:05 +1000 Subject: [PATCH 1/3] Allow uploader choice in upload.tool to specify a different platform vendor --- app/src/processing/app/debug/BasicUploader.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/debug/BasicUploader.java b/app/src/processing/app/debug/BasicUploader.java index 1909c464a..de029c907 100644 --- a/app/src/processing/app/debug/BasicUploader.java +++ b/app/src/processing/app/debug/BasicUploader.java @@ -50,7 +50,13 @@ public class BasicUploader extends Uploader { TargetPlatform targetPlatform = Base.getTargetPlatform(); PreferencesMap prefs = Preferences.getMap(); prefs.putAll(Base.getBoardPreferences()); - prefs.putAll(targetPlatform.getTool(prefs.get("upload.tool"))); + String tool = prefs.get("upload.tool"); + if (tool.contains(":")) { + String[] split = tool.split(":", 2); + targetPlatform = Base.getCurrentTargetPlatformFromPackage(split[0]); + tool = split[1]; + } + prefs.putAll(targetPlatform.getTool(tool)); // if no protocol is specified for this board, assume it lacks a // bootloader and upload using the selected programmer. From b8c795e1845aa50b2fa0a8ee0730be5acae6e3cb Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 17 May 2013 12:49:23 +1000 Subject: [PATCH 2/3] Don't give up when loading hardware/ profile directories with some invalid directories This allows you to create hardware profiles that support both pre-1.5 and 1.5 onwards (boards.txt, cores, bootloader etc. in root for pre-1.5 and / directories containing 1.5 onward content. Still prints a warning if a hardware folder doesn't contain anything 1.5 compatible. --- app/src/processing/app/debug/TargetPackage.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/debug/TargetPackage.java b/app/src/processing/app/debug/TargetPackage.java index 020cf89e3..6bc199b31 100644 --- a/app/src/processing/app/debug/TargetPackage.java +++ b/app/src/processing/app/debug/TargetPackage.java @@ -47,8 +47,16 @@ public class TargetPackage { if (!subFolder.exists() || !subFolder.canRead()) continue; String arch = subFolder.getName(); - TargetPlatform platform = new TargetPlatform(arch, subFolder, this); - platforms.put(arch, platform); + try { + TargetPlatform platform = new TargetPlatform(arch, subFolder, this); + platforms.put(arch, platform); + } catch (TargetPlatformException e) { + continue; + } + } + + if(platforms.size() == 0) { + throw new TargetPlatformException("No architecture directories with boards.txt files were found in hardware folder " + _folder.getName() + ". Is it pre-1.5?"); } } From c70cba8fcdf77686a667a38ff5c2f5d0a867aeb6 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 15 Jul 2013 21:25:21 +0200 Subject: [PATCH 3/3] Fixed translated text string. Show warning message during loading of TargetPlatforms --- app/src/processing/app/debug/TargetPackage.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/debug/TargetPackage.java b/app/src/processing/app/debug/TargetPackage.java index 6bc199b31..68c1a488c 100644 --- a/app/src/processing/app/debug/TargetPackage.java +++ b/app/src/processing/app/debug/TargetPackage.java @@ -23,11 +23,14 @@ */ package processing.app.debug; +import static processing.app.I18n._; + import java.io.File; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; +import processing.app.I18n; import processing.app.helpers.filefilters.OnlyDirs; public class TargetPackage { @@ -51,12 +54,14 @@ public class TargetPackage { TargetPlatform platform = new TargetPlatform(arch, subFolder, this); platforms.put(arch, platform); } catch (TargetPlatformException e) { - continue; + System.out.println(e.getMessage()); } } - if(platforms.size() == 0) { - throw new TargetPlatformException("No architecture directories with boards.txt files were found in hardware folder " + _folder.getName() + ". Is it pre-1.5?"); + if (platforms.size() == 0) { + throw new TargetPlatformException(I18n + .format(_("No valid hardware definitions found in folder {0}."), + _folder.getName())); } }