-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
233 lines (191 loc) · 6.61 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
222
223
224
225
226
227
228
229
230
231
232
233
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'checkstyle'
id 'org.gradlex.extra-java-module-info' version '1.8'
}
apply plugin: 'maven-publish'
repositories {
// Access the Central Repository with Gradle via HTTPS
// Ref: https://central.sonatype.org/consume/consume-gradle/
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
// JAXB configuration holds classpath for running the JAXB XJC compiler
configurations {
jaxb
}
dependencies {
jaxb "org.glassfish.jaxb:jaxb-xjc:4.0.5"
jaxb "org.glassfish.jaxb:jaxb-runtime:4.0.5"
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
// JAXB API only
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
// JAXB RI, Jakarta XML Binding
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
// JUnit Jupiter using Gradle's native JUnit Platform
testImplementation platform('org.junit:junit-bom:5.10.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.platform:junit-platform-reporting'
// PLIST implementation
implementation 'com.googlecode.plist:dd-plist:1.28'
// Required to read InputStream with BOM-field
// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.16.1'
// Used to load MIME-types from JSON
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
}
// Convert legacy dependency to named Java module
extraJavaModuleInfo {
module('com.googlecode.plist:dd-plist', 'dd.plist') {
exports('com.dd.plist')
requires('java.xml')
}
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier.set('javadoc')
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
java {
withSourcesJar()
withJavadocJar()
}
def generated_dir = "build/generated/sources/xjc/java"
sourceSets {
main {
java.srcDirs += generated_dir
}
}
group = 'io.github.borewit'
version = '4.0.1'
description = 'Lizzy'
java.sourceCompatibility = JavaVersion.VERSION_1_9
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'Lizzy'
description = 'Multimedia playlist parser, supporting a wide range of playlist file formats.'
url = 'https://github.com/Borewit/lizzy'
licenses {
license {
name = 'MIT'
url = 'https://github.com/Borewit/lizzy/blob/main/LICENSE.txt'
}
}
developers {
developer {
id = 'Borewit'
name = 'Borewit'
timezone = 'Europe/Amsterdam'
url = 'https://github.com/Borewit'
}
}
contributors {
contributor {
name = 'Borewit'
timezone = 'Europe/Amsterdam'
url = 'https://github.com/Borewit'
}
contributor {
name = 'Christophe Delory'
}
}
scm {
connection = 'scm:git:https://github.com/Borewit/lizzy.git'
url = 'https://github.com/Borewit/lizzy'
}
}
}
}
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
task checkStyle(type: DefaultTask, dependsOn: [checkstyleMain, checkstyleTest]) {
group = 'verification'
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
javadoc {
options.addBooleanOption("Xdoclint:none", true)
options.addStringOption("Xmaxwarns", "1")
}
task checkJavaSources(type: SourceTask) {
source 'src/main/java'
}
// Prevent generated Java sources are checked
tasks.checkstyleMain.source = fileTree(dir: 'src/main/java').include('**/*.java')
// Cookie cutter function for defining multiple XJC tasks
def addXjcTask(taskName, schema, binding, dest) {
// If you haven't already, create the generated output dir before running XJC or it will fail
file(dest).mkdirs()
// The main XJC task, calls XJCFacade which is the entry point of the XJC JAR
tasks.create(name: taskName, type: JavaExec) {
group = 'xjc'
classpath configurations.jaxb
mainClass = 'com.sun.tools.xjc.XJCFacade'
// To explore available args, download the XJC JAR and run java -jar jaxb-xjc.jar --help
// or see https://docs.oracle.com/javase/8/docs/technotes/tools/unix/xjc.html
args "-extension", schema, "-b", binding, "-d", dest, "-no-header"
tasks.findByName('build').mustRunAfter 'clean'
}
}
addXjcTask("xjc-asx",
"src/main/schema/asx/asx-3.0.xsd",
"src/main/schema/asx/binding.xjb",
"$generated_dir")
addXjcTask("xjc-atom",
"src/main/schema/atom/atom.xsd",
"src/main/schema/atom/binding.xjb",
"$generated_dir")
addXjcTask("xjc-b4s",
"src/main/schema/b4s/b4s.xsd",
"src/main/schema/b4s/binding.xjb",
"$generated_dir")
addXjcTask("xjc-rmp",
"src/main/schema/rmp/rmp.xsd",
"src/main/schema/rmp/binding.xjb",
"$generated_dir")
addXjcTask("xjc-rss",
"src/main/schema/rss/rss-2.0.xsd",
"src/main/schema/rss/binding.xjb",
"$generated_dir")
addXjcTask("xjc-smil",
"src/main/schema/smil20/smil20.xsd",
"src/main/schema/smil20/binding.xjb",
"$generated_dir")
addXjcTask("xjc-xspf",
"src/main/schema/xspf/xspf-1_0.2.xsd",
"src/main/schema/xspf/binding.xjb",
"$generated_dir")
task xjc(type: GradleBuild) {
group = 'xjc'
tasks = ['xjc-asx', 'xjc-atom', 'xjc-b4s', 'xjc-b4s', 'xjc-rmp', 'xjc-rss', 'xjc-smil', 'xjc-xspf']
}
tasks.compileJava.dependsOn(tasks.xjc)