-
Hi, I'm trying to define a task to run tests for all projects that are defined in a specific folder. I do not want to list all of them explicitly in the aggregate test task (list is rather long > 100 projects) but rather have them dynamically listed and places in the task definition. My current approach: lazy val pipelineApps = file("pipeline-app").listFiles
.filter(_.isDirectory)
.filter { projectDirectory =>
val versionSbtFile = new File(projectDirectory, "version.sbt")
versionSbtFile.exists() && versionSbtFile.isFile
}
.map(_.getName)
.toSeq
runPipelineAppTests :=
Def.sequential(
pipelineApps.map(projectName => (test in LocalProject(projectName)))
).value Unfortunately I get: Reference to undefined setting:
[error]
[error] ppi / test from runPipelineAppTests (/home/user/build.sbt:1745)
[error] Did you mean ppi / assemblyPackageScala / test ? When running I'm I missing something, is that even possible? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is a fallback mechanism in the shell. When you type
The |
Beta Was this translation helpful? Give feedback.
There is a fallback mechanism in the shell. When you type
ppi/test
, sbt does not find the task, so it triesppi/Compile/test
and thenppi/Test/test
.The
test
task is defined in theTest
config. You need to useLocalProject(projectName) / Test / test
.