Search in sources :

Example 1 with JarLibraryDependency

use of com.android.tools.idea.gradle.model.java.JarLibraryDependency in project android by JetBrains.

the class PsJavaDependencyCollection method addDependencies.

private void addDependencies() {
    PsParsedDependencies parsedDependencies = myParent.getParsedDependencies();
    JavaModuleModel gradleModel = myParent.getGradleModel();
    for (JarLibraryDependency libraryDependency : gradleModel.getJarLibraryDependencies()) {
        GradleModuleVersion moduleVersion = libraryDependency.getModuleVersion();
        if (moduleVersion != null) {
            PsArtifactDependencySpec spec = PsArtifactDependencySpec.create(moduleVersion);
            ArtifactDependencyModel parsed = parsedDependencies.findLibraryDependency(moduleVersion);
            PsLibraryJavaDependency dependency = new PsLibraryJavaDependency(myParent, spec, libraryDependency, parsed);
            myLibraryDependenciesBySpec.put(spec.toString(), dependency);
        }
    }
}
Also used : JavaModuleModel(com.android.tools.idea.gradle.project.model.JavaModuleModel) JarLibraryDependency(com.android.tools.idea.gradle.model.java.JarLibraryDependency) PsArtifactDependencySpec(com.android.tools.idea.gradle.structure.model.PsArtifactDependencySpec) ArtifactDependencyModel(com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencyModel) PsParsedDependencies(com.android.tools.idea.gradle.structure.model.PsParsedDependencies) GradleModuleVersion(org.gradle.tooling.model.GradleModuleVersion)

Example 2 with JarLibraryDependency

use of com.android.tools.idea.gradle.model.java.JarLibraryDependency in project android by JetBrains.

the class DependenciesModuleSetupStep method doSetUpModule.

@Override
protected void doSetUpModule(@NotNull Module module, @NotNull IdeModifiableModelsProvider ideModelsProvider, @NotNull JavaModuleModel javaModuleModel, @Nullable SyncAction.ModuleModels gradleModels, @Nullable ProgressIndicator indicator) {
    List<String> unresolved = new ArrayList<>();
    for (JavaModuleDependency dependency : javaModuleModel.getJavaModuleDependencies()) {
        updateDependency(module, ideModelsProvider, dependency);
    }
    for (JarLibraryDependency dependency : javaModuleModel.getJarLibraryDependencies()) {
        if (dependency.isResolved()) {
            updateDependency(module, ideModelsProvider, dependency);
        } else {
            unresolved.add(dependency.getName());
        }
    }
    UnresolvedDependenciesReporter.getInstance().report(unresolved, module);
}
Also used : JarLibraryDependency(com.android.tools.idea.gradle.model.java.JarLibraryDependency) ArrayList(java.util.ArrayList) JavaModuleDependency(com.android.tools.idea.gradle.model.java.JavaModuleDependency)

Aggregations

JarLibraryDependency (com.android.tools.idea.gradle.model.java.JarLibraryDependency)2 ArtifactDependencyModel (com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencyModel)1 JavaModuleDependency (com.android.tools.idea.gradle.model.java.JavaModuleDependency)1 JavaModuleModel (com.android.tools.idea.gradle.project.model.JavaModuleModel)1 PsArtifactDependencySpec (com.android.tools.idea.gradle.structure.model.PsArtifactDependencySpec)1 PsParsedDependencies (com.android.tools.idea.gradle.structure.model.PsParsedDependencies)1 ArrayList (java.util.ArrayList)1 GradleModuleVersion (org.gradle.tooling.model.GradleModuleVersion)1