mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Allow overriding platform.txt using platform.local.txt
This helps advanced users that want to change options (e.g. to use a different toolchain or enable warnings), without having to change platform.txt (which could make git report changed files all the time).
This commit is contained in:
parent
b2500b3b85
commit
a46e503a30
@ -110,6 +110,20 @@ public class TargetPlatform {
|
||||
format(_("Error loading {0}"), platformsFile.getAbsolutePath()), e);
|
||||
}
|
||||
|
||||
// Allow overriding values in platform.txt. This allows changing
|
||||
// platform.txt (e.g. to use a system-wide toolchain), without
|
||||
// having to modify platform.txt (which, when running from git,
|
||||
// prevents files being marked as changed).
|
||||
File localPlatformsFile = new File(folder, "platform.local.txt");
|
||||
try {
|
||||
if (localPlatformsFile.exists() && localPlatformsFile.canRead()) {
|
||||
preferences.load(localPlatformsFile);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new TargetPlatformException(
|
||||
format(_("Error loading {0}"), localPlatformsFile.getAbsolutePath()), e);
|
||||
}
|
||||
|
||||
File progFile = new File(folder, "programmers.txt");
|
||||
try {
|
||||
if (progFile.exists() && progFile.canRead()) {
|
||||
|
Loading…
Reference in New Issue
Block a user