-
Notifications
You must be signed in to change notification settings - Fork 57
/
build.gradle
169 lines (146 loc) · 4.81 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
/*
* Copyright Contributors to the GPX Animator project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.github.spotbugs' version '6.0.25'
id 'pmd'
id 'checkstyle'
id 'java-library'
id 'org.bytedeco.gradle-javacpp-platform' version '1.5.10'
id 'io.freefair.lombok' version '8.10.2'
id 'maven-publish'
}
version = '1.9.0-SNAPSHOT'
group = 'app.gpx-animator'
application {
mainClass.set('app.gpx_animator.Main')
}
java {
// Before updating Java, check Lombok Grade Plugin compatibility:
// https://github.com/freefair/gradle-plugins#compatibility-matrix
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
configurations {
developmentOnly
}
// We can set this on the command line, too: -PjavacppPlatform="linux-x86,linux-x86_64,macosx-x86_64,macosx-arm64,windows-x86,windows-x86_64"
ext {
javacppPlatform = 'linux-x86,linux-x86_64,macosx-x86_64,macosx-arm64,windows-x86,windows-x86_64'
}
dependencies {
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.6'
implementation 'org.jetbrains:annotations:26.0.1'
implementation 'org.bytedeco:javacv:1.5.10'
implementation 'org.bytedeco:ffmpeg-platform-gpl:6.1.1-1.5.10'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
implementation 'javax.activation:activation:1.1.1'
implementation 'org.slf4j:slf4j-api:2.0.16'
implementation 'ch.qos.logback:logback-classic:1.5.12'
implementation 'com.drewnoakes:metadata-extractor:2.19.0'
implementation 'org.imgscalr:imgscalr-lib:4.2'
implementation 'commons-io:commons-io:20030203.000550'
implementation 'com.jgoodies:jgoodies-forms:1.9.0'
implementation 'com.vladsch.flexmark:flexmark-all:0.64.8'
implementation 'org.reflections:reflections:0.10.2'
implementation 'org.apache.maven:maven-artifact:3.9.9'
implementation 'org.apache.commons:commons-lang3:3.17.0'
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.6'
testImplementation 'com.github.romankh3:image-comparison:4.4.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.3'
testImplementation 'org.junit.platform:junit-platform-engine:1.11.3'
}
test.classpath += configurations.developmentOnly
run.classpath += configurations.developmentOnly
test {
useJUnitPlatform { }
maxParallelForks = 4
minHeapSize = "1G"
maxHeapSize = "2G"
dependsOn 'createVersionFile'
}
shadowJar {
mergeServiceFiles()
}
spotbugs {
excludeFilter = file("${projectDir}/config/spotbugs/exclude.xml")
}
spotbugsMain {
reports {
xml.enabled(false)
html.enabled(true)
}
}
spotbugsTest {
reports {
xml.enabled(false)
html.enabled(true)
}
}
checkstyle {
configFile file("${projectDir}/config/checkstyle/checkstyle.xml")
toolVersion "10.19.0"
}
pmd {
toolVersion = "7.7.0"
ruleSets = []
ruleSetFiles = files("${projectDir}/config/pmd/pmd-rules.xml")
}
tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs += ["-Xlint:deprecation", "-Xlint:unchecked"]
}
tasks.register('copyFiles', Copy) {
from(".")
include("CHANGELOG.md", "LICENSE.md")
into("./src/main/resources")
}
tasks.register('deleteFiles', Delete) {
delete("./src/main/resources/CHANGELOG.md", "./src/main/resources/LICENSE.md")
}
tasks.register('createVersionFile') {
doLast {
def version = project.version.toString()
def directory = getLayout().getBuildDirectory().get().toString()
def file = new File("$directory/resources/main/version.txt")
file.write(version)
}
}
publishing {
afterEvaluate {
components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}
}
publications {
release(MavenPublication) {
from components.java
}
}
}
processResources.dependsOn copyFiles
clean.dependsOn deleteFiles
assemble.dependsOn check
jar.dependsOn createVersionFile