From b8c795e1845aa50b2fa0a8ee0730be5acae6e3cb Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 17 May 2013 12:49:23 +1000 Subject: [PATCH] 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?"); } }