mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
Removed some warnings which are emitted from arduino-builder at compile time
Fixes #4177
This commit is contained in:
parent
802c745690
commit
73e857fda9
@ -20,27 +20,21 @@
|
||||
*/
|
||||
package processing.app.debug;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
import static processing.app.I18n.format;
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
|
||||
public class LegacyTargetBoard implements TargetBoard {
|
||||
|
||||
private String id;
|
||||
private PreferencesMap prefs;
|
||||
private Map<String, PreferencesMap> menuOptions = new LinkedHashMap<String, PreferencesMap>();
|
||||
private TargetPlatform containerPlatform;
|
||||
private final String id;
|
||||
private final PreferencesMap prefs;
|
||||
private Map<String, PreferencesMap> menuOptions = new LinkedHashMap<>();
|
||||
private final TargetPlatform containerPlatform;
|
||||
|
||||
/**
|
||||
* Create a TargetBoard based on preferences passed as argument.
|
||||
*
|
||||
* @param _prefs
|
||||
* @return
|
||||
*/
|
||||
public LegacyTargetBoard(String _id, PreferencesMap _prefs,
|
||||
TargetPlatform parent) {
|
||||
@ -58,10 +52,6 @@ public class LegacyTargetBoard implements TargetBoard {
|
||||
String board = containerPlatform.getId() + "_" + id;
|
||||
board = board.toUpperCase();
|
||||
prefs.put("build.board", board);
|
||||
System.err
|
||||
.println(format(tr("Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}"),
|
||||
containerPlatform.getContainerPackage().getId(),
|
||||
containerPlatform.getId(), id, board));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
package processing.app.debug;
|
||||
|
||||
import processing.app.BaseNoGui;
|
||||
import processing.app.I18n;
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
|
||||
import java.io.File;
|
||||
@ -30,24 +29,24 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
import static processing.app.I18n.format;
|
||||
import static processing.app.I18n.tr;
|
||||
|
||||
public class LegacyTargetPlatform implements TargetPlatform {
|
||||
|
||||
private String id;
|
||||
private File folder;
|
||||
private final String id;
|
||||
private final File folder;
|
||||
|
||||
private TargetPackage containerPackage;
|
||||
protected PreferencesMap preferences = new PreferencesMap();
|
||||
private final TargetPackage containerPackage;
|
||||
private final PreferencesMap preferences = new PreferencesMap();
|
||||
|
||||
private Map<String, TargetBoard> boards = new LinkedHashMap<String, TargetBoard>();
|
||||
private final Map<String, TargetBoard> boards = new LinkedHashMap<>();
|
||||
private TargetBoard defaultBoard;
|
||||
|
||||
/**
|
||||
* Contains preferences for every defined programmer
|
||||
*/
|
||||
private Map<String, PreferencesMap> programmers = new LinkedHashMap<String, PreferencesMap>();
|
||||
private Map<String, PreferencesMap> programmers = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Contains labels for top level menus
|
||||
@ -162,15 +161,9 @@ public class LegacyTargetPlatform implements TargetPlatform {
|
||||
PreferencesMap oldProps = platformRewriteProps.subTree("old");
|
||||
PreferencesMap newProps = platformRewriteProps.subTree("new");
|
||||
|
||||
String platformName = preferences.get("name");
|
||||
if (platformName == null) {
|
||||
platformName = folder.getAbsolutePath();
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : oldProps.entrySet()) {
|
||||
String preferencesKey = entry.getKey().substring(entry.getKey().indexOf(".") + 1);
|
||||
if (preferences.containsKey(preferencesKey) && entry.getValue().equals(preferences.get(preferencesKey))) {
|
||||
System.err.println(I18n.format(tr("Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core."), platformName, preferencesKey + "=" + entry.getValue(), preferencesKey + "=" + newProps.get(entry.getKey())));
|
||||
preferences.put(preferencesKey, newProps.get(entry.getKey()));
|
||||
}
|
||||
}
|
||||
@ -182,7 +175,6 @@ public class LegacyTargetPlatform implements TargetPlatform {
|
||||
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(tr("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());
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ package processing.app.packages;
|
||||
import cc.arduino.Constants;
|
||||
import cc.arduino.contributions.libraries.ContributedLibrary;
|
||||
import cc.arduino.contributions.libraries.ContributedLibraryReference;
|
||||
import processing.app.helpers.FileUtils;
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
|
||||
import java.io.File;
|
||||
@ -91,11 +90,6 @@ public class UserLibrary extends ContributedLibrary {
|
||||
if (srcFolder.exists() && srcFolder.isDirectory()) {
|
||||
// Layout with a single "src" folder and recursive compilation
|
||||
layout = LibraryLayout.RECURSIVE;
|
||||
|
||||
File utilFolder = new File(libFolder, "utility");
|
||||
if (utilFolder.exists() && utilFolder.isDirectory()) {
|
||||
throw new IOException("Library can't use both 'src' and 'utility' folders.");
|
||||
}
|
||||
} else {
|
||||
// Layout with source code on library's root and "utility" folders
|
||||
layout = LibraryLayout.FLAT;
|
||||
@ -106,13 +100,6 @@ public class UserLibrary extends ContributedLibrary {
|
||||
if (files == null) {
|
||||
throw new IOException("Unable to list files of library in " + libFolder);
|
||||
}
|
||||
for (File file : files) {
|
||||
if (file.isDirectory() && FileUtils.isSCCSOrHiddenFile(file)) {
|
||||
if (!FileUtils.isSCCSFolder(file) && FileUtils.isHiddenFile(file)) {
|
||||
System.out.println("WARNING: Spurious " + file.getName() + " folder in '" + properties.get("name") + "' library");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extract metadata info
|
||||
String architectures = properties.get("architectures");
|
||||
@ -123,10 +110,10 @@ public class UserLibrary extends ContributedLibrary {
|
||||
archs.add(arch.trim());
|
||||
|
||||
String category = properties.get("category");
|
||||
if (category == null)
|
||||
if (category == null) {
|
||||
category = "Uncategorized";
|
||||
}
|
||||
if (!Constants.LIBRARY_CATEGORIES.contains(category)) {
|
||||
System.out.println("WARNING: Category '" + category + "' in library " + properties.get("name") + " is not valid. Setting to 'Uncategorized'");
|
||||
category = "Uncategorized";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user