Skip to content

Commit cf29d66

Browse files
committed
Merge branch 'releases/r4.0.0' into issues/JPX-1-JDBC_access
Signed-off-by: Franz Wilhelmstötter <franz.wilhelmstoetter@gmail.com> ; Conflicts: ; .github/workflows/gradle.yml ; build.gradle.kts ; buildSrc/build.gradle.kts ; gradle/wrapper/gradle-wrapper.properties ; jpx/build.gradle.kts ; jpx/src/main/java/io/jenetics/jpx/GPX.java ; jpx/src/main/java/io/jenetics/jpx/package-info.java
2 parents f0f1ddb + eb93090 commit cf29d66

File tree

8 files changed

+86
-106
lines changed

8 files changed

+86
-106
lines changed

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ ubuntu-latest, macos-latest ]
20-
java-version: [ 21 ]
20+
java-version: [ 21, 24 ]
2121
steps:
2222
- uses: actions/checkout@v2
2323

@@ -27,4 +27,4 @@ jobs:
2727
java-version: ${{ matrix.java-version }}
2828
distribution: 'zulu'
2929
- name: Build with Gradle
30-
run: ./gradlew build --stacktrace --info
30+
run: ./gradlew build --stacktrace --info

build.gradle.kts

Lines changed: 72 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io.jenetics.gradle.dsl.isModule
22
import io.jenetics.gradle.dsl.moduleName
3+
import org.apache.tools.ant.filters.ReplaceTokens
34

45
/*
56
* Java GPX Library (@__identifier__@).
@@ -9,7 +10,7 @@ import io.jenetics.gradle.dsl.moduleName
910
* you may not use this file except in compliance with the License.
1011
* You may obtain a copy of the License at
1112
*
12-
* http://www.apache.org/licenses/LICENSE-2.0
13+
* http://www.apache.org/licenses/LICENSE-2.0
1314
*
1415
* Unless required by applicable law or agreed to in writing, software
1516
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,7 +19,7 @@ import io.jenetics.gradle.dsl.moduleName
1819
* limitations under the License.
1920
*
2021
* Author:
21-
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
22+
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
2223
*/
2324

2425
/**
@@ -28,91 +29,67 @@ import io.jenetics.gradle.dsl.moduleName
2829
*/
2930
plugins {
3031
base
31-
alias(libs.plugins.version.catalog.update)
32+
alias(libs.plugins.version.catalog.update)
3233
}
3334

3435
rootProject.version = JPX.VERSION
3536

3637
tasks.named<Wrapper>("wrapper") {
37-
version = "8.11"
38+
version = "9.0.0"
3839
distributionType = Wrapper.DistributionType.ALL
3940
}
4041

4142
/**
4243
* Project configuration *before* the projects has been evaluated.
4344
*/
4445
allprojects {
45-
group = JPX.GROUP
46-
version = rootProject.version
47-
48-
repositories {
49-
flatDir {
50-
dirs("${rootDir}/buildSrc/lib")
51-
}
52-
mavenLocal()
53-
mavenCentral()
54-
}
55-
56-
configurations.all {
57-
resolutionStrategy.preferProjectModules()
58-
}
46+
group = JPX.GROUP
47+
version = JPX.VERSION
48+
49+
repositories {
50+
flatDir {
51+
dirs("${rootDir}/buildSrc/lib")
52+
}
53+
mavenLocal()
54+
mavenCentral()
55+
}
56+
57+
configurations.all {
58+
resolutionStrategy.preferProjectModules()
59+
}
5960
}
6061

