Skip to content

Commit

Permalink
build: remove call to dropped Gradle api
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK committed Jun 22, 2023
1 parent 0c4990a commit 48a4815
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ val alchemistGroup = "Run Alchemist"
val classpathJar by tasks.register<Jar>("classpathJar") {
group = alchemistGroup
description = "Creates a jar file with a manifest pointing to all the jar resources needed for the runtime"
appendix = "classpath"
archiveClassifier.set("classpath")
doFirst {
manifest {
val classpath = sourceSets["main"].runtimeClasspath.files
.filter { it.isFile && it.extension == "jar" }
.joinToString (separator = " ", prefix = " ") { it.absolutePath }
.joinToString(separator = " ", prefix = " ") { it.absolutePath }
attributes("Class-Path" to classpath)
}
}
Expand All @@ -37,9 +37,9 @@ val runAll by tasks.register<DefaultTask>("runAll") {
* Scan the folder with the simulation files, and create a task for each one of them.
*/
File(rootProject.rootDir.path + "/src/main/yaml").listFiles()
.filter { it.name.matches(Regex("""\d{2}-.*\.yml""")) }
.sortedBy { it.nameWithoutExtension }
.forEach {
?.filter { it.name.matches(Regex("""\d{2}-.*\.yml""")) }
?.sortedBy { it.nameWithoutExtension }
?.forEach {
val task by tasks.register<JavaExec>(it.nameWithoutExtension) {
group = alchemistGroup
description = "Launches simulation ${it.nameWithoutExtension}"
Expand All @@ -57,3 +57,4 @@ File(rootProject.rootDir.path + "/src/main/yaml").listFiles()
// task.dependsOn(classpathJar) // Uncomment to switch to jar-based cp resolution
runAll.dependsOn(task)
}
?: error("Cannot list simulation files")

0 comments on commit 48a4815

Please sign in to comment.