Skip to content

Commit 7fe2e7a

Browse files
authored
Merge pull request #175 from jenetics/releases/r4.0.0
v4.0.0
2 parents d14c867 + 88309a2 commit 7fe2e7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+487
-1931
lines changed

.github/workflows/gradle.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
name: JPX Build
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
- releases/*
8-
- issues/*
9-
pull_request:
10-
branches:
11-
- master
12-
- releases/*
4+
push:
5+
branches:
6+
- master
7+
- releases/*
8+
- issues/*
9+
pull_request:
10+
branches:
11+
- master
12+
- releases/*
1313

1414
jobs:
15-
build:
16-
runs-on: ${{ matrix.os }}
17-
strategy:
18-
matrix:
19-
os: [ ubuntu-latest, macos-latest ]
20-
java-version: [ 17, 21, 23 ]
21-
steps:
22-
- uses: actions/checkout@v2
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ ubuntu-latest, macos-latest ]
20+
java-version: [ 25 ]
21+
steps:
22+
- uses: actions/checkout@v4
2323

24-
- name: Set up JDK ${{ matrix.java-version }} on ${{ matrix.os }}
25-
uses: actions/setup-java@v2
26-
with:
27-
java-version: ${{ matrix.java-version }}
28-
distribution: 'zulu'
29-
- name: Build with Gradle
30-
run: ./gradlew build --stacktrace --info
24+
- name: Set up JDK ${{ matrix.java-version }} on ${{ matrix.os }}
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: ${{ matrix.java-version }}
28+
distribution: 'zulu'
29+
cache: 'gradle'
30+
- name: Build with Gradle
31+
run: ./gradlew build --stacktrace --info

README.md

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# JPX
22

33
![Build Status](https://github.com/jenetics/jpx/actions/workflows/gradle.yml/badge.svg)
4-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.jenetics/jpx/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22jpx%22)
4+
[![Maven Central Version](https://img.shields.io/maven-central/v/io.jenetics/jpx?color=green)](https://central.sonatype.com/artifact/io.jenetics/jpx)
55
[![Javadoc](https://www.javadoc.io/badge/io.jenetics/jpx.svg)](http://www.javadoc.io/doc/io.jenetics/jpx)
66

7-
**JPX** is a Java library for creating, reading and writing [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System) data in [GPX](https://en.wikipedia.org/wiki/GPS_Exchange_Format) format. It is a *full* implementation of version [1.1](http://www.topografix.com/GPX/1/1/) and version [1.0](http://www.topografix.com/gpx_manual.asp) of the GPX format. The data classes are completely immutable and allows a functional programming style. They are working also nicely with the Java [Stream](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/Stream.html) API. It is also possible to convert the location information into strings which are compatible to the [ISO 6709](http://en.wikipedia.org/wiki/ISO_6709) standard.
7+
8+
**JPX** is a Java library for creating, reading and writing [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System) data in [GPX](https://en.wikipedia.org/wiki/GPS_Exchange_Format) format. It is a *full* implementation of version [1.1](http://www.topografix.com/GPX/1/1/) and version [1.0](http://www.topografix.com/gpx_manual.asp) of the GPX format. The data classes are completely immutable and allows a functional programming style. They are working also nicely with the Java [Stream](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/stream/Stream.html) API. It is also possible to convert the location information into strings which are compatible to the [ISO 6709](http://en.wikipedia.org/wiki/ISO_6709) standard.
89

910
Besides the basic functionality of reading and writing GPX files, the library also allows manipulating the read GPX object in a functional way.
1011

1112

1213
## Dependencies
1314

14-
The _JPX_ library needs no external dependencies. It only needs **Java 17** to compile and run. It also runs and compiles with **Java 21** and **Java 23**.
15+
The _JPX_ library needs no external dependencies. It needs **Java 25** to compile and run.
1516

1617

1718
## Building JPX
@@ -314,7 +315,7 @@ org.acme.NonValidatingDocumentBuilder
314315

315316
The library is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
316317

317-
Copyright 2016-2025 Franz Wilhelmstötter
318+
Copyright 2016-2026 Franz Wilhelmstötter
318319

319320
Licensed under the Apache License, Version 2.0 (the "License");
320321
you may not use this file except in compliance with the License.
@@ -330,62 +331,12 @@ The library is licensed under the [Apache License, Version 2.0](http://www.apach
330331

331332
## Release notes
332333

333-
### [3.2.1](https://github.com/jenetics/jpx/releases/tag/v3.2.1)
334-
335-
#### Improvements
336-
337-
* [#186](https://github.com/jenetics/jpx/issues/186): LENIENT mode allows GPX tags without creator attributes.
338-
339-
### [3.2.0](https://github.com/jenetics/jpx/releases/tag/v3.2.0)
340-
341-
#### Improvements
342-
343-
* [#183](https://github.com/jenetics/jpx/issues/183): Update Gradle to 8.11 and improve build scripts.
344-
* [#181](https://github.com/jenetics/jpx/pull/181): Update code examples in README.
345-
346-
### [3.1.0](https://github.com/jenetics/jpx/releases/tag/v3.1.0)
334+
### [4.0.0](https://github.com/jenetics/jpx/releases/tag/v4.0.0)
347335

348336
#### Improvements
349337

350-
* [#170](https://github.com/jenetics/jpx/issues/170): GPX files with invalid version number are now readable in _LENIENT_ mode.
351-
```java
352-
final GPX gpx;
353-
try (InputStream in = new FileInputStream(resource)) {
354-
gpx = GPX.Reader.of(Mode.LENIENT).read(in);
355-
}
356-
```
357-
358-
#### Bugs
359-
360-
* [#167](https://github.com/jenetics/jpx/issues/167): Fixing a test case for Windows.
361-
362-
### [3.0.1](https://github.com/jenetics/jpx/releases/tag/v3.0.1)
363-
364-
#### Bugs
338+
* [#177](https://github.com/jenetics/jpx/issues/177): Convert 'geom' classes to records.
339+
* [#192](https://github.com/jenetics/jpx/issues/192): Update library to Java 25.
365340

366-
* [#162](https://github.com/jenetics/jpx/issues/162): Elevation serialization for values > 1000m is incompatible with deserialization.
367-
368-
### [3.0.0](https://github.com/jenetics/jpx/releases/tag/v3.0.0)
369-
370-
#### Improvements
371-
372-
* [#125](https://github.com/jenetics/jpx/issues/125): **Breaking change** - Use `Instant` instead of `ZonedDateTime` for `Point.time` property.
373-
* [#148](https://github.com/jenetics/jpx/issues/148): **Breaking change** - Update to Java17.
374-
* [#155](https://github.com/jenetics/jpx/issues/155): Improved `GPX.Reader` and `GPX.Writer` classes.
375-
* [#158](https://github.com/jenetics/jpx/issues/158): Add XML `Document` reader/writer methods.
376-
```java
377-
final GPX gpx = ...;
378-
379-
final Document doc = XMLProvider.provider()
380-
.documentBuilderFactory()
381-
.newDocumentBuilder()
382-
.newDocument();
383-
384-
// The GPX data are written to the empty `doc` object.
385-
GPX.Writer.DEFAULT.write(gpx, new DOMResult(doc));
386-
```
387341

388-
#### Bugs
389342

390-
* [#151](https://github.com/jenetics/jpx/issues/151): `Double`'s being written as exponents in GPX file.
391-
* [#152](https://github.com/jenetics/jpx/issues/152): `LocationFormatter::parse` method is not thread-safe.

build.gradle.kts

Lines changed: 46 additions & 68 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,13 +29,13 @@ import io.jenetics.gradle.dsl.moduleName
2829
*/
2930
plugins {
3031
base
31-
id("me.champeau.jmh") version "0.7.2" apply false
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.3.1"
3839
distributionType = Wrapper.DistributionType.ALL
3940
}
4041

