mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03:00
Added auto-generation for 'build.board' value in boards.txt.
See #1305.
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
package processing.app.debug;
|
||||
|
||||
import static processing.app.I18n._;
|
||||
import static processing.app.I18n.format;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@ -28,6 +31,18 @@ public class TargetBoard {
|
||||
PreferencesMap menus = prefs.firstLevelMap().get("menu");
|
||||
if (menus != null)
|
||||
menuOptions = menus.firstLevelMap();
|
||||
|
||||
// Auto generate build.board if not set
|
||||
if (!prefs.containsKey("build.board")) {
|
||||
String board = containerPlatform.getId() + "_" + id;
|
||||
board = board.toUpperCase();
|
||||
prefs.put("build.board", board);
|
||||
System.out
|
||||
.println(format(
|
||||
_("Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}"),
|
||||
containerPlatform.getContainerPackage().getId(),
|
||||
containerPlatform.getId(), id, board));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user