mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
[FIR] Add opt-in annotation which prevents from using symbol.fir
This commit is contained in:
committed by
teamcityserver
parent
c99a02796f
commit
e94d75d433
26
compiler/fir/build.gradle.kts
Normal file
26
compiler/fir/build.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
val projectsAllowedToUseFirFromSymbol = listOf(
|
||||
"analysis-tests",
|
||||
"dump",
|
||||
"fir-deserialization",
|
||||
"fir-serialization",
|
||||
"fir2ir",
|
||||
"java",
|
||||
"jvm",
|
||||
"raw-fir",
|
||||
"resolve",
|
||||
"tree",
|
||||
"jvm-backend",
|
||||
"light-tree2fir",
|
||||
"psi2fir",
|
||||
"raw-fir.common"
|
||||
)
|
||||
|
||||
subprojects {
|
||||
if (name in projectsAllowedToUseFirFromSymbol) {
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xopt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
abstract class FirBasedSymbol<E : FirDeclaration> {
|
||||
private var _fir: E? = null
|
||||
|
||||
@SymbolInternals
|
||||
val fir: E
|
||||
get() = _fir
|
||||
?: error("Fir is not initialized for $this")
|
||||
@@ -30,3 +31,6 @@ abstract class FirBasedSymbol<E : FirDeclaration> {
|
||||
val moduleData: FirModuleData
|
||||
get() = fir.moduleData
|
||||
}
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class SymbolInternals
|
||||
|
||||
@@ -14,3 +14,9 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" { }
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xopt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,13 @@ projectTest(jUnit5Enabled = true) {
|
||||
|
||||
testsJar()
|
||||
|
||||
allprojects {
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xopt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val generatorClasspath by configurations.creating
|
||||
|
||||
|
||||
@@ -262,7 +262,8 @@ include ":benchmarks",
|
||||
":wasm:wasm.ir"
|
||||
|
||||
|
||||
include ":compiler:fir:cones",
|
||||
include ":compiler:fir",
|
||||
":compiler:fir:cones",
|
||||
":compiler:fir:tree",
|
||||
":compiler:fir:tree:tree-generator",
|
||||
":compiler:fir:raw-fir:raw-fir.common",
|
||||
|
||||
Reference in New Issue
Block a user