A scriptable, extendable and configurable source code builder framework and tool in JavaScript / Python / PHP
version 1.0.3
This is a new framework and tool for building projects from sources, which is based on (and extends) the previous buildtools used here
- Modify the
beeld-sample.configorbeeld-sample.jsonorbeeld-sample.yamlorfile(s) to include the configuration settings and parametersbeeld-sample.ini - Configuration file can be in
customconfig format (default),JSONformat (.json) orYAMLformat (.yaml,.yml)orINIformat (.ini) - Run the
.bator.shscripts to build the package
Each tool/compiler, if run with no parameters in the command-line, will print a help screen explaining usage options. Also the sample-config files and build.bat, build.sh files, demonstrate how the build tools are used
The framework can be extended by plugins. The plugin code can be in the Beeld/plugins folder or even in current working directory. Each plugin can define a new action to be used on the source data through a pipeline.
The plugin and the new action are both defined in each config file (see sample config files).
Furthermore the framework has a built-in "replace" action to replace text in sources and a "process-shell" action which allows to manipulate the source data through direct shell scripting (for example for some fast shell text manipulation)
NEW in version 0.8+
The framework allows custom powerfull dynamic expressions (and regular expressions) to be part of config data and parameters, via the Xpresion framework. The beeld.config file can include a settings part which defines the prefixes for Xpresion dynamic expressions and Regular Expressions (if any) used in the config file. The parsing and evaluation will be automatic (see sample config files for examples). A common example of the use of custom expressions is the use of current date to be displayed in the final built file (one can use a custom expression for that which uses the date function as part of replace data to be replaced in the file where needed). Another one, is to replace data in the files not simply by another string but by the contents of a whole file (one would use an expression with the file function to load the contents of a file dynamicaly)
Some UMD templates from the UMD github repo have been included as templates in the buildtools. A generic UMD module pattern wrapper that supports module dependencies and bundled module dependencies in same file and works transparently inside Node/CommonJS, requireJS/AMD, WebWorker/Browser, is in this gist and in this gist for single module wrapper (no dependencies)
UglifyJS(default),Java Closure Compiler(included),Java YUI Compressor(included),CSS Minifier(included) can be used
For Python
Python(2 or 3)PyYamlmodule installed (for Yaml parsing)
For PHP
PHP5.2+- Modified standalone version of
Symfony Yamlparser by (c) Fabien Potencier fabien@symfony.com (included)
For Node.js
Node.js0.8+- Modified standalone version of
yaml.js(Symfony Yaml parser) by (c) Fabien Potencier, Jeremy Faivre (included)
Common Dependencies
UglifyJSpackage (required, global install)Closurecompiler (included)YUI Compressorcompiler (included)Java 6(required byYUI,Closurecompilers)CSS Minifier(python) (included)CSS Minifier(php) (included)CSS Minifier(node) (included)Xpresion(python) (included)Xpresion(php) (included)Xpresion(node) (included)
NOTE: Only one of the three javascript minify compilers needs be used, but Beeld interfaces are provided for all three.
