Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elect86 committed Sep 26, 2024
1 parent e9ace2b commit 2278f8b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ tasks {
finalizedBy(jacocoTestReport) // report is always generated after tests run
}
jar {
archiveVersion.set(rootProject.version.toString())
archiveVersion = rootProject.version.toString()

manifest.attributes["Implementation-Build"] = run { // retrieve the git commit hash
val gitFolder = "$projectDir/.git/"
Expand All @@ -185,7 +185,7 @@ tasks {
withType<GenerateMavenPom>().configureEach {
val scijavaParentPomVersion = project.properties["scijavaParentPOMVersion"]
val matcher = Regex("""generatePomFileFor(\w+)Publication""").matchEntire(name)
val publicationName = matcher?.let { it.groupValues[1] }
// val publicationName = matcher?.let { it.groupValues[1] }

pom.properties.empty()

Expand Down Expand Up @@ -344,8 +344,8 @@ tasks {

jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(true)
xml.required = true
html.required = true
}
dependsOn(test) // tests are required to run before generating the report
}
Expand All @@ -356,7 +356,7 @@ tasks {
group = taskGroup
classpath = sourceSets.main.get().runtimeClasspath

mainClass.set(className)
mainClass = className

val props = System.getProperties().filter { (k, _) -> k.toString().startsWith(propertyPrefix) }

Expand Down Expand Up @@ -398,7 +398,7 @@ tasks {
if (name != "InstancingBenchmark")
register<JavaExec>(name = className.substringAfterLast(".")) {
classpath = sourceSets.test.get().runtimeClasspath
mainClass.set(className)
mainClass = className
group = "demos.$exampleType"

val props = System.getProperties().filter { (k, _) -> k.toString().startsWith("scenery.") }
Expand All @@ -425,7 +425,7 @@ tasks {
// main = target.substringAfter("java${File.separatorChar}").replace(File.separatorChar, '.').substringBefore(".java")
// }

mainClass.set("$target")
mainClass = "$target"
val props = System.getProperties().filter { (k, _) -> k.toString().startsWith("scenery.") }

val additionalArgs = System.getenv("SCENERY_JVM_ARGS")
Expand All @@ -445,9 +445,9 @@ tasks {
enabled = isRelease
dokkaSourceSets.configureEach {
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(URL("https://github.com/scenerygraphics/sciview/tree/main/src/main/kotlin"))
remoteLineSuffix.set("#L")
localDirectory = file("src/main/kotlin")
remoteUrl = uri("https://github.com/scenerygraphics/sciview/tree/main/src/main/kotlin").toURL()
remoteLineSuffix = "#L"
}
}
}
Expand All @@ -472,8 +472,8 @@ jacoco {
toolVersion = "0.8.11"
}

task("copyDependencies", Copy::class) {
from(configurations.runtimeClasspath).into("$buildDir/dependencies")
task<Copy>("copyDependencies") {
from(configurations.runtimeClasspath).into(layout.buildDirectory.dir("dependencies"))
}

java.withSourcesJar()
78 changes: 39 additions & 39 deletions buildSrc/src/main/kotlin/sciview/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ publishing {
val customVersion = project.properties["customVersion"]
val v = if(customVersion != null) {
if(customVersion == "git") {
val gitCommand = Runtime.getRuntime().exec("git rev-parse --verify --short HEAD")
val gitCommand = Runtime.getRuntime().exec("git rev-parse --verify --short HEAD".split(" ").toTypedArray())
val result = gitCommand.waitFor()

if(result == 0) {
Expand All @@ -45,13 +45,13 @@ publishing {
val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
archiveClassifier = "javadoc"
}

val dokkaHtmlJar by tasks.register<Jar>("dokkaHtmlJar") {
dependsOn(tasks.dokkaHtml)
from(tasks.dokkaHtml.flatMap { it.outputDirectory })
archiveClassifier.set("html-doc")
archiveClassifier = "html-doc"
}


Expand All @@ -61,70 +61,70 @@ publishing {
// TODO, resolved dependencies versions? https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:resolved_dependencies

pom {
name.set(rootProject.name)
description.set(rootProject.description)
url.set(sciviewUrl)
properties.set(mapOf("inceptionYear" to "2016"))
name = rootProject.name
description = rootProject.description
url = sciviewUrl
properties = mapOf("inceptionYear" to "2016")
organization {
name.set(rootProject.name)
url.set("http://scenery.graphics")
name = rootProject.name
url = "http://scenery.graphics"
}
licenses {
license {
name.set("Simplified BSD License")
// url.set("https://www.gnu.org/licenses/lgpl.html") TODO?
distribution.set("repo")
name = "Simplified BSD License"
// url = "https://www.gnu.org/licenses/lgpl.html" TODO?
distribution = "repo"
}
}
developers {
developer {
id.set("kephale")
name.set("Kyle Harrington")
url.set("https://kyleharrington.com")
id = "kephale"
name = "Kyle Harrington"
url = "https://kyleharrington.com"
roles.addAll("founder", "lead", "developer", "debugger", "reviewer", "support", "maintainer")
}
developer {
id.set("skalarproduktraum")
name.set("Ulrik Günther")
url.set("https://imagej.net/User:Skalarproduktraum")
id = "skalarproduktraum"
name = "Ulrik Günther"
url = "https://imagej.net/User:Skalarproduktraum"
roles.addAll("founder", "lead", "developer", "debugger", "reviewer", "support", "maintainer")
}
}
contributors {
contributor {
name.set("Robert Haase")
url.set("https://imagej.net/User:Haesleinhuepf")
properties.set(mapOf("id" to "haesleinhuepf"))
name = "Robert Haase"
url = "https://imagej.net/User:Haesleinhuepf"
properties = mapOf("id" to "haesleinhuepf")
}
contributor {
name.set("Curtis Rueden")
url.set("https://imagej.net/User:Rueden")
properties.set(mapOf("id" to "ctrueden"))
name = "Curtis Rueden"
url = "https://imagej.net/User:Rueden"
properties = mapOf("id" to "ctrueden")
}
contributor {
name.set("Aryaman Gupta")
properties.set(mapOf("id" to "aryaman-gupta"))
name = "Aryaman Gupta"
properties = mapOf("id" to "aryaman-gupta")
}
}
mailingLists {
mailingList {
name.set("Image.sc Forum")
archive.set("https://forum.image.sc/tags/sciview")
name = "Image.sc Forum"
archive = "https://forum.image.sc/tags/sciview"
}
}
scm {
connection.set("scm:git:git://github.com/scenerygraphics/sciview")
developerConnection.set("scm:git:git@github.com:scenerygraphics/sciview")
tag.set("sciview-0.2.0-beta-9") // TODO differs from version
url.set(sciviewUrl)
connection = "scm:git:git://github.com/scenerygraphics/sciview"
developerConnection = "scm:git:git@github.com:scenerygraphics/sciview"
tag = "sciview-0.2.0-beta-9" // TODO differs from version
url = sciviewUrl
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/scenerygraphics/sciview/issues")
system = "GitHub Issues"
url = "https://github.com/scenerygraphics/sciview/issues"
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/scenerygraphics/sciview/actions")
system = "GitHub Actions"
url = "https://github.com/scenerygraphics/sciview/actions"
}
distributionManagement {
// https://stackoverflow.com/a/21760035/1047713
Expand Down Expand Up @@ -169,18 +169,18 @@ publishing {
//val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
// dependsOn(tasks.dokkaJavadoc)
// from(tasks.dokkaJavadoc.get().outputDirectory.get())
// archiveClassifier.set("javadoc")
// archiveClassifier = "javadoc"
//}
//
//val dokkaHtmlJar by tasks.register<Jar>("dokkaHtmlJar") {
// dependsOn(tasks.dokkaHtml)
// from(tasks.dokkaHtml.get().outputDirectory.get())
// archiveClassifier.set("html-doc")
// archiveClassifier = "html-doc"
//}
//
//val sourceJar = task("sourceJar", Jar::class) {
// dependsOn(tasks.classes)
// archiveClassifier.set("sources")
// archiveClassifier = "sources"
// from(sourceSets.main.get().allSource)
//}
//
Expand Down

0 comments on commit 2278f8b

Please sign in to comment.