diff options
author | 2021-07-30 20:03:33 +0200 | |
---|---|---|
committer | 2021-07-30 20:03:33 +0200 | |
commit | 532d2045f5f87e9049475ddd055c7a93ea38dca0 (patch) | |
tree | c7585eba98c27fbda93fcdff177056def0a0cf71 /gradle/jmh.gradle | |
parent | Replaced platformURI with projectMapping to fix genmodel error. (diff) | |
download | refinery-532d2045f5f87e9049475ddd055c7a93ea38dca0.tar.gz refinery-532d2045f5f87e9049475ddd055c7a93ea38dca0.tar.zst refinery-532d2045f5f87e9049475ddd055c7a93ea38dca0.zip |
Add JMH benchmarks for model-data
Diffstat (limited to 'gradle/jmh.gradle')
-rw-r--r-- | gradle/jmh.gradle | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gradle/jmh.gradle b/gradle/jmh.gradle new file mode 100644 index 00000000..ea88f3e3 --- /dev/null +++ b/gradle/jmh.gradle | |||
@@ -0,0 +1,40 @@ | |||
1 | configurations { | ||
2 | jmh { | ||
3 | extendsFrom compile | ||
4 | } | ||
5 | } | ||
6 | |||
7 | sourceSets { | ||
8 | jmh { | ||
9 | java.srcDirs = ['src/jmh/java'] | ||
10 | resources.srcDirs = ['src/jmh/resources'] | ||
11 | compileClasspath += sourceSets.main.runtimeClasspath | ||
12 | compileClasspath += sourceSets.test.runtimeClasspath | ||
13 | xtendOutputDir = 'src/jmh/xtend-gen' | ||
14 | } | ||
15 | } | ||
16 | |||
17 | dependencies { | ||
18 | jmhRuntime "org.openjdk.jmh:jmh-core:${jmhVersion}" | ||
19 | jmhCompile "org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}" | ||
20 | jmhAnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}" | ||
21 | } | ||
22 | |||
23 | clean.doLast { | ||
24 | delete 'src/jmh/xtend-gen' | ||
25 | } | ||
26 | |||
27 | task jmh(type: JavaExec, dependsOn: jmhClasses) { | ||
28 | main = 'org.openjdk.jmh.Main' | ||
29 | classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath | ||
30 | } | ||
31 | |||
32 | eclipse.classpath { | ||
33 | plusConfigurations += [configurations.jmh] | ||
34 | |||
35 | // Allow test helper classes to be used in benchmarks from Eclipse. | ||
36 | file.whenMerged { classpath -> | ||
37 | def jmhClasspathEntry = classpath.entries.find { entry -> entry.path == 'src/jmh/java' } | ||
38 | jmhClasspathEntry.entryAttributes['test'] = true | ||
39 | } | ||
40 | } | ||