-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
46 lines (38 loc) · 1.01 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
plugins {
id 'java'
}
version = '0.1.0'
group = 'com.oblac'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.jodd:jodd-core:5.1.5'
implementation 'org.openjdk.jmh:jmh-core:1.37'
annotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
}
compileJava {
sourceCompatibility = '11'
targetCompatibility = '11'
options.debug = true
options.fork = true
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:-options"
options.incremental = true
}
task jmh(type:JavaExec, dependsOn: 'build') {
group 'Application'
description 'Execute benchmarks.'
main 'org.openjdk.jmh.Main'
classpath = sourceSets.main.runtimeClasspath
}
tasks.addRule("Pattern: <ClassName>Benchmark : Run benchmark.") { String className ->
if (className.endsWith("Benchmark")) {
println "\nRUNNING BENCHMARK: " + className + "\n"
task "$className"(type: JavaExec, dependsOn: 'build') {
main 'org.openjdk.jmh.Main'
args = ['.' + className + '.*']
classpath = sourceSets.main.runtimeClasspath
}
}
}