mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
CLI: Board and Lib Manager, syntax change: --install-boards (plural) and arduino:avr:1.6.2 (with the arch, not the name of the selected platform)
This commit is contained in:
@ -59,28 +59,6 @@ public abstract class ContributedPackage {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the latest version available of a platform
|
||||
*
|
||||
* @param platform
|
||||
* @return
|
||||
*/
|
||||
public ContributedPlatform findPlatform(String platform) {
|
||||
VersionComparator version = new VersionComparator();
|
||||
ContributedPlatform found = null;
|
||||
for (ContributedPlatform p : getPlatforms()) {
|
||||
if (!p.getName().equals(platform))
|
||||
continue;
|
||||
if (found == null) {
|
||||
found = p;
|
||||
continue;
|
||||
}
|
||||
if (version.compare(p.getParsedVersion(), found.getParsedVersion()) > 0)
|
||||
found = p;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
public ContributedTool findTool(String name, String version) {
|
||||
for (ContributedTool tool : getTools()) {
|
||||
if (tool.getName().equals(name) && tool.getVersion().equals(version))
|
||||
|
@ -50,8 +50,8 @@ public abstract class ContributionsIndex {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<ContributedPlatform> findPlatforms(String packageName, final String platformName) {
|
||||
if (packageName == null || platformName == null) {
|
||||
public List<ContributedPlatform> findPlatforms(String packageName, final String platformArch) {
|
||||
if (packageName == null || platformArch == null) {
|
||||
return null;
|
||||
|
||||
}
|
||||
@ -62,19 +62,19 @@ public abstract class ContributionsIndex {
|
||||
Collection<ContributedPlatform> platforms = Collections2.filter(aPackage.getPlatforms(), new Predicate<ContributedPlatform>() {
|
||||
@Override
|
||||
public boolean apply(ContributedPlatform contributedPlatform) {
|
||||
return platformName.equals(contributedPlatform.getName());
|
||||
return platformArch.equals(contributedPlatform.getArchitecture());
|
||||
}
|
||||
});
|
||||
return Lists.newLinkedList(platforms);
|
||||
}
|
||||
|
||||
public ContributedPlatform findPlatform(String packageName, final String platformName, final String platformVersion) {
|
||||
public ContributedPlatform findPlatform(String packageName, final String platformArch, final String platformVersion) {
|
||||
if (platformVersion == null) {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
Collection<ContributedPlatform> platformsByName = findPlatforms(packageName, platformName);
|
||||
Collection<ContributedPlatform> platformsByName = findPlatforms(packageName, platformArch);
|
||||
if (platformsByName == null) {
|
||||
return null;
|
||||
}
|
||||
@ -92,8 +92,8 @@ public abstract class ContributionsIndex {
|
||||
return platforms.iterator().next();
|
||||
}
|
||||
|
||||
public ContributedPlatform getInstalled(String packageName, String platformName) {
|
||||
List<ContributedPlatform> installedPlatforms = new LinkedList<ContributedPlatform>(Collections2.filter(findPlatforms(packageName, platformName), new InstalledPredicate()));
|
||||
public ContributedPlatform getInstalled(String packageName, String platformArch) {
|
||||
List<ContributedPlatform> installedPlatforms = new LinkedList<ContributedPlatform>(Collections2.filter(findPlatforms(packageName, platformArch), new InstalledPredicate()));
|
||||
Collections.sort(installedPlatforms, new DownloadableContributionBuiltInAtTheBottomComparator());
|
||||
|
||||
if (installedPlatforms.isEmpty()) {
|
||||
|
Reference in New Issue
Block a user