Files
kotlin-fork/idea/performanceTests/build.gradle.kts
T
2020-05-01 12:35:38 +02:00

112 lines
3.6 KiB
Kotlin

description = "Kotlin IDE Performance Tests"
plugins {
kotlin("jvm")
id("jps-compatible")
}
dependencies {
testRuntimeOnly(intellijDep())
testRuntimeOnly(intellijRuntimeAnnotations())
testRuntimeOnly(toolsJar())
testRuntimeOnly(project(":kotlin-reflect"))
testRuntimeOnly(project(":plugins:android-extensions-ide"))
testRuntimeOnly(project(":plugins:kapt3-idea"))
testRuntimeOnly(project(":sam-with-receiver-ide-plugin"))
testRuntimeOnly(project(":noarg-ide-plugin"))
testRuntimeOnly(project(":allopen-ide-plugin"))
testRuntimeOnly(project(":kotlin-scripting-idea"))
testRuntimeOnly(project(":kotlinx-serialization-ide-plugin"))
testRuntimeOnly(project(":nj2k:nj2k-services"))
testRuntimeOnly(project(":kotlin-reflect"))
testRuntimeOnly(project(":idea:kotlin-gradle-tooling"))
Platform[193].orLower {
testRuntimeOnly(project(":idea:idea-gradle-tooling-api"))
}
testRuntimeOnly(project(":kotlin-gradle-statistics"))
testImplementation(intellijPluginDep("gradle"))
testImplementation(project(":compiler:backend"))
testImplementation(project(":idea:idea-jvm"))
testImplementation(project(":kotlin-test:kotlin-test-junit"))
testImplementation(projectTests(":compiler:tests-common"))
testImplementation(projectTests(":idea:idea-test-framework")) { isTransitive = false }
testImplementation(projectTests(":idea"))
testImplementation(project(":idea:idea-gradle")) { isTransitive = false }
testImplementation(commonDep("junit:junit"))
Platform[192].orHigher {
testCompileOnly(intellijPluginDep("java"))
testRuntimeOnly(intellijPluginDep("java"))
}
Platform[193].orHigher {
testImplementation(intellijPluginDep("gradle-java"))
testRuntimeOnly(intellijPluginDep("gradle-java"))
}
testCompileOnly(intellijDep())
testCompileOnly(project(":nj2k"))
Platform[193].orLower {
testCompileOnly(project(":idea:idea-gradle-tooling-api"))
}
testCompileOnly(intellijDep()) { includeJars("slf4j-api-1.7.25") }
}
sourceSets {
"test" { projectDefault() }
}
runtimeJar()
sourcesJar()
javadocJar()
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
projectTest(taskName = "performanceTest") {
val currentOs = org.gradle.internal.os.OperatingSystem.current()
if (!currentOs.isWindows) {
System.getenv("ASYNC_PROFILER_HOME")?.let { asyncProfilerHome ->
classpath += files("$asyncProfilerHome/build/async-profiler.jar")
}
}
workingDir = rootDir
jvmArgs?.removeAll { it.startsWith("-Xmx") }
maxHeapSize = "3g"
jvmArgs("-Didea.debug.mode=true")
jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=50")
jvmArgs(
"-XX:ReservedCodeCacheSize=240m",
"-XX:+UseCompressedOops",
"-XX:+UseConcMarkSweepGC"
)
System.getenv("YOURKIT_PROFILER_HOME")?.let {yourKitHome ->
when {
currentOs.isLinux -> {
jvmArgs("-agentpath:$yourKitHome/bin/linux-x86-64/libyjpagent.so")
classpath += files("$yourKitHome/lib/yjp-controller-api-redist.jar")
}
currentOs.isMacOsX -> {
jvmArgs("-agentpath:$yourKitHome/Contents/Resources/bin/mac/libyjpagent.dylib")
classpath += files("$yourKitHome/Contents/Resources/lib/yjp-controller-api-redist.jar")
}
}
}
doFirst {
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
project.findProperty("cacheRedirectorEnabled")?.let {
systemProperty("kotlin.test.gradle.import.arguments", "-PcacheRedirectorEnabled=$it")
}
}
}
testsJar()