1 /*
2  * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 @file:Suppress("UnstableApiUsage")
6 
7 import me.champeau.gradle.*
8 import org.jetbrains.kotlin.gradle.tasks.*
9 
<lambda>null10 plugins {
11     id("net.ltgt.apt")
12     id("com.github.johnrengelman.shadow")
13     id("me.champeau.gradle.jmh") apply false
14 }
15 
<lambda>null16 repositories {
17     maven("https://repo.typesafe.com/typesafe/releases/")
18 }
19 
<lambda>null20 java {
21     sourceCompatibility = JavaVersion.VERSION_1_8
22     targetCompatibility = JavaVersion.VERSION_1_8
23 }
24 
25 apply(plugin="me.champeau.gradle.jmh")
26 
<lambda>null27 tasks.named<KotlinCompile>("compileJmhKotlin") {
28     kotlinOptions {
29         jvmTarget = "1.8"
30         freeCompilerArgs += "-Xjvm-default=enable"
31     }
32 }
33 
34 
35 
36 // It is better to use the following to run benchmarks, otherwise you may get unexpected errors:
37 // ./gradlew --no-daemon cleanJmhJar jmh -Pjmh="MyBenchmark"
<lambda>null38 extensions.configure<JMHPluginExtension>("jmh") {
39     jmhVersion = "1.26"
40     duplicateClassesStrategy = DuplicatesStrategy.INCLUDE
41     failOnError = true
42     resultFormat = "CSV"
43     project.findProperty("jmh")?.also {
44         include = listOf(".*$it.*")
45     }
46 //    includeTests = false
47 }
48 
<lambda>null49 tasks.named<Jar>("jmhJar") {
50     archiveBaseName by "benchmarks"
51     archiveClassifier by null
52     archiveVersion by null
53     destinationDirectory.file("$rootDir")
54 }
55 
<lambda>null56 dependencies {
57     compile("org.openjdk.jmh:jmh-core:1.26")
58     compile("io.projectreactor:reactor-core:${version("reactor")}")
59     compile("io.reactivex.rxjava2:rxjava:2.1.9")
60     compile("com.github.akarnokd:rxjava2-extensions:0.20.8")
61 
62     compile("com.typesafe.akka:akka-actor_2.12:2.5.0")
63     compile(project(":kotlinx-coroutines-core"))
64 
65     // add jmh dependency on main
66     "jmhImplementation"(sourceSets.main.get().runtimeClasspath)
67 }
68