Skip to content

Commit c4ae24b

Browse files
committed
build: fix warnings
1 parent b2c2ae7 commit c4ae24b

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

build.gradle.kts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.gradle.configurationcache.extensions.capitalized
2-
31
plugins {
42
alias(libs.plugins.kotlin.jvm)
53
alias(libs.plugins.multiJvmTesting)
@@ -47,24 +45,25 @@ File(rootProject.rootDir.path + "/src/main/yaml").listFiles()
4745
.apply { check(isNotEmpty()) }
4846
.filter { it.extension == "yml" }
4947
.sortedBy { it.nameWithoutExtension }
50-
.forEach {
51-
val task by tasks.register<JavaExec>("run${it.nameWithoutExtension.capitalized()}") {
48+
.forEach { simulationFile ->
49+
val simulationName = simulationFile.nameWithoutExtension
50+
val task by tasks.register<JavaExec>("run${simulationName.replaceFirstChar { it.uppercase() } }") {
5251
javaLauncher.set(
5352
javaToolchains.launcherFor {
5453
languageVersion.set(JavaLanguageVersion.of(multiJvm.latestJava))
5554
}
5655
)
5756
group = alchemistGroup
58-
description = "Launches simulation ${it.nameWithoutExtension}"
57+
description = "Launches simulation $simulationName"
5958
mainClass.set("it.unibo.alchemist.Alchemist")
6059
classpath = sourceSets["main"].runtimeClasspath
61-
val exportsDir = File("${projectDir.path}/build/exports/${it.nameWithoutExtension}")
60+
val exportsDir = File("${projectDir.path}/build/exports/${simulationName}")
6261
doFirst {
6362
if (!exportsDir.exists()) {
6463
exportsDir.mkdirs()
6564
}
6665
}
67-
args("run", it.absolutePath)
66+
args("run", simulationFile)
6867
if (System.getenv("CI") == "true" || batch == "true") {
6968
args(
7069
"--override",
@@ -77,7 +76,7 @@ File(rootProject.rootDir.path + "/src/main/yaml").listFiles()
7776
} else {
7877
args(
7978
"--override",
80-
"{ monitors: { type: SwingGUI, parameters: { graphics: \"effects/${it.nameWithoutExtension}.json\" } } }"
79+
"{ monitors: { type: SwingGUI, parameters: { graphics: \"effects/${simulationName}.json\" } } }"
8180
)
8281
}
8382
outputs.dir(exportsDir)

settings.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
rootProject.name = "protelis-alchemist-tutorial"
22

33
plugins {
4-
id("com.gradle.enterprise") version "3.19.2"
4+
id("com.gradle.develocity") version "4.1"
55
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
66
id("org.danilopianini.gradle-pre-commit-git-hooks") version "2.0.29"
77
}
88

9-
gradleEnterprise {
9+
develocity {
1010
buildScan {
11-
termsOfServiceUrl = "https://gradle.com/terms-of-service"
12-
termsOfServiceAgree = "yes"
13-
publishOnFailure()
11+
termsOfUseUrl = "https://gradle.com/terms-of-service"
12+
termsOfUseAgree = "yes"
13+
uploadInBackground = !System.getenv("CI").toBoolean()
14+
publishing.onlyIf { it.buildResult.failures.isNotEmpty() }
1415
}
1516
}
1617

0 commit comments

Comments
 (0)