Dynamically adding subproject without filesystem directories tree


I would like to use gradle to extract some coefficients from sound files. I have thousands of these sounds and I have a json configuration script which provide the configuration for each kind of coefficients I want to extract.

Therefore, I want to parallelize that as much as I can. As, if I understand correctly, task could not be executed in parallel except by using subproject, I planned to define one subproject per sound file.

My questions are :

  1. is it possible to generate and include dynamically the subprojects based on the json configuration file given in arguments ? In other words, can I use the argument in the settings.gradle or can I add dynamically a subproject using the build.gradle?

2, If yes, how can I do it ?

Thanks a lot, Sébastien

You’d have to do the dynamic project generation in ‘settings.gradle’.

From what I’ve heard, running tasks belonging to the same project in parallel may not be that far off, but I don’t know any details.

Thanks for the reply :slight_smile:

Another related question therefore : is it possible to define a variable used in settings.gradle using the command line ?

You could set a Java system property (’-Dfoo=bar’), and access it using ‘System.getProperty(“foo”)’.

ok perfect thanks a lot :slight_smile: