mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Boards Manager now install tools even if they are available in the IDE bundle
Previously if a 3rd party core would require a tool already bundled in the IDE then boards manager skipped the installation of that tool. This is could lead to missing tools if the IDE is upgraded and the bundled tools may change. This patch fixes the bug by always installing tools when needed, even if they are already bundled.
This commit is contained in:
parent
d8470e59f4
commit
e731fe026f
@ -79,16 +79,15 @@ public class ContributionInstaller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do not download already installed tools
|
// Do not download already installed tools
|
||||||
List<ContributedTool> tools = new LinkedList<>(contributedPlatform.getResolvedTools());
|
List<ContributedTool> tools = new ArrayList<>();
|
||||||
Iterator<ContributedTool> toolsIterator = tools.iterator();
|
for (ContributedTool tool : contributedPlatform.getResolvedTools()) {
|
||||||
while (toolsIterator.hasNext()) {
|
|
||||||
ContributedTool tool = toolsIterator.next();
|
|
||||||
DownloadableContribution downloadable = tool.getDownloadableContribution(platform);
|
DownloadableContribution downloadable = tool.getDownloadableContribution(platform);
|
||||||
if (downloadable == null) {
|
if (downloadable == null) {
|
||||||
throw new Exception(format(tr("Tool {0} is not available for your operating system."), tool.getName()));
|
throw new Exception(format(tr("Tool {0} is not available for your operating system."), tool.getName()));
|
||||||
}
|
}
|
||||||
if (downloadable.isInstalled()) {
|
// Download the tool if it's not installed or it's a built-in tool
|
||||||
toolsIterator.remove();
|
if (!downloadable.isInstalled() || downloadable.isReadOnly()) {
|
||||||
|
tools.add(tool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,10 +124,10 @@ public class ContributionInstaller {
|
|||||||
|
|
||||||
List<Map.Entry<ContributedToolReference, ContributedTool>> resolvedToolReferences = contributedPlatform.getResolvedToolReferences().entrySet()
|
List<Map.Entry<ContributedToolReference, ContributedTool>> resolvedToolReferences = contributedPlatform.getResolvedToolReferences().entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.filter((entry) -> !entry.getValue().getDownloadableContribution(platform).isInstalled())
|
.filter((entry) -> !entry.getValue().getDownloadableContribution(platform).isInstalled()
|
||||||
|
|| entry.getValue().getDownloadableContribution(platform).isReadOnly())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (Map.Entry<ContributedToolReference, ContributedTool> entry : resolvedToolReferences) {
|
for (Map.Entry<ContributedToolReference, ContributedTool> entry : resolvedToolReferences) {
|
||||||
progress.setStatus(format(tr("Installing tools ({0}/{1})..."), i, resolvedToolReferences.size()));
|
progress.setStatus(format(tr("Installing tools ({0}/{1})..."), i, resolvedToolReferences.size()));
|
||||||
|
@ -374,7 +374,7 @@ public class ContributionsIndexer {
|
|||||||
if (platformToIgnore.equals(platform)) {
|
if (platformToIgnore.equals(platform)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!platform.isInstalled()) {
|
if (!platform.isInstalled() || platform.isReadOnly()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (ContributedTool requiredTool : platform.getResolvedTools()) {
|
for (ContributedTool requiredTool : platform.getResolvedTools()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user