-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
170 lines (153 loc) · 5.38 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
}
group = 'org.cryptimeleon'
archivesBaseName = project.name
boolean isRelease = project.hasProperty("release")
version = '3.1.2' + (isRelease ? "" : "-SNAPSHOT")
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1'
implementation group: 'org.reflections', name: 'reflections', version:'0.9.10'
// For tests
testCompileOnly(
'junit:junit:4.12'
)
testImplementation(
'org.junit.jupiter:junit-jupiter-api:5.7.2',
'org.junit.jupiter:junit-jupiter-params:5.7.2'
)
testRuntimeOnly(
'org.junit.jupiter:junit-jupiter-engine:5.7.2',
'org.junit.vintage:junit-vintage-engine:5.7.2'
)
}
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
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>"
// reduce javadoc linting
options.addBooleanOption('Xdoclint:none', true)
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadocLatex) {
from javadoc.destinationDir
archiveClassifier = 'javadoc'
}
artifacts {
archives javadocJar
archives sourcesJar
}
java {
registerFeature("tests") {
usingSourceSet(sourceSets.test)
}
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
artifacts {
archives javadocJar, sourcesJar
}
pom {
name = 'Math'
url = 'https://cryptimeleon.org'
description = 'The Math library provides the mathematical foundation for the other Cryptimeleon libraries. ' +
'It provides basics such as mathematical groups, rings and fields, e.g. Z_n , ' +
'as well as implementations of cryptographic pairings.'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jbobolz'
name = 'Jan Bobolz'
email = 'mail@jan-bobolz.de'
organization = 'Paderborn University'
}
developer {
id = 'feidens'
name = 'Fabian Eidens'
email = 'fabianeidens@gmail.com'
organization = 'Paderborn University'
url = 'https://feidens.github.io/'
}
developer {
id = 'rheitjoh'
name = 'Raphael Heitjohann'
email = 'rheitjoh@mail.uni-paderborn.de'
organization = 'Paderborn University'
}
}
scm {
connection = 'scm:git:git://github.com/cryptimeleon/math.git'
developerConnection = 'scm:git:https://github.com/cryptimeleon/math.git'
url = 'https://github.com/cryptimeleon/math/'
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
}
}
signing {
required(project.hasProperty("release"))
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}