sproutcore / build-tools

SproutCore Build Tools
12 stars 7 forks source link

Redesign of the config file parsing #42

Open mauritslamers opened 9 years ago

mauritslamers commented 9 years ago

In order to add generators to the new BT, I researched the way Abbot does the generators. While the way Abbot decides what the project root should be seems to me a bit like pulling a white rabbit out of a hat, I found that the way Abbot parses the Buildfiles is rather elegant.

The Buildfiles consists of code, and are executed as code, but unlike the BT, Abbot executes the contents of these files in a sandbox. In this sandbox, a set of functions forming a domain specific language are exposed in order to set the config.

The upside of implementing a similar strategy for the BT is that a change in the config files doesn't require restarting the BT. The downside might be that overriding certain behavior of the BT becomes a bit more difficult. I would like to hear your thoughts!