-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
166 lines (142 loc) · 5.77 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
plugins {
id 'java'
id 'jvm-test-suite'
id 'jacoco'
// Adds coveralls task for CI to send results to the coveralls service.
id "com.github.kt3k.coveralls" version "2.12.2"
// Instructions: https://github.com/researchgate/gradle-release
// Available versions: https://plugins.gradle.org/plugin/net.researchgate.release
id 'net.researchgate.release' version '3.0.2'
id "maven-publish"
// Publishing of JAR to Nexus instances (e.g., OSSRH)
// https://github.com/gradle-nexus/publish-plugin
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "io.freefair.maven-publish-java" version "8.10.2"
}
group 'edu.kit.datamanager'
description = "A library for easy creation and modification of valid RO-Crates."
println "Running gradle version: $gradle.gradleVersion"
println "Building ${name} version: ${version}"
println "JDK version: ${JavaVersion.current()}"
println "Profile (system property): ${System.getProperty('profile')}"
if (JavaVersion.current() == JavaVersion.VERSION_17) {
println "Setting encoding to UTF-8 manually"
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
}
repositories {
mavenCentral()
}
ext {
jacksonVersion = '2.18.1'
}
dependencies {
// JUnit setup for testing
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation(platform("org.junit:junit-bom:5.11.3"))
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
// JSON object mapping / (de-)serialization
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
// http client
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
// common file system operations
implementation group: 'commons-io', name: 'commons-io', version: '2.17.0'
// read from and write to zip files
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5'
// compare json documents in tests
implementation 'com.github.fslev:json-compare:6.18'
// url validator
implementation group: 'commons-validator', name: 'commons-validator', version: '1.9.0'
// logging
implementation group: 'org.slf4j', name: 'slf4j-jdk14', version: '2.0.16'
// JSON-LD, Zenodo mapping
implementation group: 'com.apicatalog', name: 'titanium-json-ld', version: '1.4.1'
// metadata validation, profiles based on JSON schema
implementation group: "com.networknt", name: "json-schema-validator", version: "1.5.3"
implementation 'org.glassfish:jakarta.json:2.0.1'
}
def signingTasks = tasks.withType(Sign)
tasks.withType(AbstractPublishToMaven).configureEach{
mustRunAfter(signingTasks)
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
}
test {
java {
// compileClasspath += sourceSets.main.output
//runtimeClasspath += sourceSets.main.output
srcDirs = ['src/test/java']
}
}
performanceTest {
java {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
srcDirs = ['src/performanceTest/java']
}
}
}
configurations {
performanceTestImplementation.extendsFrom implementation
}
task performanceContextEntitiesBenchmark(type: JavaExec) {
description = "Run the context entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.singlecratebenchmarks.ContextualEntitiesPerformance'
}
task performanceLocalDataEntitiesBenchmark(type: JavaExec) {
description = "Run the local data entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.singlecratebenchmarks.LocalDataEntitiesPerformance'
}
task performanceRemoteDataEntitiesBenchmark(type: JavaExec) {
description = "Run the remote data entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.singlecratebenchmarks.RemoteDataEntitiesPerformance'
}
task performanceMixEntitiesBenchmark(type: JavaExec) {
description = "Run the remote data entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.singlecratebenchmarks.MixtureOfEntitiesPerformance'
}
task performanceDeletionEntitiesBenchmark(type: JavaExec) {
description = "Run the remote data entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.singlecratebenchmarks.DeletionEntitiesPerformance'
}
task performanceMultipleCratesBenchmark(type: JavaExec) {
description = "Run the remote data entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.multiplecrates.MultipleCratesBenchmark'
}
task performanceReadWriteMultipleCratesBenchmark(type: JavaExec) {
description = "Run the remote data entities benchmarks."
classpath = sourceSets.performanceTest.runtimeClasspath
mainClass = 'edu.kit.datamanager.ro_crate.multiplecrates.MultipleCratesWriteAndRead'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
csv.required = true
xml.required = true // coveralls plugin depends on xml format report
}
}
jacoco {
toolVersion = "0.8.11"
}
// maxParallelForks(2)
// failFast = true
if (System.getProperty('profile') == "release") {
println 'Using release profile for building ' + project.getName()
apply from: 'gradle/profile-release.gradle'
}