-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
153 lines (123 loc) · 3.99 KB
/
build.gradle.kts
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
plugins {
`java-library`
pmd
idea
`maven-publish`
signing
// https://plugins.gradle.org/plugin/io.github.gradle-nexus.publish-plugin
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
// https://plugins.gradle.org/plugin/com.diffplug.spotless
id("com.diffplug.spotless") version "6.19.0"
// https://plugins.gradle.org/plugin/me.champeau.jmh
id("me.champeau.jmh") version "0.7.1"
}
group = "de.tum.in"
version = "0.6.0"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
var defaultEncoding = "UTF-8"
tasks.withType<JavaCompile> { options.encoding = defaultEncoding }
tasks.withType<Javadoc> {
options.encoding = defaultEncoding
options {
this as StandardJavadocDocletOptions
addBooleanOption("Xdoclint:all,-missing", true)
}
}
tasks.withType<Test> { systemProperty("file.encoding", "UTF-8") }
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
repositories { mavenCentral() }
spotless {
java {
licenseHeaderFile("${project.rootDir}/config/LICENCE_HEADER")
palantirJavaFormat()
}
kotlinGradle { ktfmt() }
}
jmh { includeTests.set(true) }
dependencies {
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
// https://mvnrepository.com/artifact/com.google.guava/guava
testImplementation("com.google.guava:guava:31.1-jre")
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest
testImplementation("org.hamcrest:hamcrest:2.2")
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3")
// https://mvnrepository.com/artifact/org.immutables/value
compileOnly("org.immutables:value:2.9.3:annotations")
annotationProcessor("org.immutables:value:2.9.3")
jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:1.36")
}
tasks.test {
useJUnitPlatform()
minHeapSize = "2g"
maxHeapSize = "16g"
}
// PMD
// https://docs.gradle.org/current/dsl/org.gradle.api.plugins.quality.Pmd.html
pmd {
toolVersion = "6.55.0" // https://pmd.github.io/
reportsDir = file("${project.buildDir}/reports/pmd")
ruleSetFiles = files("${project.rootDir}/config/pmd-rules.xml")
ruleSets = listOf() // We specify all rules in rules.xml
isConsoleOutput = false
isIgnoreFailures = false
}
tasks.withType<Pmd> {
reports {
xml.required.set(false)
html.required.set(true)
}
}
// Deployment - run with -Prelease clean publishToSonatype closeAndReleaseSonatypeStagingRepository
// Authentication: sonatypeUsername+sonatypePassword in ~/.gradle/gradle.properties
if (project.hasProperty("release")) {
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(project.components["java"])
signing {
useGpgCmd()
sign(publishing.publications)
}
pom {
name.set("JBDD")
description.set("Pure Java implementation of (Binary) Decision Diagrams")
url.set("https://github.com/incaseoftrouble/jbdd")
licenses {
license {
name.set("The GNU General Public License, Version 3")
url.set("https://www.gnu.org/licenses/gpl.txt")
}
}
developers {
developer {
id.set("incaseoftrouble")
name.set("Tobias Meggendorfer")
email.set("[email protected]")
url.set("https://github.com/incaseoftrouble")
timezone.set("Europe/Berlin")
}
}
scm {
connection.set("scm:git:https://github.com/incaseoftrouble/jbdd.git")
developerConnection.set("scm:git:[email protected]:incaseoftrouble/jbdd.git")
url.set("https://github.com/incaseoftrouble/jbdd")
}
}
}
}
}
nexusPublishing { repositories.sonatype() }
}