Search in sources :

Example 11 with ArtifactDependencySpec

use of com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencySpec in project android by JetBrains.

the class GradleBuildModelFixture method requireDependency.

public void requireDependency(@NotNull String configurationName, @NotNull ArtifactDependencySpec expected) {
    DependenciesModel dependenciesModel = myTarget.dependencies();
    for (ArtifactDependencyModel dependency : dependenciesModel.artifacts()) {
        ArtifactDependencySpec actual = ArtifactDependencySpec.create(dependency);
        if (configurationName.equals(dependency.configurationName()) && expected.equals(actual)) {
            return;
        }
    }
    fail("Failed to find dependency '" + expected.compactNotation() + "'");
}
Also used : ArtifactDependencyModel(com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencyModel) DependenciesModel(com.android.tools.idea.gradle.dsl.model.dependencies.DependenciesModel) ArtifactDependencySpec(com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencySpec)

Aggregations

ArtifactDependencySpec (com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencySpec)11 ArtifactDependencyModel (com.android.tools.idea.gradle.dsl.model.dependencies.ArtifactDependencyModel)4 EditorFixture (com.android.tools.idea.tests.gui.framework.fixture.EditorFixture)4 GradleBuildModelFixture (com.android.tools.idea.tests.gui.framework.fixture.gradle.GradleBuildModelFixture)4 Test (org.junit.Test)4 GradleBuildModel (com.android.tools.idea.gradle.dsl.model.GradleBuildModel)3 DependenciesModel (com.android.tools.idea.gradle.dsl.model.dependencies.DependenciesModel)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 GradleVersion (com.android.ide.common.repository.GradleVersion)2 Project (com.intellij.openapi.project.Project)2 File (java.io.File)2 Nullable (org.jetbrains.annotations.Nullable)2 GradleCoordinate (com.android.ide.common.repository.GradleCoordinate)1 GradleBuildModel.parseBuildFile (com.android.tools.idea.gradle.dsl.model.GradleBuildModel.parseBuildFile)1 WriteCommandAction (com.intellij.openapi.command.WriteCommandAction)1 VfsUtil.findFileByIoFile (com.intellij.openapi.vfs.VfsUtil.findFileByIoFile)1 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)1 IOException (java.io.IOException)1 GroovyFile (org.jetbrains.plugins.groovy.lang.psi.GroovyFile)1