-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
92 lines (70 loc) · 3.12 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
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
group 'it.osm.gtfs'
version '1.3.0'
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
implementation 'com.google.guava:guava:33.3.1-jre'
implementation 'org.json:json:20231013'
implementation 'org.fusesource.jansi:jansi:2.4.1'
implementation 'com.graphhopper:graphhopper-map-matching:9.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'
implementation 'org.slf4j:slf4j-simple:2.0.16'
//custom jxmapviewer2 libs with fixes for the bing imagery zoom levels
implementation 'com.github.gabboxl:jxmapviewer2:b2b31b1f84'
implementation 'info.picocli:picocli:4.7.6'
implementation 'info.picocli:picocli-shell-jline3:4.7.6'
annotationProcessor 'info.picocli:picocli-codegen:4.7.6'
implementation 'org.mapfish.geo:mapfish-geo-lib:1.2.0'
implementation 'org.openstreetmap.osmosis:osmosis-xml:0.48.3'
implementation 'org.openstreetmap.osmosis:osmosis-set:0.48.3'
implementation 'org.openstreetmap.osmosis:osmosis-tagfilter:0.48.3'
implementation 'it.tidalwave.betterbeansbinding:betterbeansbinding-swingbinding:1.3.0'
implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'commons-httpclient:commons-httpclient:3.1'
shadow 'junit:junit:4.13.2'
}
//needed for Picocli
compileJava {
options.compilerArgs += ["-Aproject=${project.group}/${project.name}"]
}
shadowJar { /*il plugin shadowJar per Gradle fa al caso nostro per creare un file fat jar contenente tutte le dipendenze del progetto:
il problema sorge quando si cerca di includere le librerie Osmosis: ognuni modulo di osmosis (noi siamo usando il modulo osmosis-xml e osmosis-set)
contiene un file osmosis-plugins.conf che indica la classpath del plugin da caricare.
Quando gradle cerca di includere questi plugin in un file jar essendoci piu' file duplicati osmosis-plugins.conf ne puo' includere soltanto uno di essi.
La soluzione sarebbe fare un merge di questi file, infatti shadowJar permette di farlo in modo automatico.
*/
archiveBaseName.set(project.name)
archiveClassifier.set('')
archiveVersion.set('')
manifest {
attributes 'Main-Class': 'it.osm.gtfs.GTFSOSMImport'
attributes 'Implementation-Version': project.version
}
configurations = [project.configurations.compileClasspath]
append 'osmosis-plugins.conf' //questo comando serve per effettuare il merge dei file osmosis-plugins.conf duplicati
}
/*
jar {
manifest {
attributes(
'Main-Class': 'it.osm.gtfs.GTFSOSMImport',
)
}
duplicatesStrategy = DuplicatesStrategy.WARN
from {
//configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
println(configurations.runtimeClasspath)
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
} */
test {
useJUnitPlatform()
}