9eb3c7ed76
To snapshot a Java class (+ its fields and methods), previously we used
Gson to serialize a class field/method to a string via reflection, and
hash that string.
We now use an ASM ClassWriter to write a placeholder class containing
the field/method of interest and hash the bytecode of that class.
One experiment showed that this new approach is ~10 times faster than
the previous approach (140s down to 16s when snapshotting 600 jars).
Test: Updated expectation files for JavaClassSnapshotterTest unit tests
+ Existing integration tests to prevent regression
^KT-52141 In Progress
56 lines
1.7 KiB
Kotlin
56 lines
1.7 KiB
Kotlin
|
|
plugins {
|
|
kotlin("jvm")
|
|
id("jps-compatible")
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":core:descriptors"))
|
|
api(project(":core:descriptors.jvm"))
|
|
api(project(":core:deserialization"))
|
|
api(project(":compiler:util"))
|
|
api(project(":compiler:frontend"))
|
|
api(project(":compiler:frontend.java"))
|
|
api(project(":compiler:cli"))
|
|
api(project(":compiler:cli-js"))
|
|
api(project(":compiler:fir:entrypoint"))
|
|
api(project(":compiler:ir.serialization.jvm"))
|
|
api(project(":compiler:backend.jvm.entrypoint"))
|
|
api(project(":kotlin-build-common"))
|
|
api(project(":daemon-common"))
|
|
compileOnly(intellijCore())
|
|
|
|
testApi(commonDependency("junit:junit"))
|
|
testApi(project(":kotlin-test:kotlin-test-junit"))
|
|
testApi(kotlinStdlib())
|
|
testApi(projectTests(":kotlin-build-common"))
|
|
testApi(projectTests(":compiler:tests-common"))
|
|
testApi(intellijCore())
|
|
testApi(commonDependency("org.jetbrains.intellij.deps:log4j"))
|
|
testApi(commonDependency("org.jetbrains.intellij.deps:jdom"))
|
|
|
|
testImplementation(commonDependency("com.google.code.gson:gson"))
|
|
testRuntimeOnly(project(":kotlin-reflect"))
|
|
testRuntimeOnly(project(":core:descriptors.runtime"))
|
|
}
|
|
|
|
sourceSets {
|
|
"main" { projectDefault() }
|
|
"test" { projectDefault() }
|
|
}
|
|
|
|
projectTest(parallel = true) {
|
|
workingDir = rootDir
|
|
dependsOn(":kotlin-stdlib-js-ir:packFullRuntimeKLib")
|
|
}
|
|
|
|
projectTest("testJvmICWithJdk11", parallel = true) {
|
|
workingDir = rootDir
|
|
filter {
|
|
includeTestsMatching("org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunnerTestGenerated*")
|
|
}
|
|
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_11))
|
|
}
|
|
|
|
testsJar()
|