From ed4c6a38b6b604a89d37ef6e16d9afd341a3116d Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 28 Aug 2020 12:08:17 +0300 Subject: [PATCH] [FIR] Move deserialization files to module :compiler:fir:fir-deserialization --- build.gradle.kts | 1 + .../fir/fir-deserialization/build.gradle.kts | 21 +++++++++++++++++++ .../AbstractAnnotationDeserializer.kt | 4 ++-- .../deserialization/ClassDeserialization.kt | 3 +-- .../FirBuiltinAnnotationDeserializer.kt | 6 +++--- .../deserialization/FirConstDeserializer.kt | 0 .../FirContractDeserializer.kt | 4 ++-- .../deserialization/FirMemberDeserializer.kt | 2 +- .../fir/deserialization/FirProtoEnumFlags.kt | 0 .../deserialization/FirTypeDeserializer.kt | 2 +- .../fir/deserialization/suspendTypeUtils.kt | 0 .../impl/FirBuiltinSymbolProvider.kt | 0 .../fir/fir-serialization/build.gradle.kts | 2 ++ compiler/fir/java/build.gradle.kts | 1 + compiler/tests-common/build.gradle.kts | 1 + prepare/idea-plugin/build.gradle.kts | 1 + settings.gradle | 1 + 17 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 compiler/fir/fir-deserialization/build.gradle.kts rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt (98%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt (98%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt (79%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/FirConstDeserializer.kt (100%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt (99%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt (99%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/FirProtoEnumFlags.kt (100%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt (99%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/deserialization/suspendTypeUtils.kt (100%) rename compiler/fir/{resolve => fir-deserialization}/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirBuiltinSymbolProvider.kt (100%) diff --git a/build.gradle.kts b/build.gradle.kts index d45da29c817..b09b3bbe78a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -275,6 +275,7 @@ extra["compilerModules"] = arrayOf( ":compiler:fir:cones", ":compiler:fir:resolve", ":compiler:fir:fir-serialization", + ":compiler:fir:fir-deserialization", ":compiler:fir:tree", ":compiler:fir:raw-fir:raw-fir.common", ":compiler:fir:raw-fir:psi2fir", diff --git a/compiler/fir/fir-deserialization/build.gradle.kts b/compiler/fir/fir-deserialization/build.gradle.kts new file mode 100644 index 00000000000..a2d85a14ac3 --- /dev/null +++ b/compiler/fir/fir-deserialization/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + implementation(project(":core:descriptors")) + implementation(project(":core:descriptors.jvm")) + implementation(project(":core:deserialization")) + + api(project(":compiler:fir:cones")) + api(project(":compiler:fir:tree")) + api(project(":compiler:fir:resolve")) + + compileOnly(intellijCoreDep()) { includeJars("intellij-core", rootProject = rootProject) } +} + +sourceSets { + "main" { projectDefault() } + "test" { none() } +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt similarity index 98% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt index 998c1a343c6..3d260dc5a78 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt @@ -1,6 +1,6 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the license/LICENSE.txt file. + * Copyright 2010-2020 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.fir.deserialization diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt similarity index 98% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt index 58311b74a91..5abc355d207 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 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. */ @@ -18,7 +18,6 @@ import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvide import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvider.Companion.CLONEABLE_CLASS_ID import org.jetbrains.kotlin.fir.resolve.transformers.sealedInheritors import org.jetbrains.kotlin.fir.scopes.FirScopeProvider -import org.jetbrains.kotlin.fir.scopes.KotlinScopeProvider import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt similarity index 79% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt index d3bcec605b7..57a1c65efc0 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirBuiltinAnnotationDeserializer.kt @@ -1,6 +1,6 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the license/LICENSE.txt file. + * Copyright 2010-2020 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.fir.deserialization @@ -20,4 +20,4 @@ class FirBuiltinAnnotationDeserializer( val annotations = typeProto.getExtension(protocol.typeAnnotation).orEmpty() return annotations.map { deserializeAnnotation(it, nameResolver) } } -} \ No newline at end of file +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirConstDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirConstDeserializer.kt similarity index 100% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirConstDeserializer.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirConstDeserializer.kt diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt similarity index 99% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt index cd69f9a1bbf..75cac7d21e1 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirContractDeserializer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 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. */ @@ -226,4 +226,4 @@ class FirContractDeserializer(private val c: FirDeserializationContext) { OR_SEQUENCE } -} \ No newline at end of file +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt similarity index 99% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt index 90f5b14babc..3f0550f7fd2 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 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. */ diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirProtoEnumFlags.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirProtoEnumFlags.kt similarity index 100% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirProtoEnumFlags.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirProtoEnumFlags.kt diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt similarity index 99% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt index dd8f52136cd..5b8b514cf98 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 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. */ diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/suspendTypeUtils.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/suspendTypeUtils.kt similarity index 100% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/suspendTypeUtils.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/suspendTypeUtils.kt diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirBuiltinSymbolProvider.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirBuiltinSymbolProvider.kt similarity index 100% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirBuiltinSymbolProvider.kt rename to compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirBuiltinSymbolProvider.kt diff --git a/compiler/fir/fir-serialization/build.gradle.kts b/compiler/fir/fir-serialization/build.gradle.kts index 1c49e07f037..59269c80e89 100644 --- a/compiler/fir/fir-serialization/build.gradle.kts +++ b/compiler/fir/fir-serialization/build.gradle.kts @@ -8,6 +8,8 @@ dependencies { compile(project(":compiler:fir:cones")) compile(project(":compiler:fir:tree")) compile(project(":compiler:fir:resolve")) + implementation(project(":compiler:fir:fir-deserialization")) + implementation(project(":core:deserialization")) compileOnly(intellijCoreDep()) { includeJars("intellij-core", rootProject = rootProject) } } diff --git a/compiler/fir/java/build.gradle.kts b/compiler/fir/java/build.gradle.kts index 633bb9f341e..a07e1f6e618 100644 --- a/compiler/fir/java/build.gradle.kts +++ b/compiler/fir/java/build.gradle.kts @@ -10,6 +10,7 @@ dependencies { compile(project(":compiler:fir:resolve")) compile(project(":compiler:fir:checkers")) implementation(project(":compiler:fir:jvm")) + api(project(":compiler:fir:fir-deserialization")) compileOnly(intellijCoreDep()) { includeJars("intellij-core") } } diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index e9aef26e052..654d7f4cef5 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { testCompile(project(":compiler:fir:jvm")) testCompile(project(":compiler:fir:fir2ir:jvm-backend")) testCompile(project(":compiler:fir:fir-serialization")) + testCompile(project(":compiler:fir:fir-deserialization")) testCompile(project(":compiler:fir:cones")) testCompile(project(":compiler:fir:resolve")) testCompile(project(":compiler:fir:checkers")) diff --git a/prepare/idea-plugin/build.gradle.kts b/prepare/idea-plugin/build.gradle.kts index 2e684d6be52..b5094636b05 100644 --- a/prepare/idea-plugin/build.gradle.kts +++ b/prepare/idea-plugin/build.gradle.kts @@ -45,6 +45,7 @@ val projectsToShadow by extra(listOf( ":compiler:fir:checkers", ":compiler:fir:resolve", ":compiler:fir:fir-serialization", + ":compiler:fir:fir-deserialization", ":compiler:fir:tree", ":compiler:fir:java", ":compiler:fir:jvm", diff --git a/settings.gradle b/settings.gradle index d319e3e3e69..35a899a29c6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -306,6 +306,7 @@ include ":compiler:fir:cones", ":compiler:fir:fir2ir:jvm-backend", ":compiler:fir:resolve", ":compiler:fir:fir-serialization", + ":compiler:fir:fir-deserialization", ":compiler:fir:java", ":compiler:fir:modularized-tests", ":compiler:fir:dump",