Subproject filtering

I have a project with the following layout.

MyProject
|
|- java
|- db
    |--schemaA
          build.gradle
    |--schemaB
          build.gradle
|-build.gradle
|-settings.gradle

I would like to apply my database tasks to the ‘db’ subprojects only and so did the following:

configure(subprojects.findAll{it.name.contains(':db:')}){
    apply from: "$rootDir/gradle/dbdeploy.gradle"
}

but this didn’t show the tasks with ‘gradle tasks’ within the schemaA directory.

my settings.gradle is configured as follows:

include 'java'
include 'db:schemaA'
  rootProject.name = 'MyProject'

You’ll need to use ‘it.path.contains’ rather than ‘it.name.contains’.