-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
139 lines (122 loc) · 3.78 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
plugins {
id 'com.diffplug.spotless' version '6.25.0' apply false
}
wrapper {
gradleVersion = '8.12'
}
allprojects {
group = 'de.topobyte'
version = '1.4.0'
}
// leaving this here for reference on how to modify
// a single module version
configure(project(':osm4j-core')) {
version = '1.4.0'
}
ext.libraries = [
project(':osm4j-core'),
project(':osm4j-edit'),
project(':osm4j-extra'),
project(':osm4j-geometry'),
project(':osm4j-utils'),
project(':osm4j-incubating'),
project(':osm4j-pbf'),
project(':osm4j-pbf-full-runtime'),
project(':osm4j-replication'),
project(':osm4j-tbo'),
project(':osm4j-testing'),
project(':osm4j-xml')
]
configure(libraries) {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
}
configure(subprojects.findAll {it !in libraries}) {
apply plugin: 'java'
}
// Apply spotless to all projects except pbf-full-runtime. The plugin
// fails with this one as it pulls in the source from the other pbf module.
configure(subprojects.findAll {it.name != 'osm4j-pbf-full-runtime'}) {
apply plugin: 'com.diffplug.spotless'
spotless {
java {
eclipse('4.34').configFile("$project.rootDir/formatter.xml")
removeUnusedImports()
}
}
}
// Special spotless configuration for the pbf module: do not touch
// the protobuf generated files.
configure(project(':osm4j-pbf')) {
spotless {
java {
target = files("$project.projectDir/src/main/java", "$project.projectDir/src/test/java")
}
}
}
subprojects {
task allDeps(type: DependencyReportTask) {}
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
repositories {
maven {
url = 'https://mvn.topobyte.de'
}
maven {
url = 'https://mvn.slimjars.com'
}
mavenCentral()
}
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
withSourcesJar()
}
def global = new File('info.pom');
def local = new File(project.projectDir, 'info.pom');
def pomInfo = new XmlSlurper().parse(global);
def publish = !project.hasProperty('dontPublish')
if (publish) {
def pomInfoL = new XmlSlurper().parse(local);
pomInfo.name = pomInfoL.name
pomInfo.description = pomInfoL.description
}
if (publish) {
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = "$pomInfo.name"
description = "$pomInfo.description"
url = "$pomInfo.url"
licenses {
license {
name = "$pomInfo.licenseName"
url = "$pomInfo.licenseUrl"
distribution = "$pomInfo.licenseDistribution"
}
}
}
}
}
}
}
}
subprojects {
task showInterModuleDependencies {
doLast {
println "module '$project.name'"
project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.each {
if (it.id instanceof org.gradle.internal.component.local.model.PublishArtifactLocalArtifactMetadata) {
def component = it.id.componentIdentifier
if (component instanceof org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier) {
def path = component.projectPath
def name = path.substring(path.lastIndexOf(':') + 1)
println " → '$name'"
}
}
}
}
}
}