use of com.android.tools.idea.gradle.structure.model.PsLibraryDependency in project android by JetBrains.
the class QuickFixes method setLibraryDependencyVersion.
private static void setLibraryDependencyVersion(@NonNls PsContext context, @NotNull String moduleName, @NotNull String dependency, @NotNull String version) {
PsModule module = context.getProject().findModuleByName(moduleName);
if (module instanceof PsAndroidModule) {
PsAndroidModule androidModule = (PsAndroidModule) module;
androidModule.forEachDeclaredDependency(declaredDependency -> {
if (declaredDependency instanceof PsLibraryDependency) {
setLibraryDependencyVersion((PsLibraryDependency) declaredDependency, dependency, version);
}
});
} else if (module instanceof PsJavaModule) {
PsJavaModule javaModule = (PsJavaModule) module;
javaModule.forEachDeclaredDependency(declaredDependency -> {
if (declaredDependency instanceof PsLibraryDependency) {
setLibraryDependencyVersion((PsLibraryDependency) declaredDependency, dependency, version);
}
});
}
}
use of com.android.tools.idea.gradle.structure.model.PsLibraryDependency in project android by JetBrains.
the class PsJavaModuleAnalyzer method doAnalyze.
@Override
protected void doAnalyze(@NotNull PsJavaModule module, @NotNull PsIssueCollection issueCollection) {
PsModulePath modulePath = new PsModulePath(module);
module.forEachDependency(dependency -> {
if (dependency instanceof PsLibraryDependency && dependency.isDeclared()) {
PsLibraryDependency libraryDependency = (PsLibraryDependency) dependency;
analyzeDeclaredDependency(libraryDependency, modulePath, issueCollection);
}
});
}
Aggregations