-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbuild.gradle
More file actions
127 lines (111 loc) · 4.2 KB
/
Copy pathbuild.gradle
File metadata and controls
127 lines (111 loc) · 4.2 KB
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
plugins {
id "idea"
id "jacoco"
id "java"
id 'maven-publish'
}
group 'org.inwc3'
// A tagged build passes the version in, so the release workflow publishes
// 2.0.0 rather than a snapshot of it. Local and CI builds stay a snapshot,
// which keeps an accidental `publish` from claiming a release version.
version = findProperty('releaseVersion') ?: '2.0.0-SNAPSHOT'
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.release.set(25)
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:all,-serial,-this-escape'
}
tasks.withType(Javadoc).configureEach {
options.encoding = 'UTF-8'
// The compat adapter is deprecated by design; do not fail the build on it.
options.addStringOption('Xdoclint:none', '-quiet')
}
repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
}
jacoco {
toolVersion = "0.8.13"
}
dependencies {
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.27.1'
implementation group: 'org.tukaani', name: 'xz', version: '1.9'
// Zopfli is optional and deliberately not a published dependency. It is
// only reachable through RecompressOptions.useZopfli, and it lives on
// JitPack rather than Maven Central -- so declaring it normally would force
// every consumer to add the JitPack repository to resolve a transitive they
// will most likely never call. Callers who do want it add the same line to
// their own build; CompressionUtil says so if it is missing.
compileOnly 'com.github.eustas:CafeUndZopfli:5cdf283e67'
testImplementation 'com.github.eustas:CafeUndZopfli:5cdf283e67'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.16'
// Logging backend is a test-only concern: a library must never impose one
// on its consumers (P3-1).
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.18'
testImplementation 'org.testng:testng:7.11.0'
}
test {
useTestNG()
// FFM mapped-segment access in the read layer.
jvmArgs '--enable-native-access=ALL-UNNAMED'
// Opt-in path to the third-party maps named in issues #46 and #47, which
// are not committed here. IssueSampleTests skips when it is unset.
// Run with: ./gradlew test -PissueSamples=/path/to/maps
// Accepts either form, since -D is the reflex: a Gradle project property
// (-PissueSamples) or a system property on the Gradle JVM forwarded to the
// test JVM (-Djmpq3.issueSamples).
systemProperty 'jmpq3.issueSamples',
findProperty('issueSamples') ?: System.getProperty('jmpq3.issueSamples', '')
testLogging {
events "failed"
exceptionFormat "full"
}
}
jacocoTestReport {
reports {
xml.required.set(true)
}
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'org.inwc3'
artifactId = 'jmpq3'
from components.java
pom {
name = 'JMPQ3'
description = 'A Java library for reading and writing MPQ (MoPaQ) archives.'
url = 'https://github.com/inwc3/JMPQ3'
licenses {
license {
name = 'Apache License 2.0'
url = 'https://github.com/inwc3/JMPQ3/blob/master/LICENSE.txt'
}
}
scm {
url = 'https://github.com/inwc3/JMPQ3'
connection = 'scm:git:https://github.com/inwc3/JMPQ3.git'
}
}
}
}
repositories {
// Without this the `publish` task has nowhere to go: only
// publishToMavenLocal exists, so the old release workflow ran
// `./gradlew publish` and quietly published nothing.
maven {
name = 'GitHubPackages'
url = uri('https://maven.pkg.github.com/inwc3/JMPQ3')
credentials {
username = System.getenv('GITHUB_ACTOR') ?: findProperty('gpr.user') ?: ''
password = System.getenv('GITHUB_TOKEN') ?: findProperty('gpr.key') ?: ''
}
}
}
}