-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
98 lines (83 loc) · 3.24 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
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'maven'
id 'maven-publish'
}
group = 'de.upb.crypto.clarc'
version = '1.0.0' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
description = """"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
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/" }
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api group: 'de.upb.crypto', name: 'math', version: '1.0.0' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
api group: 'de.upb.crypto', name: 'craco', version: '1.1.0' + (Boolean.valueOf(System.getProperty("disablesnapshot")) ? "" : "-SNAPSHOT")
// 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.1'
// For tests
testImplementation group: 'org.reflections', name: 'reflections', version: '0.9.10'
// Use JUnit 5 test framework
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.2.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.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))
}
}
}
//packaging tests
task packageTests(type: Jar) {
classifier = 'tests'
baseName = project.name + '-test'
from sourceSets.test.output+sourceSets.test.allSource
}
configurations {
testArtifacts
}
artifacts {
archives packageTests
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact packageTests
}
}
repositories {
maven {
credentials {
username = System.getProperty('nexus.user')
password = System.getProperty('nexus.key')
}
def releasesRepoUrl = "https://nexus.cs.upb.de/repository/sfb901-releases/"
def snapshotsRepoUrl = "https://nexus.cs.upb.de/repository/sfb901-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}