diff --git a/compiler/fir/tree/build.gradle.kts b/compiler/fir/tree/build.gradle.kts index a261ca6eb99..713bdb7d320 100644 --- a/compiler/fir/tree/build.gradle.kts +++ b/compiler/fir/tree/build.gradle.kts @@ -6,6 +6,7 @@ plugins { } dependencies { + api(project(":core:descriptors.jvm")) api(project(":compiler:frontend.common")) api(project(":compiler:fir:cones")) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt index 746bef87819..86deb035b3f 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt @@ -17,7 +17,6 @@ import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.TestServices import org.jetbrains.kotlin.test.services.globalMetadataInfoHandler -import org.jetbrains.kotlin.load.java.getReportLevelForAnnotation // Not that this diagnostic handler should be included only with `ClassicDiagnosticsHandler` and go after it class JspecifyDiagnosticComplianceHandler(testServices: TestServices) : ClassicFrontendAnalysisHandler(testServices) { diff --git a/core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt similarity index 100% rename from core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt rename to core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationSettings.kt diff --git a/core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationsStatus.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationsStatus.kt similarity index 100% rename from core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationsStatus.kt rename to core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaNullabilityAnnotationsStatus.kt diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaTypeEnhancementState.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaTypeEnhancementState.kt new file mode 100644 index 00000000000..367c895bb1e --- /dev/null +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JavaTypeEnhancementState.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.load.java + +import org.jetbrains.kotlin.name.FqName + +class JavaTypeEnhancementState( + val jsr305: Jsr305Settings = Jsr305Settings.DEFAULT, + val getReportLevelForAnnotation: (FqName) -> ReportLevel = ::getDefaultReportLevelForAnnotation +) { + val disabledDefaultAnnotations = jsr305.isDisabled || getReportLevelForAnnotation(JSPECIFY_ANNOTATIONS_PACKAGE) == ReportLevel.IGNORE + + companion object { + val DEFAULT = JavaTypeEnhancementState() + } +} diff --git a/core/util.runtime/src/org/jetbrains/kotlin/load/java/Jsr305Settings.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/Jsr305Settings.kt similarity index 100% rename from core/util.runtime/src/org/jetbrains/kotlin/load/java/Jsr305Settings.kt rename to core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/Jsr305Settings.kt diff --git a/core/util.runtime/src/org/jetbrains/kotlin/load/java/ReportLevel.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/ReportLevel.kt similarity index 100% rename from core/util.runtime/src/org/jetbrains/kotlin/load/java/ReportLevel.kt rename to core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/ReportLevel.kt diff --git a/core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaTypeEnhancementState.kt b/core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaTypeEnhancementState.kt deleted file mode 100644 index bd5ba4a5ba0..00000000000 --- a/core/util.runtime/src/org/jetbrains/kotlin/load/java/JavaTypeEnhancementState.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.load.java - -import org.jetbrains.kotlin.name.FqName - -class JavaTypeEnhancementState( - val jsr305: Jsr305Settings = Jsr305Settings.DEFAULT, - val getReportLevelForAnnotation: (FqName) -> ReportLevel = ::getDefaultReportLevelForAnnotation -) { - val disabledDefaultAnnotations = jsr305.isDisabled || getReportLevelForAnnotation(JSPECIFY_ANNOTATIONS_PACKAGE) == ReportLevel.IGNORE - - companion object { - val DEFAULT = JavaTypeEnhancementState() - } -}