-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
59 lines (49 loc) · 1.22 KB
/
build.gradle
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
plugins {
id 'java'
id 'maven-publish'
id 'application'
id "me.champeau.gradle.jmh" version "0.5.2"
id "io.morethan.jmhreport" version "0.9.0"
}
//sourceCompatibility = 1.8
sourceCompatibility = 11
group 'org.example'
version '1.0-SNAPSHOT'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenLocal()
mavenCentral()
}
ext {
jmhVersion = "1.28"
}
// ./gradlew jmhReport
jmhReport {
jmhResultPath = project.file('build/reports/jmh/results.json')
jmhReportOutput = project.file('build/reports/jmh')
// finalizedBy 'jmh'
}
task jmhJson {
doFirst {
jmh.resultFormat="JSON"
}
finalizedBy 'jmh'
}
sourceSets {
generated {
java {
srcDir "$projectDir/jmh/generated"
}
}
}
dependencies {
implementation "org.apache.commons:commons-lang3:3.8.1"
implementation "org.openjdk.jmh:jmh-core:${jmhVersion}"
compileOnly "org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}"
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
mainClassName = 'com.home.samples.BenchmarkRunner'
tasks.jmhJson.finalizedBy tasks.jmhReport