forked from jirutka/rsql-parser
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
169 lines (138 loc) · 3.74 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
plugins {
groovy
jacoco
`java-library`
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.javacc.javacc") version "3.0.3"
id("net.researchgate.release") version "3.0.2"
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("net.jcip:jcip-annotations:1.0")
testImplementation("nl.jqno.equalsverifier:equalsverifier:3.17.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.3")
testImplementation("org.spockframework:spock-core:2.4-M4-groovy-4.0")
javacc("net.java.dev.javacc:javacc:7.0.13")
}
group = "io.github.nstdio"
description = "RSQL-parser"
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
sourceSets {
main {
java.srcDirs(project.layout.buildDirectory.dir("generated/javacc"))
}
}
}
publishing {
publications.create<MavenPublication>("java") {
from(components["java"])
pom {
name.set("RSQL-parser")
description.set("Parser of RSQL / FIQL (query language for RESTful APIs) written in JavaCC.")
url.set("https://github.com/nstdio/rsql-parser")
inceptionYear.set("2011")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("jirutka")
name.set("Jakub Jirutka")
organization.set("CTU in Prague")
organizationUrl.set("https://www.cvut.cz")
}
developer {
id.set("nstdio")
name.set("Edgar Asatryan")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:[email protected]:nstdio/rsql-parser.git")
developerConnection.set("scm:git:[email protected]:nstdio/rsql-parser.git")
url.set("https://github.com/nstdio/rsql-parser")
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/nstdio/rsql-parser/actions")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/nstdio/rsql-parser/issues")
}
}
}
}
signing {
isRequired = (version as String).endsWith("SNAPSHOT")
val signingKey = findProperty("signingKey") as String?
val signingPassword = findProperty("signingPassword") as String?
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["java"])
}
nexusPublishing {
repositories {
sonatype {
val baseUri = uri("https://s01.oss.sonatype.org")
nexusUrl.set(baseUri.resolve("/service/local/"))
snapshotRepositoryUrl.set(baseUri.resolve("/content/repositories/snapshots/"))
}
}
}
release {
tagTemplate.set("v\${version}")
git {
requireBranch.set("master")
pushToRemote.set("origin")
}
}
tasks {
test {
useJUnitPlatform()
}
withType<JacocoReport> {
reports {
val isCI = System.getenv("CI").toBoolean()
xml.required.set(isCI)
html.required.set(!isCI)
}
}
withType<Test> {
finalizedBy(named("jacocoTestReport"))
}
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
withType<Javadoc>().configureEach {
options.encoding = "UTF-8"
(options as? StandardJavadocDocletOptions)?.tags(
"apiNote:a:API Note:"
)
}
withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
compileJavacc {
outputDirectory = outputDirectory.resolve("cz/jirutka/rsql/parser")
}
named("sourcesJar") {
dependsOn(compileJavacc)
}
named("afterReleaseBuild") {
dependsOn("publishToSonatype", "closeAndReleaseSonatypeStagingRepository")
}
}