Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Gradle to 8.0.2 plus minors #530

Merged
merged 1 commit into from May 25, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 11 additions & 17 deletions build.gradle.kts
Expand Up @@ -2,10 +2,8 @@ import org.gradle.kotlin.dsl.api
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import scenery.*
import java.net.URL
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
java
// kotlin and dokka versions are now managed in settings.gradle.kts and gradle.properties
kotlin("jvm")
kotlin("kapt")
Expand All @@ -15,23 +13,22 @@ plugins {
// scenery.docs
scenery.publish
scenery.sign
id("com.github.elect86.sciJava") version "0.0.4"
// id("com.github.elect86.sciJava") version "0.0.4"
jacoco
id("com.github.johnrengelman.shadow") version "7.1.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

repositories {
mavenCentral()
maven("https://maven.scijava.org/content/groups/public")
maven("https://jitpack.io")
mavenLocal()
// mavenLocal()
}

dependencies {
implementation(platform("org.scijava:pom-scijava:31.1.0"))
annotationProcessor("org.scijava:scijava-common:2.88.1")

implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")

Expand Down Expand Up @@ -184,8 +181,8 @@ tasks {
return d
}

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 All @@ -206,7 +203,7 @@ tasks {
scijavaRepo.appendNode("id", "scijava.public")
scijavaRepo.appendNode("url", "https://maven.scijava.org/content/groups/public")


// Update the dependencies and properties
val dependenciesNode = asNode().appendNode("dependencies")
val propertiesNode = asNode().appendNode("properties")
Expand Down Expand Up @@ -378,8 +375,8 @@ tasks {
}
}
}
named<ShadowJar>("shadowJar") {

shadowJar {
isZip64 = true
}
}
Expand All @@ -403,14 +400,12 @@ artifacts {
}
}

jacoco {
toolVersion = "0.8.8"
}
jacoco.toolVersion = "0.8.8"

java.withSourcesJar()

plugins.withType<JacocoPlugin>() {
tasks["test"].finalizedBy("jacocoTestReport")
plugins.withType<JacocoPlugin> {
tasks.test { finalizedBy("jacocoTestReport") }
}

// disable Gradle metadata file creation on Jitpack, as jitpack modifies
Expand All @@ -420,4 +415,3 @@ if(System.getenv("JITPACK") != null) {
enabled = false
}
}

12 changes: 5 additions & 7 deletions buildSrc/src/main/kotlin/scenery/base.gradle.kts
Expand Up @@ -77,25 +77,25 @@ tasks {
finalizedBy(jacocoTestReport) // report is always generated after tests run
}

register("testGpu", Test::class) { // lets take this for comfortability in local development
register<Test>("testGpu") { // lets take this for comfortability in local development
maxHeapSize = "8G"
group = "verification"
filter { includeTestsMatching("ExampleRunner") }

val testGroup = System.getProperty("scenery.ExampleRunner.TestGroup", "basic")
extensions.configure(JacocoTaskExtension::class) {
extensions.configure<JacocoTaskExtension> {
setDestinationFile(layout.buildDirectory.file("jacoco/jacocoTest.$testGroup.exec").get().asFile)
}
}

register("compileShader", JavaExec::class) {
register<JavaExec>("compileShader") {
group = "tools"
mainClass.set("graphics.scenery.backends.ShaderCompiler")
classpath = sourceSets["main"].runtimeClasspath

}

register("fullCodeCoverageReport", JacocoReport::class) {
register<JacocoReport>("fullCodeCoverageReport") {
executionData(fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec"))

sourceSets(sourceSets["main"], sourceSets["test"])
Expand Down Expand Up @@ -131,9 +131,7 @@ tasks {
jacocoTestReport {
reports {
xml.required.set(true)
html.apply {
required.set(false)
}
html.required.set(false)
}
dependsOn(test) // tests are required to run before generating the report
}
Expand Down
18 changes: 8 additions & 10 deletions buildSrc/src/main/kotlin/scenery/publish.gradle.kts
Expand Up @@ -99,18 +99,16 @@ publishing {
}
}

repositories {
maven {
name = "sonatype"
credentials(PasswordCredentials::class)
repositories.maven {
name = "sonatype"
credentials(PasswordCredentials::class)

val releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
val releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"

val snapshot = rootProject.version.toString().endsWith("SNAPSHOT")
url = uri(if (snapshot) snapshotRepo else releaseRepo)
// url = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
val snapshot = rootProject.version.toString().endsWith("SNAPSHOT")
url = uri(if (snapshot) snapshotRepo else releaseRepo)
// url = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7