Skip to content

Commit d0d9dfc

Browse files
author
Federico Fissore
committed
If package doesn't have that tool, it probably comes from another package, so we consult the resolvedTools instead
1 parent 7e9f19c commit d0d9dfc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

arduino-core/src/cc/arduino/contributions/packages/ContributedPackage.java

+11
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ public ContributedTool findTool(String name, String version) {
7171
return null;
7272
}
7373

74+
public ContributedTool findResolvedTool(String toolName, String version) {
75+
for (ContributedPlatform platform : getPlatforms()) {
76+
for (ContributedTool tool : platform.getResolvedTools()) {
77+
if (toolName.equals(tool.getName()) && version.equals(tool.getVersion())) {
78+
return tool;
79+
}
80+
}
81+
}
82+
return null;
83+
}
84+
7485
public boolean isTrusted() {
7586
return trusted;
7687
}

arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java

+3
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ private void syncPackageWithFilesystem(ContributedPackage pack, File root) {
260260

261261
private void syncToolWithFilesystem(ContributedPackage pack, File installationFolder, String toolName, String version) {
262262
ContributedTool tool = pack.findTool(toolName, version);
263+
if (tool == null) {
264+
tool = pack.findResolvedTool(toolName, version);
265+
}
263266
if (tool == null) {
264267
return;
265268
}

0 commit comments

Comments
 (0)