use of com.android.tools.idea.gradle.project.sync.setup.module.dependency.DependencySet in project android by JetBrains.
the class TestArtifactSearchScopes method getExcludedDependenciesScope.
@NotNull
private FileRootSearchScope getExcludedDependenciesScope(@NotNull String artifactName) {
if (getAndroidModel() == null) {
return new FileRootSearchScope(myModule.getProject(), Collections.emptyList());
}
resolveDependencies();
boolean isAndroidTest = ARTIFACT_ANDROID_TEST.equals(artifactName);
DependencySet dependenciesToInclude = isAndroidTest ? androidTestDependencies : unitTestDependencies;
DependencySet dependenciesToExclude = isAndroidTest ? unitTestDependencies : androidTestDependencies;
ExcludedModules excludedModules = new ExcludedModules(myModule);
excludedModules.add(dependenciesToExclude);
excludedModules.remove(dependenciesToInclude);
excludedModules.remove(mainDependencies);
ExcludedRoots excludedRoots = new ExcludedRoots(myModule, excludedModules, dependenciesToExclude, dependenciesToInclude, isAndroidTest);
excludedRoots.removeLibraryPaths(mainDependencies);
return new FileRootSearchScope(myModule.getProject(), excludedRoots.get());
}
use of com.android.tools.idea.gradle.project.sync.setup.module.dependency.DependencySet in project android by JetBrains.
the class DependenciesModuleSetupStep method doSetUpModule.
@Override
protected void doSetUpModule(@NotNull Module module, @NotNull IdeModifiableModelsProvider ideModelsProvider, @NotNull AndroidModuleModel androidModel, @Nullable SyncAction.ModuleModels gradleModels, @Nullable ProgressIndicator indicator) {
AndroidProject androidProject = androidModel.getAndroidProject();
DependencySet dependencies = myDependenciesExtractor.extractFrom(androidModel);
for (LibraryDependency dependency : dependencies.onLibraries()) {
updateLibraryDependency(module, ideModelsProvider, dependency, androidProject);
}
for (ModuleDependency dependency : dependencies.onModules()) {
updateModuleDependency(module, ideModelsProvider, dependency, androidProject);
}
addExtraSdkLibrariesAsDependencies(module, ideModelsProvider, androidProject);
Collection<SyncIssue> syncIssues = androidModel.getSyncIssues();
if (syncIssues != null) {
SyncIssuesReporter.getInstance().report(syncIssues, module);
} else {
//noinspection deprecation
Collection<String> unresolvedDependencies = androidProject.getUnresolvedDependencies();
UnresolvedDependenciesReporter.getInstance().report(unresolvedDependencies, module);
}
}
Aggregations