use of com.android.tools.idea.gradle.structure.quickfix.PsLibraryDependencyVersionQuickFixPath in project android by JetBrains.
the class PsAnalyzerDaemon method checkForUpdates.
private boolean checkForUpdates(@NotNull PsLibraryDependency dependency) {
PsContext context = getContext();
AvailableLibraryUpdates results = context.getLibraryUpdateCheckerDaemon().getAvailableUpdates();
PsArtifactDependencySpec spec = dependency.getDeclaredSpec();
if (spec != null) {
AvailableLibraryUpdate update = results.findUpdateFor(spec);
if (update != null) {
String text = String.format("Newer version available: <b>%1$s</b> (%2$s)", update.version, update.repository);
PsLibraryDependencyNavigationPath mainPath = new PsLibraryDependencyNavigationPath(context, dependency);
PsIssue issue = new PsIssue(text, mainPath, LIBRARY_UPDATES_AVAILABLE, UPDATE);
issue.setExtraPath(new PsModulePath(dependency.getParent()));
PsLibraryDependencyVersionQuickFixPath quickFix = new PsLibraryDependencyVersionQuickFixPath(dependency, update.version);
quickFix.setHrefText("[Update]");
issue.setQuickFixPath(quickFix);
myIssues.add(issue);
return true;
}
}
return false;
}
Aggregations