mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +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);
|
prefs.put("name", extendedName);
|
||||||
|
|
||||||
// Resolve tools needed for this board
|
// Resolve tools needed for this board
|
||||||
|
List<ContributedTool> requiredTools = new ArrayList<>();
|
||||||
|
|
||||||
|
// Add all tools dependencies specified in package index
|
||||||
ContributedPlatform platform = indexer.getContributedPlaform(getTargetPlatform());
|
ContributedPlatform platform = indexer.getContributedPlaform(getTargetPlatform());
|
||||||
if (platform != null) {
|
if (platform != null)
|
||||||
String prefix = "runtime.tools.";
|
requiredTools.addAll(platform.getResolvedTools());
|
||||||
for (ContributedTool tool : platform.getResolvedTools()) {
|
|
||||||
File folder = tool.getDownloadableContribution(getPlatform()).getInstalledFolder();
|
String prefix = "runtime.tools.";
|
||||||
String toolPath = folder.getAbsolutePath();
|
for (ContributedTool tool : requiredTools) {
|
||||||
prefs.put(prefix + tool.getName() + ".path", toolPath);
|
File folder = tool.getDownloadableContribution(getPlatform()).getInstalledFolder();
|
||||||
PreferencesData.set(prefix + tool.getName() + ".path", toolPath);
|
String toolPath = folder.getAbsolutePath();
|
||||||
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", toolPath);
|
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;
|
return prefs;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user