1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Better names for ContributedLibrary dependencies fields

This commit is contained in:
Cristian Maglie 2019-03-13 14:50:58 +01:00 committed by Martino Facchin
parent 492553cde0
commit 745cb01ed5
4 changed files with 9 additions and 9 deletions

View File

@ -64,7 +64,7 @@ public abstract class ContributedLibrary extends DownloadableContribution {
public abstract List<String> getTypes();
public abstract List<ContributedLibraryDependency> getRequires();
public abstract List<ContributedLibraryDependency> getDependencies();
public abstract List<String> getProvidesIncludes();
@ -146,8 +146,8 @@ public abstract class ContributedLibrary extends DownloadableContribution {
}
res += "\n";
res += " requires :\n";
if (getRequires() != null)
for (ContributedLibraryDependency r : getRequires()) {
if (getDependencies() != null)
for (ContributedLibraryDependency r : getDependencies()) {
res += " " + r;
}
res += "\n";

View File

@ -33,10 +33,10 @@ public abstract class ContributedLibraryDependency {
public abstract String getName();
public abstract String getVersionRequired();
public abstract String getVersion();
@Override
public String toString() {
return getName() + " " + getVersionRequired();
return getName() + " " + getVersion();
}
}

View File

@ -112,7 +112,7 @@ public abstract class LibrariesIndex {
public boolean resolveDependeciesOf(List<ContributedLibrary> solution,
ContributedLibrary library) {
List<ContributedLibraryDependency> requirements = library.getRequires();
List<ContributedLibraryDependency> requirements = library.getDependencies();
if (requirements == null) {
// No deps for this library, great!
return true;
@ -160,7 +160,7 @@ public abstract class LibrariesIndex {
private List<ContributedLibrary> findMatchingDependencies(ContributedLibraryDependency dep) {
List<ContributedLibrary> available = find(dep.getName());
if (dep.getVersionRequired() == null || dep.getVersionRequired().isEmpty())
if (dep.getVersion() == null || dep.getVersion().isEmpty())
return available;
// XXX: The following part is actually never reached. The use of version

View File

@ -38,7 +38,7 @@ public class UnavailableContributedLibrary extends ContributedLibrary {
private String version;
public UnavailableContributedLibrary(ContributedLibraryDependency dependency) {
this(dependency.getName(), dependency.getVersionRequired());
this(dependency.getName(), dependency.getVersion());
}
public UnavailableContributedLibrary(String _name, String _version) {
@ -101,7 +101,7 @@ public class UnavailableContributedLibrary extends ContributedLibrary {
}
@Override
public List<ContributedLibraryDependency> getRequires() {
public List<ContributedLibraryDependency> getDependencies() {
return new ArrayList<>();
}