-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
130 lines (104 loc) · 3.49 KB
/
Copy pathbuild.gradle
File metadata and controls
130 lines (104 loc) · 3.49 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
plugins {
id 'java'
id "me.champeau.jmh"
id "io.morethan.jmhreport"
id "io.github.reyerizo.gradle.jcstress"
}
group = 'org.example'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
maven {
url = 'https://central.sonatype.com/repository/maven-snapshots/'
mavenContent {
snapshotsOnly()
}
}
}
dependencies {
testImplementation Testing.assertj.core
testImplementation Testing.junit.jupiter
testRuntimeOnly "org.junit.platform:junit-platform-launcher:_"
testImplementation "net.jqwik:jqwik:_"
implementation 'org.apache.commons:commons-lang3:_'
implementation 'com.google.guava:guava:_'
implementation 'jakarta.annotation:jakarta.annotation-api:_'
implementation 'com.google.code.findbugs:jsr305:_'
testImplementation 'org.awaitility:awaitility:_'
testImplementation "org.wiremock:wiremock:_"
implementation 'io.micrometer:micrometer-registry-dynatrace:_'
implementation 'org.apache.logging.log4j:log4j-api:_'
implementation 'org.apache.logging.log4j:log4j-core:_'
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:_'
implementation platform('com.github.mlangc:more-log4j2-bom:_')
implementation 'com.github.mlangc:more-log4j2:_'
testRuntimeOnly 'com.github.mlangc:more-log4j2-junit:_'
implementation 'org.apache.commons:commons-numbers-core:_'
runtimeOnly 'org.apache.logging.log4j:log4j-layout-template-json:_'
runtimeOnly 'com.lmax:disruptor:_'
jmh 'org.openjdk.jmh:jmh-core:_'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:_'
jmh 'org.openjdk.jmh:jmh-generator-bytecode:_'
jmh 'io.github.fzhinkin:xctraceprof:_'
}
test {
useJUnitPlatform {
includeEngines "jqwik", "junit-jupiter"
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(26)
}
}
compileJava {
// To enable argument names in reporting and debugging
options.compilerArgs += '-parameters'
}
tasks.withType(JavaCompile).configureEach {
it.options.compilerArgs += "--enable-preview"
}
tasks.withType(Test).configureEach {
it.jvmArgs += "--enable-preview"
}
tasks.withType(JavaExec).configureEach {
it.jvmArgs += '--enable-preview'
}
jmh {
includes = ["CostOfAllocRateNormBenchmark.*consumeCpu.*"]
threads = 10
resultFormat = "JSON"
profilers = ["gc"]
//profilers = ["org.openjdk.jmh.profile.XCTraceAsmProfiler"]
}
jmhReport {
jmhResultPath = project.file('build/results/jmh/results.json')
jmhReportOutput = project.file('build/results/jmh/report')
}
jcstress {
jcstressDependency 'org.openjdk.jcstress:jcstress-core:_'
verbose = true
}
[blogExecutorDeadlock: 'scripts/blog/executorDeadlock'].each { name, dir ->
sourceSets.create(name) {
java.srcDirs = ["src/$dir"]
compileClasspath += sourceSets.main.output + sourceSets.test.output
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
}
configurations.named("${name}Implementation").configure {
extendsFrom configurations.testImplementation
}
configurations.named("${name}RuntimeOnly").configure {
extendsFrom configurations.testRuntimeOnly
}
tasks.register("run${name.capitalize()}", JavaExec) {
group = 'scripts'
classpath = sourceSets[name].runtimeClasspath
mainClass = project.findProperty('mainClass') ?: ''
}
}
tasks.jmh.finalizedBy tasks.jmhReport
tasks.jmhReport.doFirst {
project.file('build/results/jmh/report').mkdirs()
}