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:
Ilya Gorbunov
2017-12-05 17:30:29 +03:00
parent 1bfb75a51b
commit 2a598e0ac4
29 changed files with 31 additions and 42 deletions
+1 -19
View File
@@ -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/**")
}