-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
93 lines (83 loc) · 2.66 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* Copyright 2022 guohaoice@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import kotlinx.benchmark.gradle.benchmark
import kotlinx.benchmark.gradle.benchmarkReportsDir
import org.jetbrains.kotlin.allopen.gradle.AllOpenExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
kotlin("kapt") version "1.6.10"
kotlin("plugin.allopen") version "1.6.10"
id("org.jetbrains.kotlinx.benchmark") version "0.4.1"
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
id("io.morethan.jmhreport") version "0.9.0"
}
group = "io.github.guohao"
version = "1.0.0-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
configure<AllOpenExtension> {
annotation("org.openjdk.jmh.annotations.State")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
kapt("com.dslplatform:dsl-json-java8:1.9.9")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
implementation("com.dslplatform:dsl-json-java8:1.9.9")
implementation("cc.plural:jsonij:0.5.2")
implementation("com.alibaba:fastjson:1.2.79")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.1")
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.1")
}
tasks.test {
useJUnit()
}
benchmark {
configurations {
named("main") {
warmups = 3
iterations = 5
iterationTime = 10000
iterationTimeUnit = "ms"
outputTimeUnit = "ns"
mode = "AverageTime"
}
}
targets {
register("main") {
this as kotlinx.benchmark.gradle.JvmBenchmarkTarget
jmhVersion = "1.29"
}
}
}
jmhReport {
val reportDir =
benchmarkReportsDir(benchmark.configurations.getByName("main"), benchmark.targets.getByName("main"))
jmhResultPath = "$reportDir/main.json"
jmhReportOutput = "$reportDir"
}