Ant tasks
Cerny.js comes with some script definitions for Ant tasks. Most of them support
the development of web applications. In order to use one of these
tasks we must include the the respective Ant file located in the
ant directory. Furthermore we must create a
cerny.conf.js and tell Ant where it can find it:
<project name="ourapp" default="build" basedir=".">
...
<!-- Prepare using the Cerny.js ant tasks -->
<properties name="cerny.js.configuration" location="conf/ant/cerny.conf.js" />
<import file="vendor/tools/cerny.js/ant/merge.xml" />
<target name="build">
<!-- Use the merge-css task -->
<merge-css src-file="css/style.css" dest-file="build/docroot/css/style.css" />
...
</target>
...
</project>
Prerequisites
The Ant installation must be set up to use JavaScript. It needs
bsf.jar and js.jar on the classpath. For
more information read about library
dependencies on the Ant webpage.
Reference
jsdoc
Create a JSON document containing the API documentation of a JavaScript library. The document adheres to this schema. The documentation style of the library must adhere to the one used in Cerny.js. The JSON document is not meant for human consumption, but as a base for further processing.
<jsdoc
src-dir="js"
dest-dir="build/docs" />
merge-catalog
Process all include statements in the source file to create one big catalog. This allows us to maintain several catalogs during development time and create one catalog for production.
<merge-catalog
src-file="js/catalog.json"
dest-file="build/docroot/js/catalog.json" />
merge-css
Replace all @import statements in the source file by
the content of the file that is imported. It omits to replace
style sheets that contain relative URLs. This task makes it possible to
maintain CSS in separate files and deploy them in one file, which
reduces the number of HTTP requests.
<merge-css
src-file="css/style.css"
dest-file="build/docroot/css/style.css" />
merge-js
Create one JavaScript file, which contains all functionality necessary for a page. It depends on the usage of the dependency management facilities that are provided by Cerny.js. All required scripts are concatenated in the right order based on the dependency information declared within the scripts and in the catalog.
<merge-js
expression="OURAPP.pages.Search"
dest-file="build/docroot/js/pages.Search.js"
catalog-file="js/catalog.json"
base-dir="."/>

