Skip to content

Commit 1b7574a

Browse files
author
Federico Fissore
committed
Boards Manager: contributions MAY miss tools, but we missed to consider this case. Fixes #3248
1 parent 3129017 commit 1b7574a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Diff for: arduino-core/src/cc/arduino/contributions/packages/ContributedPlatform.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ public void setParentPackage(ContributedPackage parentPackage) {
9393

9494
@Override
9595
public String toString() {
96-
return getParsedVersion();
96+
return getName() + " " + getParsedVersion();
9797
}
9898
}

Diff for: arduino-core/src/cc/arduino/contributions/packages/ContributedToolReference.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public abstract class ContributedToolReference {
4040

4141
public ContributedTool resolve(Collection<ContributedPackage> packages) {
4242
for (ContributedPackage pack : packages) {
43+
assert pack.getTools() != null;
4344
for (ContributedTool tool : pack.getTools())
4445
if (tool.getName().equals(getName()) &&
4546
tool.getVersion().equals(getVersion()) &&
@@ -54,4 +55,4 @@ public String toString() {
5455
return "name=" + getName() + " version=" + getVersion() + " packager=" +
5556
getPackager();
5657
}
57-
}
58+
}

Diff for: arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,20 @@ public void parseIndex() throws Exception {
9191
}
9292

9393
List<ContributedPackage> packages = index.getPackages();
94+
Collection<ContributedPackage> packagesWithTools = Collections2.filter(packages, new Predicate<ContributedPackage>() {
95+
@Override
96+
public boolean apply(ContributedPackage input) {
97+
return input.getTools() != null;
98+
}
99+
});
100+
94101
for (ContributedPackage pack : packages) {
95102
for (ContributedPlatform platform : pack.getPlatforms()) {
96103
// Set a reference to parent packages
97104
platform.setParentPackage(pack);
98105

99106
// Resolve tools dependencies (works also as a check for file integrity)
100-
platform.resolveToolsDependencies(packages);
107+
platform.resolveToolsDependencies(packagesWithTools);
101108
}
102109
}
103110

0 commit comments

Comments
 (0)