@@ -71,8 +72,8 @@ gradle.projectsEvaluated {
7172

7273
plugins.withType<JavaPlugin> {
7374
configure<JavaPluginExtension> {
74-
sourceCompatibility = JavaVersion.VERSION_17
75-
targetCompatibility = JavaVersion.VERSION_17
75+
sourceCompatibility = JavaVersion.VERSION_25
76+
targetCompatibility = JavaVersion.VERSION_25
7677
}
7778

7879
configure<JavaPluginExtension> {
@@ -132,7 +133,7 @@ fun setupTestReporting(project: Project) {
132133
project.apply(plugin = "jacoco")
133134

134135
project.configure<JacocoPluginExtension> {
135-
toolVersion = "0.8.12"
136+
toolVersion = libs.jacoco.agent.get().version.toString()
136137
}
137138

138139
project.tasks {
@@ -169,13 +170,12 @@ fun setupJavadoc(project: Project) {
169170
doclet.charSet = "UTF-8"
170171
doclet.linkSource(true)
171172
doclet.linksOffline(
172-
"https://docs.oracle.com/en/java/javase/17/docs/api/",
173+
"https://docs.oracle.com/en/java/javase/25/docs/api/",
173174
"${project.rootDir}/buildSrc/resources/javadoc/java.se"
174175
)
175176
doclet.windowTitle = "JPX ${project.version}"
176177
doclet.docTitle = "<h1>JPX ${project.version}</h1>"
177178
doclet.bottom = "&copy; ${Env.COPYRIGHT_YEAR} Franz Wilhelmst&ouml;tter &nbsp;<i>(${Env.BUILD_DATE})</i>"
178-
doclet.stylesheetFile = project.file("${project.rootDir}/buildSrc/resources/javadoc/stylesheet.css")
179179

180180
doclet.tags = listOf(
181181
"apiNote:a:API Note:",
@@ -193,38 +193,6 @@ fun setupJavadoc(project: Project) {
193193
}
194194
}
195195
}
196-
197-
val javadoc = project.tasks.findByName("javadoc") as Javadoc?
198-
if (javadoc != null) {
199-
project.tasks.register<io.jenetics.gradle.ColorizerTask>("colorizer") {
200-
directory = javadoc.destinationDir!!
201-
}
202-
203-
project.tasks.register("java2html") {
204-
doLast {
205-
providers.javaexec {
206-
mainClass.set("de.java2html.Java2Html")
207-
args = listOf(
208-
"-srcdir", "src/main/java",
209-
"-targetdir", "${javadoc.destinationDir}/src-html/${project.extra["moduleName"]}"
210-
)
211-
classpath = files("${project.rootDir}/buildSrc/lib/java2html.jar")
212-
}
213-
}
214-
}
215-
216-
javadoc.doLast {
217-
val colorizer = project.tasks.findByName("colorizer")
218-
colorizer?.actions?.forEach {
219-
it.execute(colorizer)
220-
}
221-
222-
val java2html = project.tasks.findByName("java2html")
223-
java2html?.actions?.forEach {
224-
it.execute(java2html)
225-
}
226-
}
227-
}
228196
}
229197

230198
/**
@@ -242,13 +210,18 @@ fun xlint(): String {
242210
"empty",
243211
"exports",
244212
"finally",
213+
"lossy-conversions",
245214
"module",
246215
"opens",
247216
"overrides",
248217
"rawtypes",
249218
"removal",
250-
"serial",
219+
// "serial",
251220
"static",
221+
"strictfp",
222+
"synchronization",
223+
"text-blocks",
224+
"this-escape",
252225
"try",
253226
"unchecked",
254227
"varargs"
@@ -257,6 +230,9 @@ fun xlint(): String {
257230

258231
val identifier = "${JPX.ID}-${JPX.VERSION}"
259232

233+
/**
234+
* Setup of the Maven publishing.
235+
*/
260236
/**
261237
* Setup of the Maven publishing.
262238
*/
@@ -268,26 +244,29 @@ fun setupPublishing(project: Project) {
268244

269245
project.tasks.named<Jar>("sourcesJar") {
270246
filter(
271-
org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to mapOf(
272-
"__identifier__" to identifier,
273-
"__year__" to Env.COPYRIGHT_YEAR
274-
)
247+
ReplaceTokens::class, "tokens" to mapOf(
248+
"__identifier__" to identifier,
249+
"__year__" to Env.COPYRIGHT_YEAR
250+
)
275251
)
276252
}
277253

278254
project.tasks.named<Jar>("javadocJar") {
279255
filter(
280-
org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to mapOf(
281-
"__identifier__" to identifier,
282-
"__year__" to Env.COPYRIGHT_YEAR
283-
)
256+
ReplaceTokens::class, "tokens" to mapOf(
257+
"__identifier__" to identifier,
258+
"__year__" to Env.COPYRIGHT_YEAR
259+
)
284260
)
285261
}
286262

287263
project.configure<PublishingExtension> {
288264
publications {
289265
create<MavenPublication>("mavenJava") {
290-
artifactId = JPX.ID
266+
suppressPomMetadataWarningsFor("testFixturesApiElements")
267+
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")
268+
269+
artifactId = project.name
291270
from(project.components["java"])
292271
versionMapping {
293272
usage("java-api") {
@@ -327,24 +306,23 @@ fun setupPublishing(project: Project) {
327306
}
328307
repositories {
329308
maven {
330-
url = if (version.toString().endsWith("SNAPSHOT")) {
331-
uri(Maven.SNAPSHOT_URL)
332-
} else {
333-
uri(Maven.RELEASE_URL)
334-
}
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+
}
335315

336-
credentials {
337-
username = if (extra.properties["nexus_username"] != null) {
338-
extra.properties["nexus_username"] as String
339-
} else {
340-
"nexus_username"
341-
}
342-
password = if (extra.properties["nexus_password"] != null) {
343-
extra.properties["nexus_password"] as String
344-
} else {
345-
"nexus_password"
346-
}
347-
}
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() }
348326
}
349327
}
350328
}

buildSrc/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,3 @@ repositories {
3535
mavenLocal()
3636
gradlePluginPortal()
3737
}
38-
39-
tasks.withType<KotlinCompile> {
40-
compilerOptions {
41-
jvmTarget.set(JvmTarget.JVM_17)
42-
}
43-
}
44-
45-
configure<JavaPluginExtension> {
46-
sourceCompatibility = JavaVersion.VERSION_17
47-
targetCompatibility = JavaVersion.VERSION_17
48-
}

0 commit comments

Comments
 (0)