-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
41 lines (34 loc) · 1.21 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
plugins {
id 'java'
id "me.champeau.jmh" version "0.7.1"
}
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.bytedeco.javacpp-presets:systems-platform:1.4.4'
implementation 'net.java.dev.jna:jna-platform:5.13.0'
implementation 'com.github.jnr:jnr-ffi:2.2.14'
implementation 'com.nativelibs4java:bridj:0.7.0'
}
jmh {
jvmArgs = ['-Djmh.separateClasspathJAR=true', '--enable-preview', '--enable-native-access=ALL-UNNAMED']
}
// Configure Java compilation tasks to enable feature previews
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.add("--enable-preview")
javaCompiler.set(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(19))
})
}
// Then configure the JMH Tasks to build with Java 15
tasks.withType(me.champeau.jmh.WithJavaToolchain).configureEach {
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(19))
})
}
// Configure the JMH bytecode generator to support feature previews
tasks.withType(me.champeau.jmh.JmhBytecodeGeneratorTask).configureEach {
jvmArgs.set(["--enable-preview"])
}