Import of middle HMPP target platforms is supported

This commit is contained in:
Andrey Uskov
2019-06-04 01:55:30 +03:00
parent c0594c2ee3
commit c0bf5a6566
28 changed files with 316 additions and 103 deletions
@@ -37,7 +37,7 @@ class FrameworkLibraryValidatorWithDynamicDescription(
private val context: LibrariesValidatorContext,
private val validatorsManager: FacetValidatorsManager,
private val libraryCategoryName: String,
private val getPlatform: () -> TargetPlatform
private val getPlatform: () -> TargetPlatform?
) : FrameworkLibraryValidator() {
private val IdePlatformKind<*>.libraryDescription: CustomLibraryDescription?
get() = this.tooling.getLibraryDescription(context.module.project)
@@ -69,7 +69,7 @@ class FrameworkLibraryValidatorWithDynamicDescription(
}
override fun check(): ValidationResult {
val targetPlatform = getPlatform()
val targetPlatform = getPlatform() ?: return ValidationResult("No target platforms selected")
if (checkLibraryIsConfigured(targetPlatform.idePlatformKind)) {
val conflictingPlatforms = IdePlatformKind.ALL_KINDS
@@ -28,6 +28,6 @@ class KotlinLibraryValidatorCreator : KotlinFacetValidatorCreator() {
DelegatingLibrariesValidatorContext(editorContext),
validatorsManager,
"kotlin"
) { editor.chosenPlatform!! }
) { editor.getChosenPlatform() }
}
}