The downloadable distribution of Prudence contains a ready-to-use
that is bundled with all the basic types, APIs, cache backends, renderers, and JST tags.
However, if you want to extend Prudence then you’ll need to make
a custom build of
prudence with your plugins.
xprudence, which is also included in the distribution, is for.
It’s a rather simple program! It requires you to have
Go installed, but otherwise has no dependencies.
All it does is create custom builds of
But Go is different, in a good way. Instead of a mess of dependencies scattered all over your operating system, everything a Go program normally needs is in one executable. That’s just one single file that you need to distribute.
In recognizing this advantage,
xprudence is inspired by
Note that Go does have support for plugins, which are dynamically-linked libraries provided as separate files. Unfortunately it’s limited to just a few platforms and breaks the straigtforward advantage of having just one executable.
Here’s how you would build Prudence with the plugin example:
xprudence build -v --directory=examples/plugin
The first time you build it may take some time, but note that most of this time is spent downloading (and caching) the Go source code of the dependencies. The Go compiler/linker itself is very fast and subsequent builds will use the cached downloads.
A common flag to use with
xprudence build is
--directory, which you can specify several
times to include all the plugin directories that you want to add to your build. These
directories are Go modules and thus must have a
The extension guide goes into more detail about their structure.
Or, you can use the
--module flag to specify plugins as Go module names, which is useful
if you keep your module code in a git repository. As is usual with Go modules, you can
append a specific version or tag after a
Another useful flag is
--replace, which lets you insert a
To get help on the additional build flags:
xprudence build -h