use of com.android.tools.idea.gradle.structure.dependencies.android.Configuration in project android by JetBrains.
the class AndroidDependencyScopesPanel method validateInput.
@Override
@Nullable
public ValidationInfo validateInput() {
List<Configuration> configurations = myConfigurationsPanel.getSelectedConfigurations();
if (configurations.isEmpty()) {
return new ValidationInfo("Please select at least one configuration", myConfigurationsPanel);
}
List<PsBuildType> buildTypes = myBuildTypesPanel.getSelectedBuildTypes();
if (buildTypes.isEmpty()) {
return new ValidationInfo("Please select at least one build type", myBuildTypesPanel);
}
if (mySelectedScopeNames.isEmpty()) {
if (configurations.size() == 1 && configurations.contains(ANDROID_TEST)) {
boolean hasDebugBuildType = false;
for (PsBuildType buildType : buildTypes) {
if (buildType.getName().equals(DEBUG_BUILD_TYPE)) {
hasDebugBuildType = true;
break;
}
}
if (!hasDebugBuildType) {
return new ValidationInfo("For 'Android Tests', the 'debug' build type must be selected", myBuildTypesPanel);
}
}
}
return null;
}
Aggregations