Skip to content

Commit

Permalink
Resolve Gradle deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Sep 16, 2024
1 parent 795346f commit bfa566a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ plugins {
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}

val buildTimeAndDate = OffsetDateTime.now()
val buildDate = DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate)
val buildTime = DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate)
val buildTimeAndDate: OffsetDateTime = OffsetDateTime.now()
val buildDate: String = DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate)
val buildTime: String = DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate)
val builtByValue = project.findProperty("builtBy") ?: project.property("defaultBuiltBy")

val isSnapshot = project.version.toString().contains("SNAPSHOT")
val docsVersion = if (isSnapshot) "snapshot" else project.version
val docsDir = File(buildDir, "ghpages-docs")
val docsVersion = if (isSnapshot) "snapshot" else project.version.toString()
val docsDir = layout.buildDirectory.dir("ghpages-docs")
val replaceCurrentDocs = project.hasProperty("replaceCurrentDocs")

description = "@API Guardian"
Expand All @@ -47,7 +47,7 @@ tasks {

val compileModule by registering(JavaCompile::class) {
source(moduleSourceDir)
destinationDir = file("$buildDir/classes/java/modules")
destinationDirectory = layout.buildDirectory.dir("classes/java/modules")
classpath = files(compileJava.map { it.classpath })
inputs.property("moduleName", moduleName)
inputs.property("moduleVersion", project.version)
Expand Down Expand Up @@ -90,7 +90,7 @@ tasks {
"Bundle-SymbolicName" to moduleName
)
}
from(files(compileModule.map { "${it.destinationDir}/${moduleName}" })) {
from(files(compileModule.flatMap { destinationDirectory.map { it.dir(moduleName) } })) {
include("module-info.class")
}
}
Expand Down Expand Up @@ -129,15 +129,15 @@ tasks {
dependsOn(javadoc)
outputs.dir(docsDir)

from("$buildDir/docs") {
from(layout.buildDirectory.dir("docs")) {
include("javadoc/**")
}
from("$buildDir/docs/javadoc") {
from(layout.buildDirectory.dir("docs/javadoc")) {
// For compatibility with pre JDK 10 versions of the Javadoc tool
include("element-list")
rename { "api/package-list" }
}
into("${docsDir}/${docsVersion}")
into(docsDir.map { it.dir(docsVersion) })
filesMatching("javadoc/**") {
path = path.replace("javadoc/", "api/")
}
Expand All @@ -149,8 +149,8 @@ tasks {
enabled = replaceCurrentDocs
outputs.dir("${docsDir}/current")

from("${docsDir}/${docsVersion}")
into("${docsDir}/current")
from(docsDir.map { it.dir(docsVersion) })
into(docsDir.map { it.dir("current") })
}

gitPublishCommit {
Expand Down Expand Up @@ -187,7 +187,7 @@ publishing {
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
Expand Down

0 comments on commit bfa566a

Please sign in to comment.