use of com.android.builder.model.ProductFlavorContainer in project android by JetBrains.
the class IdeaSourceProviderTest method testSourceProviderContainsFile.
public void testSourceProviderContainsFile() throws Exception {
assertNotNull(myAppFacet.getAndroidModel());
ProductFlavorContainer paidFlavor = AndroidModuleModel.get(myAppFacet).findProductFlavor("paid");
assertNotNull(paidFlavor);
IdeaSourceProvider paidFlavorSourceProvider = IdeaSourceProvider.create(paidFlavor.getSourceProvider());
assertNotNull(paidFlavorSourceProvider);
VirtualFile moduleFile = myAppFacet.getAndroidModel().getRootDir();
assertNotNull(moduleFile);
VirtualFile javaSrcFile = moduleFile.findFileByRelativePath("src/paid/java/com/example/projectwithappandlib/app/paid");
assertNotNull(javaSrcFile);
assertTrue(paidFlavorSourceProvider.containsFile(javaSrcFile));
VirtualFile javaMainSrcFile = moduleFile.findFileByRelativePath("src/main/java/com/example/projectwithappandlib/");
assertNotNull(javaMainSrcFile);
assertFalse(paidFlavorSourceProvider.containsFile(javaMainSrcFile));
}
use of com.android.builder.model.ProductFlavorContainer in project android by JetBrains.
the class AndroidModuleModelTest method testFindProductFlavor.
public void testFindProductFlavor() throws Exception {
String flavorName = "fa";
ProductFlavorContainer flavor = myAndroidModel.findProductFlavor(flavorName);
assertNotNull(flavor);
assertSame(myAndroidProject.findProductFlavor(flavorName), flavor);
}
Aggregations