Skip to content
Merged
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
35 changes: 19 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import org.gradle.kotlin.dsl.implementation
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
import sciview.*
import sciview.lwjglNatives

plugins {
java
Expand Down Expand Up @@ -162,7 +160,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 @@ -184,8 +182,8 @@ 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 matcher = Regex("""generatePomFileFor(\w+)Publication""").matchEntire(name)
// val publicationName = matcher?.let { it.groupValues[1] }

pom.properties.empty()

Expand Down Expand Up @@ -344,8 +342,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 +354,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 +396,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 +423,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 +443,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 +470,13 @@ 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()

//extensions.findByName("buildScan")?.withGroovyBuilder {
// setProperty("termsOfServiceUrl", "https://gradle.com/terms-of-service")
// setProperty("termsOfServiceAgree", "yes")
//}
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ repositories {
dependencies {
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20")
implementation("de.undercouch:gradle-download-task:5.6.0")

}
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
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/sciview/sign.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ signing {
}

tasks.withType<Sign>().configureEach {
onlyIf { project.hasProperty("release") }
val isRelease = hasProperty("release")
onlyIf { isRelease }
}

2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
org.gradle.jvmargs=-XX:MaxMetaspaceSize=2g
org.gradle.caching=true
org.gradle.configuration-cache=true
#org.gradle.caching.debug=true
jvmTarget=21
#useLocalScenery=true
kotlinVersion=1.9.23
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ if (System.getProperty("CI").toBoolean() != true
if(File("../scenery/build.gradle.kts").exists()) {
logger.warn("Including local scenery project instead of version declared in build, set -PuseLocalScenery=false to use declared version instead.")
includeBuild("../scenery")
}
}
Loading