use of com.android.tools.idea.gradle.structure.dependencies.android.AndroidDependencyScopesPanel in project android by JetBrains.
the class AddLibraryDependencyDialog method addNewDependencies.
@Override
public void addNewDependencies() {
String library = myLibraryDependenciesForm.getSelectedLibrary();
assert library != null;
AbstractDependencyScopesPanel scopesPanel = getScopesPanel();
List<String> scopesNames = scopesPanel.getSelectedScopeNames();
PsModule module = getModule();
if (module instanceof PsAndroidModule) {
PsNewDependencyScopes newScopes = ((AndroidDependencyScopesPanel) scopesPanel).getNewScopes();
assert newScopes != null;
((PsAndroidModule) module).addLibraryDependency(library, newScopes, scopesNames);
} else if (module instanceof PsJavaModule) {
((PsJavaModule) module).addLibraryDependency(library, scopesNames);
}
}
Aggregations