From 1d48efbe9ac21f51b6aab8aa102923a0dd74a774 Mon Sep 17 00:00:00 2001 From: Paul King Date: Wed, 29 May 2024 17:48:37 +1000 Subject: [PATCH] add runAll task --- subprojects/WhiskeyBeam/build.gradle | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/subprojects/WhiskeyBeam/build.gradle b/subprojects/WhiskeyBeam/build.gradle index 137e70f..a856542 100644 --- a/subprojects/WhiskeyBeam/build.gradle +++ b/subprojects/WhiskeyBeam/build.gradle @@ -22,26 +22,34 @@ dependencies { implementation "org.apache.beam:beam-runners-direct-java:$beamVersion" implementation "org.slf4j:slf4j-api:$slf4jVersion" implementation "org.apache.groovy:groovy:$groovy4Version" -// implementation("com.github.haifengl:smile-core:$smileVersion") { -// transitive = false -// } -// implementation("com.github.haifengl:smile-base:$smileVersion") { -// transitive = false -// } implementation "org.apache.commons:commons-csv:$commonsCsvVersion" implementation "org.apache.commons:commons-math4-legacy:$commonsMath4Version" runtimeOnly "org.slf4j:slf4j-jdk14:$slf4jVersion" -// runtimeOnly "org.bytedeco:openblas-platform:$openblasPlatformVersion" +} + +tasks.register('versionInfo') { + doLast { + File javaHome = new File(System.getProperty('java.home')) + logger.lifecycle "Using Java from $javaHome (version ${System.getProperty('java.version')})" + } +} + +def runAll = tasks.register('runAll') { + group 'Application' + dependsOn versionInfo } FileUtil.baseNames(sourceSets.main.allSource.files).each { name -> if (name.startsWith('Whiskey')) { - tasks.register("run$name", JavaExec) { + def subtask = tasks.register("run$name", JavaExec) { dependsOn compileGroovy group 'Application' description "Run ${name}.groovy as a JVM application/Groovy script" classpath = sourceSets.main.runtimeClasspath mainClass = name } + runAll.configure { + dependsOn subtask + } } }