Skip to content

Design Considerations

Sean Corfield edited this page Jan 15, 2016 · 1 revision

There are two goals for the boot-new project:

  1. Be able to find and run existing Leiningen templates.
  2. Be able to find and run new Boot templates that follow a similar pattern.

A typical Leiningen template has the following characteristics:

  • Artifact name template/lein-template.
  • A function called leiningen.new.template/template, e.g,. leiningen.new.frege/frege.
  • That function typically relies on leiningen.new.templates (for render, name-to-path, ->files and maybe other functions), and maybe other Leiningen core functionality such as leiningen.core.main/info to output console messages etc.
  • A folder called leiningen/new/template in which the pieces of the template are found.

A new Boot template would use boot where the Leiningen template uses lein or leiningen as appropriate, e.g., boot.new.frege/frege and template files in boot/new/frege.

In order to run Leiningen templates, Boot New will need at least a (modified) copy of the leiningen.new.templates namespace, and possibly some other stubs as required to support common idioms inside Leiningen templates. The Leiningen team have been consulted and they're happy for this code to be reused in a Boot task. Boot new can depend on leiningen-core as an external dependency to provide leiningen.core.main/info etc.

Note that Leiningen comes with four built-in templates: app, default, plugin, and template. Those should probably be replicated as built-in Boot templates as well (although task instead of plugin would make more sense).

Clone this wiki locally