# Dynamically adding subproject without filesystem directories tree

**URL:** https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375
**Category:** Old Forum Archive
**Created:** [December 8, 2014, 10:10am UTC](https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375 "2014-12-08T10:10:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sebastien\_Le\_Maguer](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sebastien\_Le\_Maguer](https://discuss.gradle.org/u/Sebastien_Le_Maguer)
#### Post date: [December 8, 2014, 10:10am UTC](https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375/1 "2014-12-08T10:10:00Z")

</div>

Hello,

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

---

<div class="post-metadata">

### Author: ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)
#### Post date: [December 8, 2014, 3:27pm UTC](https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375/2 "2014-12-08T15:27:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Sebastien\_Le\_Maguer](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sebastien\_Le\_Maguer](https://discuss.gradle.org/u/Sebastien_Le_Maguer)
#### Post date: [December 10, 2014, 2:15pm UTC](https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375/3 "2014-12-10T14:15:00Z")

</div>

Thanks for the reply 🙂

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

---

<div class="post-metadata">

### Author: ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)
#### Post date: [December 10, 2014, 3:50pm UTC](https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375/4 "2014-12-10T15:50:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Sebastien\_Le\_Maguer](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sebastien\_Le\_Maguer](https://discuss.gradle.org/u/Sebastien_Le_Maguer)
#### Post date: [December 10, 2014, 3:56pm UTC](https://discuss.gradle.org/t/dynamically-adding-subproject-without-filesystem-directories-tree/6375/5 "2014-12-10T15:56:00Z")

</div>

ok perfect thanks a lot 🙂
