Skip to content

Extend platforms with Boards.local.txt #3878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions arduino-core/src/processing/app/debug/LegacyTargetPlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,23 @@ public LegacyTargetPlatform(String _name, File _folder, TargetPackage parent)

// Load boards
try {
Map<String, PreferencesMap> boardsPreferences = new PreferencesMap(
boardsFile).firstLevelMap();
PreferencesMap bPrefs = new PreferencesMap(
boardsFile);

// Allow overriding values in boards.txt. This allows changing
// boards.txt (e.g. to add user-specific items to a menu), without
// having to modify boards.txt (which, when running from git,
// prevents files being marked as changed).
File localboardsFile = new File(folder, "boards.local.txt");
try {
if (localboardsFile.exists() && localboardsFile.canRead()) {
bPrefs.load(localboardsFile);
}
} catch (IOException e) {
throw new TargetPlatformException(
format(tr("Error loading {0}"), localboardsFile.getAbsolutePath()), e);
}
Map<String, PreferencesMap> boardsPreferences = bPrefs.firstLevelMap();

// Create custom menus for this platform
PreferencesMap menus = boardsPreferences.get("menu");
Expand Down