1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

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 <architecture>/ directories containing 1.5 onward content.

Still prints a warning if a hardware folder doesn't contain anything 1.5 compatible.
This commit is contained in:
Angus Gratton 2013-05-17 12:49:23 +10:00
parent 7959d85dd4
commit b8c795e184

View File

@ -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?");
}
}