-
Notifications
You must be signed in to change notification settings - Fork 77
/
build.gradle
221 lines (201 loc) · 6.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'checkstyle'
id 'jacoco'
id 'com.github.ben-manes.versions' version '0.50.0'
id 'dev.jacomet.logging-capabilities' version '0.11.1'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'org.jreleaser' version '1.9.0'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.slf4j:slf4j-api:2.0.9'
if (version.toString().endsWith('.0.0')) {
annotationProcessor 'com.github.gotson.bestbefore:bestbefore-processor-java:0.1.0'
}
testRuntimeOnly 'ch.qos.logback:logback-classic:1.4.11'
testImplementation 'commons-io:commons-io:2.15.0'
testImplementation 'org.mockito:mockito-core:5.6.0'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'com.tngtech.archunit:archunit-junit5:1.1.0'
testImplementation 'org.junit-pioneer:junit-pioneer:2.1.0'
}
group = 'com.github.junrar'
description = 'rar decompression library in plain java'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withJavadocJar()
withSourcesJar()
}
jreleaser {
project {
description = 'rar decompression library in plain java'
copyright = 'Junrar team'
}
release {
github {
discussionCategoryName = 'Announcements'
changelog {
formatted = 'ALWAYS'
preset = 'conventional-commits'
skipMergeCommits = true
links = true
format = '- {{#commitIsConventional}}{{#conventionalCommitIsBreakingChange}}🚨 {{/conventionalCommitIsBreakingChange}}{{#conventionalCommitScope}}**{{conventionalCommitScope}}**: {{/conventionalCommitScope}}{{conventionalCommitDescription}}{{#conventionalCommitBreakingChangeContent}}: *{{conventionalCommitBreakingChangeContent}}*{{/conventionalCommitBreakingChangeContent}} ({{commitShortHash}}){{/commitIsConventional}}{{^commitIsConventional}}{{commitTitle}} ({{commitShortHash}}){{/commitIsConventional}}{{#commitHasIssues}}, closes{{#commitIssues}} {{issue}}{{/commitIssues}}{{/commitHasIssues}}'
hide {
uncategorized = true
contributors = ['[bot]', 'github-actions', 'GitHub']
}
excludeLabels = ['chore']
category {
title = '🏎 Perf'
key = 'perf'
labels = ['perf']
order = 25
}
labeler {
label = 'perf'
title = 'regex:^(?:perf(?:\\(.*\\))?!?):\\s.*'
order = 120
}
extraProperties.put('categorizeScopes', true)
append {
enabled = true
title = '# [{{projectVersion}}]({{repoUrl}}/compare/{{previousTagName}}...{{tagName}}) ({{#f_now}}YYYY-MM-dd{{/f_now}})'
content = """
{{changelogTitle}}
{{changelogChanges}}
""".stripIndent()
}
}
issues {
enabled = true
comment = '🎉 This issue has been resolved in `{{tagName}}` ([Release Notes]({{releaseNotesUrl}}))'
applyMilestone = 'ALWAYS'
label {
name = 'released'
description = 'Issue has been released'
color = '#ededed'
}
}
}
}
files {
artifact {
path = 'build/libs/{{projectName}}-{{projectVersion}}.jar'
}
}
}
publishing {
repositories {
mavenLocal()
}
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Java Unrar'
description = "${description}"
url = 'https://github.com/junrar/junrar'
licenses {
license {
name = 'UnRar License'
url = 'https://github.com/junrar/junrar/blob/master/LICENSE'
}
}
developers {
developer {
id = 'gotson'
name = 'Gauthier Roebroeck'
}
}
scm {
url = 'https://github.com/junrar/junrar.git'
}
}
}
}
}
signing {
required { false }
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype()
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.wrapper {
gradleVersion = '8.11.1'
distributionType = Wrapper.DistributionType.ALL
}
testing {
suites {
test {
useJUnitJupiter('5.9.1')
}
regressionTest(JvmTestSuite) {
useJUnitJupiter('5.9.1')
dependencies {
implementation project(':')
implementation 'org.assertj:assertj-core:3.24.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.0'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.0'
implementation 'org.junit-pioneer:junit-pioneer:1.9.1'
}
targets {
configureEach {
java.toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
testTask.configure {
systemProperty 'regressionTest.resourcesDir', sourceSets.named('regressionTest').get().resources.getSrcDirs().first()
useJUnitPlatform {
includeTags 'check' // in order to run `gradle regressionTest`
}
}
}
}
}
}
}
checkstyle {
configFile = file("${rootDir}/checkstyle.xml")
toolVersion = '10.3.2'
}
jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(false)
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-] (-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
// disallow release candidates as upgradable versions from stable versions
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}