mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
In 203.8084.24 this jar was moved from intellij dependencies to libraries of intellij java plugin
42 lines
1.5 KiB
Kotlin
42 lines
1.5 KiB
Kotlin
/*
|
|
* Copyright 2010-2018 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.
|
|
*/
|
|
|
|
allprojects {
|
|
afterEvaluate {
|
|
configureJavaInstrumentation()
|
|
}
|
|
}
|
|
|
|
// Hide window of instrumentation tasks
|
|
val headlessOldValue: String? = System.setProperty("java.awt.headless", "true")
|
|
logger.info("Setting java.awt.headless=true, old value was $headlessOldValue")
|
|
|
|
/**
|
|
* Configures instrumentation for all JavaCompile tasks in project
|
|
*/
|
|
fun Project.configureJavaInstrumentation() {
|
|
if (plugins.hasPlugin("org.gradle.java")) {
|
|
val javaInstrumentator by configurations.creating
|
|
dependencies {
|
|
Platform[202] {
|
|
javaInstrumentator(intellijDep()) {
|
|
includeJars("javac2", "jdom", "asm-all", rootProject = rootProject)
|
|
}
|
|
}
|
|
Platform[203].orHigher {
|
|
javaInstrumentator(intellijDep()) {
|
|
includeJars("jdom", "asm-all", rootProject = rootProject)
|
|
}
|
|
javaInstrumentator(intellijPluginDep("java")) {
|
|
includeJars("javac2", rootProject = rootProject)
|
|
}
|
|
}
|
|
}
|
|
for (sourceSet in listOf(mainSourceSet, testSourceSet)) {
|
|
tasks.named(sourceSet.compileJavaTaskName, InstrumentJava(javaInstrumentator, sourceSet))
|
|
}
|
|
}
|
|
}
|