use of com.android.tools.idea.gradle.editor.entity.VersionGradleEditorEntity in project android by JetBrains.
the class GradleEditorModelParserFacade method buildEntities.
@NotNull
private static List<GradleEditorEntityGroup> buildEntities(@NotNull GradleEditorModelParseContext context) {
VersionGradleEditorEntity entity = GradleEditorModelParserV1.buildGradlePluginVersion(context);
GradleCoordinate androidGradlePluginVersion = null;
if (entity != null) {
String currentVersion = entity.getCurrentValue();
if (!currentVersion.isEmpty()) {
androidGradlePluginVersion = GradleCoordinate.parseVersionOnly(currentVersion);
}
}
if (androidGradlePluginVersion == null) {
androidGradlePluginVersion = GradleCoordinate.parseVersionOnly("0");
}
Comparator<GradleCoordinate> c = GradleCoordinate.COMPARE_PLUS_HIGHER;
for (GradleEditorModelParser parser : ourParsers) {
if (c.compare(androidGradlePluginVersion, parser.getMinSupportedAndroidGradlePluginVersion()) >= 0 && c.compare(androidGradlePluginVersion, parser.getMaxSupportedAndroidGradlePluginVersion()) < 0) {
return parser.buildEntities(context);
}
}
return Collections.emptyList();
}
Aggregations