-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
91 lines (78 loc) · 2.96 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
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
plugins {
id 'java-library'
id "maven-publish"
}
group = 'org.cryptimeleon'
version = '0.0.3' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url "https://nexus.cs.upb.de/repository/sfb901-libs/" }
maven { url "https://nexus.cs.upb.de/repository/sfb901-releases/" }
maven { url "https://nexus.cs.upb.de/repository/sfb901-snapshots/" }
}
sourceSets {
jmh {
compileClasspath += sourceSets.main.runtimeClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
}
dependencies {
api group: 'org.cryptimeleon', name: 'craco', version: '1.0.0' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
api group: 'org.cryptimeleon', name: 'mclwrap', version: '1.0.0' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
api group: 'org.cryptimeleon', name: 'predenc', version: '1.0.0' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
// jmh dependencies for benchmarking
jmhImplementation "org.openjdk.jmh:jmh-core:1.23"
jmhAnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:1.23"
testCompileOnly group: 'junit', name: 'junit', version: '4.12'
}
test {
useJUnitPlatform()
maxParallelForks 4
//we want display the following test events
testLogging {
events "PASSED", "STARTED", "FAILED", "SKIPPED"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
artifacts {
archives javadocJar
}
// can use this to run all (or specific ones via include and exclude) benchmarks via task
task jmh(type: JavaExec) {
description = "This task runs JMH benchmarks"
classpath = sourceSets.jmh.runtimeClasspath
main = "org.openjdk.jmh.Main"
def include = project.properties.get('include', '');
def exclude = project.properties.get('exclude');
def prof = project.properties.get('prof');
def format = project.properties.get('format', 'json');
def resultFile = file("build/reports/jmh/result.${format}")
resultFile.parentFile.mkdirs()
args include
if (exclude) {
args '-e', exclude
}
if (prof) {
args '-prof', prof
}
args '-rf', format
args '-rff', resultFile
}