use of com.android.tools.idea.gradle.stubs.android.ProductFlavorContainerStub in project android by JetBrains.
the class ContentRootSourcePaths method storeExpectedSourcePaths.
/**
* Stores the expected paths of all the source and test directories in the given {@code AndroidProject}.
*
* @param androidProject the given {@code AndroidProject}.
*/
public void storeExpectedSourcePaths(@NotNull AndroidProjectStub androidProject) {
VariantStub selectedVariant = androidProject.getFirstVariant();
Assert.assertNotNull(selectedVariant);
addGeneratedDirPaths(selectedVariant);
for (String flavorName : selectedVariant.getProductFlavors()) {
ProductFlavorContainerStub flavor = androidProject.findProductFlavor(flavorName);
if (flavor != null) {
addSourceDirPaths(flavor);
}
}
String buildTypeName = selectedVariant.getBuildType();
BuildTypeContainer buildType = androidProject.findBuildType(buildTypeName);
if (buildType != null) {
addSourceDirPaths(buildType.getSourceProvider(), false);
}
addSourceDirPaths(androidProject.getDefaultConfig());
}
Aggregations