Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
java-version: [ 17, 21, 23 ]
java-version: [ 21, 24 ]
steps:
- uses: actions/checkout@v2

Expand All @@ -27,4 +27,4 @@ jobs:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
- name: Build with Gradle
run: ./gradlew build --stacktrace --info
run: ./gradlew build --stacktrace --info
112 changes: 45 additions & 67 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io.jenetics.gradle.dsl.isModule
import io.jenetics.gradle.dsl.moduleName
import org.apache.tools.ant.filters.ReplaceTokens

/*
* Java GPX Library (@__identifier__@).
Expand All @@ -9,7 +10,7 @@ import io.jenetics.gradle.dsl.moduleName
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://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,
Expand All @@ -18,7 +19,7 @@ import io.jenetics.gradle.dsl.moduleName
* limitations under the License.
*
* Author:
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
* Franz Wilhelmstötter (franz.wilhelmstoetter@gmail.com)
*/

/**
Expand All @@ -28,13 +29,13 @@ import io.jenetics.gradle.dsl.moduleName
*/
plugins {
base
id("me.champeau.jmh") version "0.7.2" apply false
alias(libs.plugins.version.catalog.update)
}

rootProject.version = JPX.VERSION

tasks.named<Wrapper>("wrapper") {
version = "8.11"
version = "9.0.0"
distributionType = Wrapper.DistributionType.ALL
}

Expand Down Expand Up @@ -71,8 +72,8 @@ gradle.projectsEvaluated {

plugins.withType<JavaPlugin> {
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

configure<JavaPluginExtension> {
Expand Down Expand Up @@ -169,13 +170,12 @@ fun setupJavadoc(project: Project) {
doclet.charSet = "UTF-8"
doclet.linkSource(true)
doclet.linksOffline(
"https://docs.oracle.com/en/java/javase/17/docs/api/",
"https://docs.oracle.com/en/java/javase/21/docs/api/",
"${project.rootDir}/buildSrc/resources/javadoc/java.se"
)
doclet.windowTitle = "JPX ${project.version}"
doclet.docTitle = "<h1>JPX ${project.version}</h1>"
doclet.bottom = "&copy; ${Env.COPYRIGHT_YEAR} Franz Wilhelmst&ouml;tter &nbsp;<i>(${Env.BUILD_DATE})</i>"
doclet.stylesheetFile = project.file("${project.rootDir}/buildSrc/resources/javadoc/stylesheet.css")

doclet.tags = listOf(
"apiNote:a:API Note:",
Expand All @@ -193,38 +193,6 @@ fun setupJavadoc(project: Project) {
}
}
}

val javadoc = project.tasks.findByName("javadoc") as Javadoc?
if (javadoc != null) {
project.tasks.register<io.jenetics.gradle.ColorizerTask>("colorizer") {
directory = javadoc.destinationDir!!
}

project.tasks.register("java2html") {
doLast {
providers.javaexec {
mainClass.set("de.java2html.Java2Html")
args = listOf(
"-srcdir", "src/main/java",
"-targetdir", "${javadoc.destinationDir}/src-html/${project.extra["moduleName"]}"
)
classpath = files("${project.rootDir}/buildSrc/lib/java2html.jar")
}
}
}

javadoc.doLast {
val colorizer = project.tasks.findByName("colorizer")
colorizer?.actions?.forEach {
it.execute(colorizer)
}

val java2html = project.tasks.findByName("java2html")
java2html?.actions?.forEach {
it.execute(java2html)
}
}
}
}

/**
Expand All @@ -242,13 +210,18 @@ fun xlint(): String {
"empty",
"exports",
"finally",
"lossy-conversions",
"module",
"opens",
"overrides",
"rawtypes",
"removal",
"serial",
// "serial",
"static",
"strictfp",
"synchronization",
"text-blocks",
"this-escape",
"try",
"unchecked",
"varargs"
Expand All @@ -257,6 +230,9 @@ fun xlint(): String {

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

/**
* Setup of the Maven publishing.
*/
/**
* Setup of the Maven publishing.
*/
Expand All @@ -268,26 +244,29 @@ fun setupPublishing(project: Project) {

project.tasks.named<Jar>("sourcesJar") {
filter(
org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to mapOf(
"__identifier__" to identifier,
"__year__" to Env.COPYRIGHT_YEAR
)
ReplaceTokens::class, "tokens" to mapOf(
"__identifier__" to identifier,
"__year__" to Env.COPYRIGHT_YEAR
)
)
}

project.tasks.named<Jar>("javadocJar") {
filter(
org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to mapOf(
"__identifier__" to identifier,
"__year__" to Env.COPYRIGHT_YEAR
)
ReplaceTokens::class, "tokens" to mapOf(
"__identifier__" to identifier,
"__year__" to Env.COPYRIGHT_YEAR
)
)
}

project.configure<PublishingExtension> {
publications {
create<MavenPublication>("mavenJava") {
artifactId = JPX.ID
suppressPomMetadataWarningsFor("testFixturesApiElements")
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")

artifactId = project.name
from(project.components["java"])
versionMapping {
usage("java-api") {
Expand Down Expand Up @@ -327,24 +306,23 @@ fun setupPublishing(project: Project) {
}
repositories {
maven {
url = if (version.toString().endsWith("SNAPSHOT")) {
uri(Maven.SNAPSHOT_URL)
} else {
uri(Maven.RELEASE_URL)
}
url = if (version.toString().endsWith("SNAPSHOT"))
uri(layout.buildDirectory.dir("repos/snapshots"))
else
uri(layout.buildDirectory.dir("repos/releases"))
}
}

credentials {
username = if (extra.properties["nexus_username"] != null) {
extra.properties["nexus_username"] as String
} else {
"nexus_username"
}
password = if (extra.properties["nexus_password"] != null) {
extra.properties["nexus_password"] as String
} else {
"nexus_password"
}
}
// Exclude test fixtures from publication, as we use them only internally
plugins.withId("org.gradle.java-test-fixtures") {
val component = components["java"] as AdhocComponentWithVariants
component.withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() }
component.withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() }

// Workaround to not publish test fixtures sources added by com.vanniktech.maven.publish plugin
// TODO: Remove as soon as https://github.com/vanniktech/gradle-maven-publish-plugin/issues/779 closed
afterEvaluate {
component.withVariantsFromConfiguration(configurations["testFixturesSourcesElements"]) { skip() }
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,3 @@ repositories {
mavenLocal()
gradlePluginPortal()
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
4 changes: 1 addition & 3 deletions buildSrc/resources/javadoc/java.se/element-list
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ java.io
java.lang
java.lang.annotation
java.lang.constant
java.lang.foreign
java.lang.invoke
java.lang.module
java.lang.ref
Expand Down Expand Up @@ -221,12 +222,9 @@ module:jdk.hotspot.agent
module:jdk.httpserver
com.sun.net.httpserver
com.sun.net.httpserver.spi
module:jdk.incubator.foreign
jdk.incubator.foreign
module:jdk.incubator.vector
jdk.incubator.vector
module:jdk.jartool
com.sun.jarsigner
jdk.security.jarsigner
module:jdk.javadoc
jdk.javadoc.doclet
Expand Down
Loading
Loading