Project instr_project = project subprojects { afterEvaluate { Project subProj -> if (subProj.getPlugins().hasPlugin('java')) { // Make it so all instrumentation subproject tests can be run with a single command. instr_project.tasks.test.dependsOn(subProj.tasks.test) instr_project.dependencies { implementation(project(subProj.getPath())) } } } }