6162
/**
6263
* Project configuration *after* the projects has been evaluated.
6364
*/
64-
subprojects {
65-
val project = this
66-
67-
tasks.withType<Test> {
68-
useTestNG()
69-
}
70-
71-
plugins.withType<JavaPlugin> {
72-
configure<JavaPluginExtension> {
73-
modularity.inferModulePath = true
74-
75-
sourceCompatibility = JavaVersion.VERSION_21
76-
targetCompatibility = JavaVersion.VERSION_21
65+
gradle.projectsEvaluated {
66+
subprojects {
67+
val project = this
7768

78-
toolchain {
79-
languageVersion = JavaLanguageVersion.of(21)
80-
}
81-
}
69+
tasks.withType<JavaCompile> {
70+
options.compilerArgs.add("-Xlint:" + xlint())
71+
}
8272

83-
setupJava(project)
84-
setupTestReporting(project)
85-
}
73+
plugins.withType<JavaPlugin> {
74+
configure<JavaPluginExtension> {
75+
sourceCompatibility = JavaVersion.VERSION_21
76+
targetCompatibility = JavaVersion.VERSION_21
77+
}
8678

87-
tasks.withType<JavaCompile> {
88-
modularity.inferModulePath = true
79+
configure<JavaPluginExtension> {
80+
modularity.inferModulePath.set(true)
81+
}
8982

90-
options.compilerArgs.add("-Xlint:${xlint()}")
91-
}
83+
setupJava(project)
84+
setupTestReporting(project)
85+
setupJavadoc(project)
86+
}
9287

93-
}
88+
if (plugins.hasPlugin("maven-publish")) {
89+
setupPublishing(project)
90+
}
91+
}
9492

95-
gradle.projectsEvaluated {
96-
subprojects {
97-
if (plugins.hasPlugin("maven-publish")) {
98-
setupPublishing(project)
99-
}
100-
101-
// Enforcing the library version defined in the version catalogs.
102-
val catalogs = extensions.getByType<VersionCatalogsExtension>()
103-
val libraries = catalogs.catalogNames
104-
.map { catalogs.named(it) }
105-
.flatMap { catalog -> catalog.libraryAliases.map { alias -> Pair(catalog, alias) } }
106-
.map { it.first.findLibrary(it.second).get().get() }
107-
.filter { it.version != null }
108-
.map { it.toString() }
109-
.toTypedArray()
110-
111-
configurations.all {
112-
resolutionStrategy.preferProjectModules()
113-
resolutionStrategy.force(*libraries)
114-
}
115-
}
11693
}
11794

11895
/**
@@ -253,6 +230,9 @@ fun xlint(): String {
253230

254231
val identifier = "${JPX.ID}-${JPX.VERSION}"
255232

233+
/**
234+
* Setup of the Maven publishing.
235+
*/
256236
/**
257237
* Setup of the Maven publishing.
258238
*/
@@ -264,26 +244,29 @@ fun setupPublishing(project: Project) {
264244

265245
project.tasks.named<Jar>("sourcesJar") {
266246
filter(
267-
org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to mapOf(
268-
"__identifier__" to identifier,
269-
"__year__" to Env.COPYRIGHT_YEAR
270-
)
247+
ReplaceTokens::class, "tokens" to mapOf(
248+
"__identifier__" to identifier,
249+
"__year__" to Env.COPYRIGHT_YEAR
250+
)
271251
)
272252
}
273253

274254
project.tasks.named<Jar>("javadocJar") {
275255
filter(
276-
org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to mapOf(
277-
"__identifier__" to identifier,
278-
"__year__" to Env.COPYRIGHT_YEAR
279-
)
256+
ReplaceTokens::class, "tokens" to mapOf(
257+
"__identifier__" to identifier,
258+
"__year__" to Env.COPYRIGHT_YEAR
259+
)
280260
)
281261
}
282262

283263
project.configure<PublishingExtension> {
284264
publications {
285265
create<MavenPublication>("mavenJava") {
286-
artifactId = JPX.ID
266+
suppressPomMetadataWarningsFor("testFixturesApiElements")
267+
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")
268+
269+
artifactId = project.name
287270
from(project.components["java"])
288271
versionMapping {
289272
usage("java-api") {
@@ -323,24 +306,23 @@ fun setupPublishing(project: Project) {
323306
}
324307
repositories {
325308
maven {
326-
url = if (version.toString().endsWith("SNAPSHOT")) {
327-
uri(Maven.SNAPSHOT_URL)
328-
} else {
329-
uri(Maven.RELEASE_URL)
330-
}
309+
url = if (version.toString().endsWith("SNAPSHOT"))
310+
uri(layout.buildDirectory.dir("repos/snapshots"))
311+
else
312+
uri(layout.buildDirectory.dir("repos/releases"))
313+
}
314+
}
331315

332-
credentials {
333-
username = if (extra.properties["nexus_username"] != null) {
334-
extra.properties["nexus_username"] as String
335-
} else {
336-
"nexus_username"
337-
}
338-
password = if (extra.properties["nexus_password"] != null) {
339-
extra.properties["nexus_password"] as String
340-
} else {
341-
"nexus_password"
342-
}
343-
}
316+
// Exclude test fixtures from publication, as we use them only internally
317+
plugins.withId("org.gradle.java-test-fixtures") {
318+
val component = components["java"] as AdhocComponentWithVariants
319+
component.withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() }
320+
component.withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() }
321+
322+
// Workaround to not publish test fixtures sources added by com.vanniktech.maven.publish plugin
323+
// TODO: Remove as soon as https://github.com/vanniktech/gradle-maven-publish-plugin/issues/779 closed
324+
afterEvaluate {
325+
component.withVariantsFromConfiguration(configurations["testFixturesSourcesElements"]) { skip() }
344326
}
345327
}
346328
}

buildSrc/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
* @version 3.2
2525
*/
2626
plugins {
27-
`java-gradle-plugin`
28-
`kotlin-dsl`
27+
`java-gradle-plugin`
28+
`kotlin-dsl`
2929
}
3030

3131
repositories {
32-
mavenLocal()
33-
gradlePluginPortal()
32+
mavenLocal()
33+
gradlePluginPortal()
3434
}

buildSrc/resources/javadoc/java.se/element-list

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ java.io
33
java.lang
44
java.lang.annotation
55
java.lang.constant
6+
java.lang.foreign
67
java.lang.invoke
78
java.lang.module
89
java.lang.ref
@@ -221,12 +222,9 @@ module:jdk.hotspot.agent
221222
module:jdk.httpserver
222223
com.sun.net.httpserver
223224
com.sun.net.httpserver.spi
224-
module:jdk.incubator.foreign
225-
jdk.incubator.foreign
226225
module:jdk.incubator.vector
227226
jdk.incubator.vector
228227
module:jdk.jartool
229-
com.sun.jarsigner
230228
jdk.security.jarsigner
231229
module:jdk.javadoc
232230
jdk.javadoc.doclet

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

jpx/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ description = "JPX - Java GPX (GPS) Library"
3535
moduleName = "io.jenetics.jpx"
3636

3737
dependencies {
38-
testImplementation(libs.assertj.core)
38+
testImplementation(libs.assertj.core)
3939
testImplementation(libs.equalsverifier)
4040
testImplementation(libs.prngine)
4141
testImplementation(libs.testng)

jpx/src/main/java/io/jenetics/jpx/GPX.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
* final GPX gpx = GPX.Reader.of(GPX.Reader.Mode.LENIENT).read("track.xml");
123123
* }
124124
*
125-
* This allows reading otherwise invalid GPX files, like
126-
* <pre>{@code
125+
* This allows to read otherwise invalid GPX files, like
126+
* {@snippet lang="java":
127127
* <?xml version="1.0" encoding="UTF-8"?>
128128
* <gpx version="1.1" creator="GPSBabel - http://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/1">
129129
* <metadata>
@@ -1625,8 +1625,8 @@ byte[] toByteArray(final GPX gpx) {
16251625
* {@link WayPoint#getLongitude()}, ...
16261626
* <p>
16271627
* The example below shows the <em>lat</em> and <em>lon</em> values with
1628-
* maximal five fractional digits.
1629-
* <pre>{@code
1628+
* maximal 5 fractional digits.
1629+
* {@snippet lang="java":
16301630
* <trkpt lat="45.78068" lon="12.55368">
16311631
* <ele>1.2</ele>
16321632
* <time>2009-08-30T07:08:21Z</time>

jpx/src/main/java/io/jenetics/jpx/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* This is the base package of the <a href="https://github.com/jenetics/jpx">
2323
* JPX</a> library. It contains the <em>domain</em> objects which are needed
24-
* for full modeling of the <a href="https://www.topografix.com/GPX/1/1/">
24+
* for fully modeling of the <a href="https://www.topografix.com/GPX/1/1/">
2525
* GPX standard 1.1</a> and <a href="http://www.topografix.com/gpx_manual.as">
2626
* 1.0</a>.
2727
*

0 commit comments

Comments
 (0)