-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
137 lines (116 loc) · 3.99 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
import java.util.concurrent.TimeUnit
plugins {
id 'java-library'
id "com.github.spotbugs" version "5.2.5"
id 'checkstyle'
id 'jacoco'
id 'pmd'
id 'info.solidsoft.pitest' version '1.15.0'
id 'maven-publish'
id 'signing'
}
group = "de.hhu.stups"
version = "0.1.5-SNAPSHOT"
final isSnapshot = project.version.endsWith("-SNAPSHOT")
repositories {
mavenCentral()
if (isSnapshot) {
maven {
name "sonatype snapshots"
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor(0, TimeUnit.SECONDS)
}
}
dependencies {
implementation group: "com.github.spotbugs", name: "spotbugs-annotations", version: "4.8.6"
api group: "de.hhu.stups", name: "bparser", version: "2.13.5"
testImplementation group: "nl.jqno.equalsverifier", name: "equalsverifier", version: "3.17.1"
testImplementation group: "org.assertj", name: "assertj-core", version: "3.26.3"
testImplementation(platform(group: "org.junit", name: "junit-bom", version: "5.11.3"))
testImplementation group: "org.junit.jupiter", name: "junit-jupiter"
testRuntimeOnly group: "org.junit.platform", name: "junit-platform-launcher"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
pitest {
// The junit5PluginVersion setting internally uses the following Maven coordinates:
// group: "org.pitest", name: "pitest-junit5-plugin", version: <specified below>
// https://central.sonatype.com/artifact/org.pitest/pitest-junit5-plugin
junit5PluginVersion = "1.2.1"
threads = 4
}
pmd {
toolVersion = "7.7.0"
// https://stackoverflow.com/a/53696963/10326268
ruleSets = []
ruleSetConfig = rootProject.resources.text.fromFile('config/pmd/pmd.xml')
// only apply pmd to src/main
sourceSets = [sourceSets.main]
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'Value Translator'
description = 'Library to translate Classical B values into Java objects.'
url = 'https://github.com/hhu-stups/value-translator'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/hhu-stups/value-translator/blob/master/LICENSE'
}
}
developers {
developer {
id = 'bivab'
name = 'David Schneider'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com:hhu-stups/value-translator.git'
developerConnection = 'scm:git:ssh://github.com:hhu-stups/value-translator.git'
url = 'https://github.com/hhu-stups/value-translator'
}
}
}
}
repositories {
maven {
final def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
final def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
credentials {
username project.ossrhUsername
password project.ossrhPassword
}
}
}
}
}
ext."signing.secretKeyRingFile" = rootProject.file("secring.gpg").absolutePath
signing {
sign publishing.publications.mavenJava
}