mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-13 10:29:35 +01:00
Slightly refactored tool resolution
This helps the understanding of next commits
This commit is contained in:
parent
3b57462281
commit
4f1b584e71
@ -164,16 +164,20 @@ public class BaseNoGui {
|
||||
prefs.put("name", extendedName);
|
||||
|
||||
// Resolve tools needed for this board
|
||||
List<ContributedTool> requiredTools = new ArrayList<>();
|
||||
|
||||
// Add all tools dependencies specified in package index
|
||||
ContributedPlatform platform = indexer.getContributedPlaform(getTargetPlatform());
|
||||
if (platform != null) {
|
||||
String prefix = "runtime.tools.";
|
||||
for (ContributedTool tool : platform.getResolvedTools()) {
|
||||
File folder = tool.getDownloadableContribution(getPlatform()).getInstalledFolder();
|
||||
String toolPath = folder.getAbsolutePath();
|
||||
prefs.put(prefix + tool.getName() + ".path", toolPath);
|
||||
PreferencesData.set(prefix + tool.getName() + ".path", toolPath);
|
||||
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", toolPath);
|
||||
}
|
||||
if (platform != null)
|
||||
requiredTools.addAll(platform.getResolvedTools());
|
||||
|
||||
String prefix = "runtime.tools.";
|
||||
for (ContributedTool tool : requiredTools) {
|
||||
File folder = tool.getDownloadableContribution(getPlatform()).getInstalledFolder();
|
||||
String toolPath = folder.getAbsolutePath();
|
||||
prefs.put(prefix + tool.getName() + ".path", toolPath);
|
||||
PreferencesData.set(prefix + tool.getName() + ".path", toolPath);
|
||||
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", toolPath);
|
||||
}
|
||||
return prefs;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user