mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Boards Manager: contributions MAY miss tools, but we missed to consider this case. Fixes #3248
This commit is contained in:
parent
31290179e7
commit
1b7574a8b9
@ -93,6 +93,6 @@ public abstract class ContributedPlatform extends DownloadableContribution {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getParsedVersion();
|
||||
return getName() + " " + getParsedVersion();
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public abstract class ContributedToolReference {
|
||||
|
||||
public ContributedTool resolve(Collection<ContributedPackage> packages) {
|
||||
for (ContributedPackage pack : packages) {
|
||||
assert pack.getTools() != null;
|
||||
for (ContributedTool tool : pack.getTools())
|
||||
if (tool.getName().equals(getName()) &&
|
||||
tool.getVersion().equals(getVersion()) &&
|
||||
@ -54,4 +55,4 @@ public abstract class ContributedToolReference {
|
||||
return "name=" + getName() + " version=" + getVersion() + " packager=" +
|
||||
getPackager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,13 +91,20 @@ public class ContributionsIndexer {
|
||||
}
|
||||
|
||||
List<ContributedPackage> packages = index.getPackages();
|
||||
Collection<ContributedPackage> packagesWithTools = Collections2.filter(packages, new Predicate<ContributedPackage>() {
|
||||
@Override
|
||||
public boolean apply(ContributedPackage input) {
|
||||
return input.getTools() != null;
|
||||
}
|
||||
});
|
||||
|
||||
for (ContributedPackage pack : packages) {
|
||||
for (ContributedPlatform platform : pack.getPlatforms()) {
|
||||
// Set a reference to parent packages
|
||||
platform.setParentPackage(pack);
|
||||
|
||||
// Resolve tools dependencies (works also as a check for file integrity)
|
||||
platform.resolveToolsDependencies(packages);
|
||||
platform.resolveToolsDependencies(packagesWithTools);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user