Hi,

We're using Gradle for a project that isn't "compiling code" at all, but
rather generating grammars and other "data"-artifacts.

Currently, we are doing fine, the application was for a single language and
had only one type of 'thing' to produce.

Now we're moving to a different project where we'll have many languages to
support and much more type of 'thing' to produce.

The directory/project structure would look like this:

build/<lang>/grammars
build/<lang>/models
build/<lang>/index
build/<lang>/engines

Each of "grammars", "models", "index", "engines" would also actually be
multi-projects themselves.

To make that even interesting, the current build system uses custom tasks
(bundled in a jar).  The build.gradle file under 'grammars' was defining
properties like OutputDir that would tell all other tasks where to actually
output their 'stuff'.

I would like to tell my team that then ca go to /build/<lang>/grammars and
run "gradle generate" but right now, it isn't possible to do that while
reusing the exact old grammars/build.gradle file I had because:

   1. project/task names changed: I have a dependsOn ['abc:test'] that
   would have to be renamed ['en-us:grammars:abc:test']  to work, which is
   pretty bad.  You see, all languages would have the exact same build.gradle
   file so I would appreciate if I can avoid hardcoding the language code in
   the project/task names.
   2. it becomes a bit complicated to define which projects are included in
   which projects: it seems that putting a settings.gradle file in a directory
   makes that project a "root project" and gradle won't crawl up the tree to
   find the 'real' root.  I've found solutions on this mailing list that have
   a custom crawling logic inside build/settings.gradle that automatically
   include relevant projects, so that's a good start, are there better
   solutions?

How do people do such things?  What are other avenues that I could explore?

Thanks for your help!

Jp

Reply via email to