How do I configure specific projects?

I have a multi project build script. Some are java applications and some are android applications.

I want to configure all the java projects a certain way (apply plugins etc) and the android projects in a simular fashion. I have a one build script model (perhaps this isn’t the best approach) as I wanted to avoid duplication.

Project structure:

/root
   java1/
   java2/
   java3/
    android1/
   android2/
   settings.gradle
   build.gradle

Is it possible to supply the configure() method with names of projects? I tried and it complained that it couldn’t find the method I specified.

// this failed

configure(java1, java2, java3) {}

I guess would it be better to reorganize the projects by type

ie.

/root
    /java
         ....
         build.gradle
    /android
         ....
         build.gradle
    build.gradle
    settings.gradle

Thanks

See http://www.gradle.org/docs/current/userguide/multi_project_builds.html. “50.2.3.1. Filtering by name”

Ah thank you. I presume there is probably a more scalable way (assuming I had like 15/15 of the types). But for right now that will work.

Thank you!