Replace ReadOnly/Mutable usages in the compiler
Replace ones from org.jetbrains.kotlin package with new annotations from kotlin.annotations.jvm. No need to copy them to compile kotlin-reflect anymore. Then simplify reflect project more: no sources — no need to pack its direct output.
This commit is contained in:
@@ -34,15 +34,9 @@ pill {
|
||||
}
|
||||
|
||||
val core = "$rootDir/core"
|
||||
val annotationsSrc = "$buildDir/annotations"
|
||||
val relocatedCoreSrc = "$buildDir/core-relocated"
|
||||
val libsDir = property("libsDir")
|
||||
|
||||
sourceSets {
|
||||
"main" {
|
||||
java.srcDir(annotationsSrc)
|
||||
}
|
||||
}
|
||||
|
||||
val proguardDeps by configurations.creating
|
||||
val shadows by configurations.creating {
|
||||
@@ -55,6 +49,7 @@ dependencies {
|
||||
compile(projectDist(":kotlin-stdlib"))
|
||||
|
||||
proguardDeps(project(":kotlin-stdlib"))
|
||||
proguardDeps(project(":kotlin-annotations-jvm"))
|
||||
proguardDeps(files(firstFromJavaHomeThatExists("jre/lib/rt.jar", "../Classes/classes.jar", jdkHome = File(property("JDK_16") as String))))
|
||||
|
||||
shadows(project(":kotlin-reflect-api"))
|
||||
@@ -69,18 +64,6 @@ dependencies {
|
||||
shadows(project(":custom-dependencies:protobuf-lite", configuration = "default"))
|
||||
}
|
||||
|
||||
val copyAnnotations by task<Sync> {
|
||||
// copy just two missing annotations
|
||||
from("$core/runtime.jvm/src") {
|
||||
include("**/Mutable.java")
|
||||
include("**/ReadOnly.java")
|
||||
}
|
||||
into(annotationsSrc)
|
||||
includeEmptyDirs = false
|
||||
}
|
||||
|
||||
tasks.getByName("compileJava").dependsOn(copyAnnotations)
|
||||
|
||||
class KotlinModuleShadowTransformer(private val logger: Logger) : Transformer {
|
||||
@Suppress("ArrayInDataClass")
|
||||
private data class Entry(val path: String, val bytes: ByteArray)
|
||||
@@ -127,7 +110,6 @@ val reflectShadowJar by task<ShadowJar> {
|
||||
version = null
|
||||
callGroovy("manifestAttributes", manifest, project, "Main", true)
|
||||
|
||||
from(mainSourceSet.output)
|
||||
from(project(":core:descriptors.jvm").mainSourceSet.resources) {
|
||||
include("META-INF/services/**")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user