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 respective Ant file located in the
ant directory. Furthermore we must create a
cerny.conf.js and tell Ant where it can be found:
<project name="ourapp" default="build" basedir="."> ... <!-- Prepare using the Cerny.js ant tasks --> <property 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>
js.jar on the classpath. For
more information read about library
dependencies on the Ant webpage.
<jsdoc src-dir="js" dest-dir="build/docs" />
Process all include statements in the source file to create one large 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" />
@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 expression="OURAPP.pages.Search" dest-file="build/docroot/js/pages.Search.js" catalog-file="js/catalog.json" base-dir="."/>