-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
75 lines (66 loc) · 2.47 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
plugins {
id 'java-library'
id 'maven-publish'
}
group 'org.cryptimeleon'
archivesBaseName = project.name
boolean isRelease = project.hasProperty("release")
version = '0.1.0' + (isRelease ? "" : "-SNAPSHOT")
repositories {
mavenCentral()
}
def mathVersionNoSuffix = '2.0.0'
def cracoVersionNoSuffix = '2.0.0'
dependencies {
def cracoVersion = cracoVersionNoSuffix + (isRelease ? "" : "-SNAPSHOT")
api group: 'org.cryptimeleon', name: 'craco', version: cracoVersion
// For tests
testImplementation(group: 'org.cryptimeleon', name: 'craco', version: cracoVersion) {
capabilities {
requireCapability("org.cryptimeleon:craco-tests")
}
}
testCompileOnly(
'junit:junit:4.12'
)
testImplementation(
'org.junit.jupiter:junit-jupiter-api:5.7.0',
'org.junit.jupiter:junit-jupiter-params:5.7.0',
'org.reflections:reflections:0.9.10'
)
testRuntimeOnly(
'org.junit.jupiter:junit-jupiter-engine:5.7.0',
'org.junit.vintage:junit-vintage-engine:5.7.0'
)
}
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 javadocLatex(type: Javadoc) {
source = sourceSets.main.allJava
classpath = sourceSets.main.runtimeClasspath
// link to math and craco javadocs
if (isRelease) {
options {
links "https://javadoc.io/doc/org.cryptimeleon/math/" + mathVersionNoSuffix, "https://javadoc.io/doc/org.cryptimeleon/craco/" + cracoVersionNoSuffix
}
}
// enable latex rendering via mathjax
options.addBooleanOption("-allow-script-in-comments", true)
options.header = "<script type\"text/javascript&\" src=\"" +
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?" +
"config=TeX-MML-AM_CHTML\"></script>"
}