mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Don't add keys (and display a warning) if the missing key doesn't make sense in target platform.txt. For a key to make sense, two tree level must be present already, eg: tools.avrdude
This commit is contained in:
parent
6e9d0e5f99
commit
5dd49352df
@ -162,9 +162,13 @@ public class LegacyTargetPlatform implements TargetPlatform {
|
||||
|
||||
PreferencesMap addedProps = platformRewriteProps.subTree("added");
|
||||
for (Map.Entry<String, String> entry : addedProps.entrySet()) {
|
||||
if (!preferences.containsKey(entry.getKey())) {
|
||||
System.err.println(I18n.format(_("Warning: platform.txt from core '{0}' misses property {1}, automatically set to {2}. Consider upgrading this core."), platformName, entry.getKey(), entry.getValue()));
|
||||
preferences.put(entry.getKey(), entry.getValue());
|
||||
String keyToAdd = entry.getKey();
|
||||
String[] keyToAddParts = keyToAdd.split("\\.");
|
||||
String keyToAddFirstLevel = keyToAddParts[0];
|
||||
String keyToAddSecondLevel = keyToAddParts[0] + "." + keyToAddParts[1];
|
||||
if (!preferences.subTree(keyToAddFirstLevel).isEmpty() && !preferences.subTree(keyToAddSecondLevel).isEmpty() && !preferences.containsKey(keyToAdd)) {
|
||||
System.err.println(I18n.format(_("Warning: platform.txt from core '{0}' misses property {1}, automatically set to {2}. Consider upgrading this core."), platformName, keyToAdd, entry.getValue()));
|
||||
preferences.put(keyToAdd, entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user