-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
196 lines (166 loc) · 5.76 KB
/
build.gradle
File metadata and controls
196 lines (166 loc) · 5.76 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
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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'checkstyle'
id 'org.gradlex.extra-java-module-info' version '1.13'
}
repositories {
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 (do not change to runtimeOnly)
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
// JUnit Jupiter using Gradle's native JUnit Platform
testImplementation platform('org.junit:junit-bom:5.13.4')
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.20.0'
// Testing: Used to load MIME-types from JSON
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.19.0'
// Runtime: Used for JSPF playlists (de)serializiation
// Testing: Used to load MIME-types from JSON
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
implementation 'com.fasterxml.jackson.core:jackson-databind:2.19.0'
}
// 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.1.2'
description = 'Lizzy'
java.sourceCompatibility = JavaVersion.VERSION_1_9
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
artifactId = 'lizzy'
pom {
name = 'Lizzy'
description = 'Multimedia playlist parser, supporting a wide range of playlist file formats.'
url = 'https://github.com/Borewit/lizzy'
packaging = 'jar'
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'
}
}
scm {
connection = 'scm:git:https://github.com/Borewit/lizzy.git'
url = 'https://github.com/Borewit/lizzy'
}
}
}
}
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = findProperty('ossrhUsername') ?: ""
password = findProperty('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 from being checkstyled
tasks.checkstyleMain.source = fileTree(dir: 'src/main/java').include('**/*.java')
// JAXB XJC generation tasks
def addXjcTask(taskName, schema, binding, dest) {
file(dest).mkdirs()
tasks.create(name: taskName, type: JavaExec) {
group = 'xjc'
classpath configurations.jaxb
mainClass = 'com.sun.tools.xjc.XJCFacade'
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 {
group = 'xjc'
dependsOn 'xjc-asx', 'xjc-atom', 'xjc-b4s', 'xjc-rmp', 'xjc-rss', 'xjc-smil', 'xjc-xspf'
}
tasks.compileJava.dependsOn(tasks.xjc)