juxt / mach

A remake of make (in ClojureScript)
246 stars 21 forks source link

Document #import literal #14

Closed jonpither closed 7 years ago

jonpither commented 7 years ago

Once it stabilises use the below as a basis.

Mach extension files

Currently you can add a target like this:

tar #import [foo/bar {}] 

And Mach will search this current directory - and also parent directories - for an extension file called foo.mach.edn. Once the extensions file is found Mach will load the extension targets. In the above example if foo.mach.edn contained:

bar #$ ["echo" "hello"] 

Then the target 'bar' in the extension file will be aliased to 'tar' in the main Mach file. So running mach tar from the command line would echo hello.

Furthermore, any symbols in the target extension can be rewritten based on the supplied map of args. For example if the bar target was coded as such:

bar #$ ["echo" fido]

And bar was imported as such:

tar #import [foo/bar {fido "greetings"}] 

then running mach tar from the command line would echo greetings.

jonpither commented 7 years ago

Fixed.