weberc2 / builder

Prototype build tool
0 stars 0 forks source link

Make it easy to create custom target types #28

Open weberc2 opened 4 years ago

weberc2 commented 4 years ago

The universe of things that this tool could be used for is vast and it's very likely that any team of any significance will want to implement their own build rules; this should be easy and to the extent possible it should be easy to adhere to the constraints that the first-class plugins adhere to (to preserve hermeticity).

weberc2 commented 4 years ago

One incarnation of this is a "scriptable" plugin that has a "scriptable" target type, a "script" argument (among others), and a build script/function that executes the script. Further, the target type should take dependencies, and the script should be allowed to reference those dependencies (perhaps the target's dependencies argument is actually a dict whose keys are symbol names and whose values are dependencies such that the script can reference those dependencies by the provided symbol names). The design should make it difficult to access unspecified dependencies (hermeticity). This includes thoughtfulness about the capabilities offered by the standard library.

weberc2 commented 4 years ago

A concrete use case for this is the candidate non-toy Python example, https://github.com/weberc2/nimbus which includes a code generation step. That project should be able to define a custom script that invokes its codegen package to produce a Python package.