Search in sources :

Example 21 with Variant

use of com.android.builder.model.Variant in project android by JetBrains.

the class AndroidModuleModelTest method testGetSelectedVariant.

public void testGetSelectedVariant() throws Exception {
    Variant selectedVariant = myAndroidModel.getSelectedVariant();
    assertNotNull(selectedVariant);
    assertSame(myAndroidProject.getFirstVariant(), selectedVariant);
}
Also used : Variant(com.android.builder.model.Variant)

Example 22 with Variant

use of com.android.builder.model.Variant in project android by JetBrains.

the class VariantSelectorTest method findVariantToSelectWithDebugVariant.

@Test
public void findVariantToSelectWithDebugVariant() {
    Variant debugVariant = mock(Variant.class);
    Variant releaseVariant = mock(Variant.class);
    when(myAndroidProject.getVariants()).thenReturn(Lists.newArrayList(debugVariant, releaseVariant));
    when(debugVariant.getName()).thenReturn("debug");
    when(releaseVariant.getName()).thenReturn("release");
    Variant variant = myVariantSelector.findVariantToSelect(myAndroidProject);
    assertSame(debugVariant, variant);
}
Also used : Variant(com.android.builder.model.Variant) Test(org.junit.Test)

Example 23 with Variant

use of com.android.builder.model.Variant in project android by JetBrains.

the class VariantSelectorTest method getVariantToSelectWithoutVariants.

@Test
public void getVariantToSelectWithoutVariants() {
    when(myAndroidProject.getVariants()).thenReturn(Collections.emptyList());
    Variant variant = myVariantSelector.findVariantToSelect(myAndroidProject);
    assertNull(variant);
}
Also used : Variant(com.android.builder.model.Variant) Test(org.junit.Test)

Aggregations

Variant (com.android.builder.model.Variant)23 AndroidModuleModel (com.android.tools.idea.gradle.project.model.AndroidModuleModel)8 AndroidProject (com.android.builder.model.AndroidProject)6 File (java.io.File)6 Module (com.intellij.openapi.module.Module)5 NotNull (org.jetbrains.annotations.NotNull)5 AndroidLibrary (com.android.builder.model.AndroidLibrary)4 OutputFile (com.android.build.OutputFile)3 AndroidArtifact (com.android.builder.model.AndroidArtifact)3 AndroidArtifactOutput (com.android.builder.model.AndroidArtifactOutput)3 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 Nullable (org.jetbrains.annotations.Nullable)3 NonNull (com.android.annotations.NonNull)2 TestedTargetVariant (com.android.builder.model.TestedTargetVariant)2 GradleVersion (com.android.ide.common.repository.GradleVersion)2 VariantCheckboxTreeCellRenderer (com.android.tools.idea.gradle.variant.ui.VariantCheckboxTreeCellRenderer)2 ModuleManager (com.intellij.openapi.module.ModuleManager)2 CheckboxTree (com.intellij.ui.CheckboxTree)2 CheckedTreeNode (com.intellij.ui.CheckedTreeNode)2 IOException (java.io.IOException)2