Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

503 lines (457 sloc) 22.352 kb
<?xml version="1.0" encoding="UTF-8"?>
<project name="Claypool" default="default" basedir=".">
<description>Builds, tests, and runs the project Claypool.</description>
<tstamp/>
<!-- BASIC PROJECT PROPERTIES TO HELP TRACK VERSION -->
<property file="build.properties"/>
<property name="JAVA_LIB_DIR"
location="WEB-INF/lib"
description="Java Jars" />
<property name="RHINO_JAR"
location="${JAVA_LIB_DIR}/js.jar"
description="Rhino JS Engine" />
<property name="JSLINT_JAR"
location="${JAVA_LIB_DIR}/jslint4java-1.1.jar"
description="JSLint Syntax Checker" />
<property name="SERVLET_JAR"
location="../../lib/servlet-api.jar"
description="Javax Servlet API" />
<property name="LOG4J_JAR"
location="${JAVA_LIB_DIR}/log4j-1.2.15.jar"
description="Log4j Logging API" />
<property name="YUI_MIN_JAR"
location="${JAVA_LIB_DIR}/yuicompressor-2.4.1.jar"
description="YUI Compressor" />
<property name="PREFIX"
location="${basedir}/"
description="Target parent folder for built files" />
<property name="SRC_DIR"
location="${PREFIX}/src"
description="Folder for source files" />
<property name="TEST_DIR"
location="${PREFIX}/test"
description="Folder for test target" />
<property name="DIST_DIR"
location="${PREFIX}/dist"
description="Folder for concat and min target" />
<property name="BUILD_DIR"
location="${PREFIX}/build"
description="Folder for build artifacts" />
<property name="TOOLS_DIR"
location="${PREFIX}/tools"
description="Files for parsing etc."/>
<property name="LIB_DIR"
location="${PREFIX}/lib"
description="Folder for jquery and livequery libraries" />
<property name="PLUGIN_DIR"
location="${PREFIX}/plugins"
description="Folder for useful plugins to develop apps" />
<!-- Files names for distribution -->
<property name="CLAYPOOL_CORE"
location="${SRC_DIR}/core" />
<property name="CLAYPOOL_LOGGING"
location="${SRC_DIR}/logging" />
<property name="CLAYPOOL_APPLICATION"
location="${SRC_DIR}/application" />
<property name="CLAYPOOL_IOC"
location="${SRC_DIR}/ioc" />
<property name="CLAYPOOL_MVC"
location="${SRC_DIR}/mvc" />
<property name="CLAYPOOL_MODELS"
location="${SRC_DIR}/models" />
<property name="CLAYPOOL_AOP"
location="${SRC_DIR}/aop" />
<property name="CLAYPOOL_SERVER"
location="${SRC_DIR}/server" />
<property name="CLAYPOOL_TEST"
location="${SRC_DIR}/test" />
<!-- Individual Files -->
<property name="CLAYPOOL_MODULE_APP"
location="${DIST_DIR}/${PROJECT}.app.js" />
<property name="CLAYPOOL_MODULE_LOGGING"
location="${DIST_DIR}/${PROJECT}.logging.js" />
<property name="CLAYPOOL_MODULE_IOC"
location="${DIST_DIR}/${PROJECT}.ioc.js" />
<property name="CLAYPOOL_MODULE_MVC"
location="${DIST_DIR}/${PROJECT}.mvc.js" />
<property name="CLAYPOOL_MODULE_AOP"
location="${DIST_DIR}/${PROJECT}.aop.js" />
<property name="CLAYPOOL_MODULE_MODELS"
location="${DIST_DIR}/${PROJECT}.models.js" />
<property name="CLAYPOOL_MODULE_SERVER"
location="${DIST_DIR}/${PROJECT}.server.js" />
<!-- Individual Minified Files -->
<property name="CLAYPOOL_MODULE_APP_MIN"
location="${DIST_DIR}/${PROJECT}.app.min.js" />
<property name="CLAYPOOL_MODULE_LOGGING_MIN"
location="${DIST_DIR}/${PROJECT}.logging.min.js" />
<property name="CLAYPOOL_MODULE_IOC_MIN"
location="${DIST_DIR}/${PROJECT}.ioc.min.js" />
<property name="CLAYPOOL_MODULE_MVC_MIN"
location="${DIST_DIR}/${PROJECT}.mvc.min.js" />
<property name="CLAYPOOL_MODULE_AOP_MIN"
location="${DIST_DIR}/${PROJECT}.aop.min.js" />
<property name="CLAYPOOL_MODULE_MODELS_MIN"
location="${DIST_DIR}/${PROJECT}.models.min.js" />
<property name="CLAYPOOL_MODULE_SERVER_MIN"
location="${DIST_DIR}/${PROJECT}.server.min.js" />
<!-- BUNDLES -->
<property name="CLAYPOOL_ALL"
location="${DIST_DIR}/${BUILD}.js" />
<property name="CLAYPOOL_ALL_MIN"
location="${DIST_DIR}/${BUILD}.min.js" />
<property name="CLAYPOOL_LATEST"
location="${DIST_DIR}/${PROJECT}.js" />
<property name="CLAYPOOL_LATEST_MIN"
location="${DIST_DIR}/${PROJECT}.min.js" />
<property name="CLAYPOOL_LITE"
location="${DIST_DIR}/${BUILD}-lite.js" />
<property name="CLAYPOOL_LITE_MIN"
location="${DIST_DIR}/${BUILD}-lite.min.js" />
<property name="CLAYPOOL_LATEST_LITE"
location="${DIST_DIR}/${PROJECT}-lite.js" />
<property name="CLAYPOOL_LATEST_LITE_MIN"
location="${DIST_DIR}/${PROJECT}-lite.min.js" />
<!-- Plugin File Names for Distribution -->
<property name="VENDOR_BASE"
location="${basedir}/../" />
<property name="JQUERY_E4X"
location="${VENDOR_BASE}/jquery-e4x-templates/jquery.e4x.js" />
<property name="JQUERY_JSON"
location="${VENDOR_BASE}/jquery-json/jquery.json.js" />
<property name="JQUERY_JSPATH"
location="${VENDOR_BASE}/jquery-jspath/jquery.jspath.js" />
<property name="JQUERY_LOREMIPSUM"
location="${VENDOR_BASE}/jquery-loremipsum/jquery.loremipsum.js" />
<property name="JQUERY_OBJTREE"
location="${VENDOR_BASE}/jquery-objtree/jquery.objtree.js" />
<property name="JQUERY_SDB"
location="${VENDOR_BASE}/jquery-sdb/jquery.sdb.js" />
<property name="JQUERY_SDB_REST"
location="${VENDOR_BASE}/jquery-sdb/jquery.sdb.rest.js" />
<property name="JQUERY_XSLT"
location="${VENDOR_BASE}/jquery-xslt/jquery.xslt.js" />
<!-- for server side -->
<property name="CLAYPOOL_SERVER_JAR"
location="${VENDOR_BASE}/rhino-for-webapps/dist/claypool.jar"
description="Rhino For Webapps (Javascript Bridge)" />
<property name="ENVJS_JAR"
location="${VENDOR_BASE}/env-js/dist/env-js.jar"
description="Rhino with jLine Console and Envjs Tools" />
<property name="ENV_RHINO_JS"
location="${VENDOR_BASE}/env-js/dist/env.rhino.js"
description="Envjs for the Rhino Engine" />
<!-- BUILD TARGETS -->
<target name="default"
depends="lint, min"/>
<target name="all"
depends="default, vendor"/>
<target name="lint"
depends="concat"/>
<target name='vendor'
depends='plugins, server-jar'/>
<target name="clean">
<delete dir="${DIST_DIR}" />
<delete dir="${BUILD_DIR}" />
</target>
<target name="concat"
description="Main claypool build">
<mkdir dir="${BUILD_DIR}" />
<!-- CORE -->
<echo message="Building ${CLAYPOOL_CORE}" />
<concat destfile="${BUILD_DIR}/core.js">
<filterchain>
<replacetokens>
<token key="VERSION" value="${BUILD}"/>
</replacetokens>
</filterchain>
<fileset dir="${CLAYPOOL_CORE}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="configuration.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="cache.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="context.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="router.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="factory.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="error.js" />
<fileset dir="${CLAYPOOL_CORE}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/core.js" />
</java>
<echo message="${CLAYPOOL_CORE} built." />
<!-- LOGGING -->
<echo message="Building ${CLAYPOOL_LOGGING}" />
<concat destfile="${BUILD_DIR}/logging.js">
<fileset dir="${CLAYPOOL_LOGGING}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="level.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="logger.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="appender.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="formatter.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="factory.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="error.js" />
<fileset dir="${CLAYPOOL_LOGGING}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/logging.js" />
</java>
<echo message="${CLAYPOOL_LOGGING} built." />
<!-- APPLICATION -->
<echo message="Building ${CLAYPOOL_APPLICATION}" />
<concat destfile="${BUILD_DIR}/app.js">
<fileset dir="${CLAYPOOL_APPLICATION}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_APPLICATION}" includes="context.js" />
<fileset dir="${CLAYPOOL_APPLICATION}" includes="error.js" />
<fileset dir="${CLAYPOOL_APPLICATION}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/app.js" />
</java>
<echo message="${CLAYPOOL_APPLICATION} built." />
<!-- IOC -->
<echo message="Building ${CLAYPOOL_IOC}" />
<concat destfile="${BUILD_DIR}/ioc.js">
<fileset dir="${CLAYPOOL_IOC}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_IOC}" includes="instance.js" />
<fileset dir="${CLAYPOOL_IOC}" includes="factory.js" />
<fileset dir="${CLAYPOOL_IOC}" includes="container.js" />
<fileset dir="${CLAYPOOL_IOC}" includes="error.js" />
<fileset dir="${CLAYPOOL_IOC}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/ioc.js" />
</java>
<echo message="${CLAYPOOL_IOC} built." />
<!-- MVC -->
<echo message="Building ${CLAYPOOL_MVC}" />
<concat destfile="${BUILD_DIR}/mvc.js">
<fileset dir="${CLAYPOOL_MVC}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="view.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="controller.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="hijax.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="factory.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="container.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="error.js" />
<fileset dir="${CLAYPOOL_MVC}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/mvc.js" />
</java>
<echo message="${CLAYPOOL_MVC} built." />
<!-- MODELS -->
<echo message="Building ${CLAYPOOL_MODELS}" />
<concat destfile="${BUILD_DIR}/models.js">
<fileset dir="${CLAYPOOL_MODELS}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_MODELS}" includes="model.js" />
<fileset dir="${CLAYPOOL_MODELS}" includes="query.js" />
<fileset dir="${CLAYPOOL_MODELS}" includes="client.js" />
<fileset dir="${CLAYPOOL_MODELS}" includes="restclient.js" />
<fileset dir="${CLAYPOOL_MODELS}" includes="factory.js" />
<fileset dir="${CLAYPOOL_MODELS}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/models.js" />
</java>
<echo message="${CLAYPOOL_MVC} built." />
<!-- AOP -->
<echo message="Building ${CLAYPOOL_AOP}" />
<concat destfile="${BUILD_DIR}/aop.js">
<fileset dir="${CLAYPOOL_AOP}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_AOP}" includes="aspect.js" />
<fileset dir="${CLAYPOOL_AOP}" includes="factory.js" />
<fileset dir="${CLAYPOOL_AOP}" includes="container.js" />
<fileset dir="${CLAYPOOL_AOP}" includes="error.js" />
<fileset dir="${CLAYPOOL_AOP}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/aop.js" />
</java>
<echo message="${CLAYPOOL_AOP} built." />
<!-- SERVER -->
<echo message="Building ${CLAYPOOL_SERVER}" />
<concat destfile="${BUILD_DIR}/server.js">
<fileset dir="${CLAYPOOL_SERVER}" includes="namespace.js" />
<fileset dir="${CLAYPOOL_SERVER}" includes="servlet.js" />
<fileset dir="${CLAYPOOL_SERVER}" includes="rest.js" />
<fileset dir="${CLAYPOOL_SERVER}" includes="proxy.js" />
<fileset dir="${CLAYPOOL_SERVER}" includes="console.js" />
<fileset dir="${CLAYPOOL_SERVER}" includes="error.js" />
<fileset dir="${CLAYPOOL_SERVER}" includes="plugin.js" />
</concat>
<java jar="${JSLINT_JAR}" classpath="${RHINO_JAR}" fork="true">
<arg value="${BUILD_DIR}/server.js" />
</java>
<echo message="${CLAYPOOL_SERVER} built." />
<!-- TEST (MoonUnit) DEPRECATED Prefer jQunit and jqunit-spec plugin-->
<mkdir dir="${DIST_DIR}" />
<!-- INDIVIDUAL MODULES -->
<echo message="Building ${CLAYPOOL_MODULE_APP}" />
<concat destfile="${CLAYPOOL_MODULE_APP}">
<fileset dir="${BUILD_DIR}" includes="core.js" />
<fileset dir="${BUILD_DIR}" includes="app.js" />
</concat>
<echo message="Building ${CLAYPOOL_MODULE_LOGGING}" />
<copy file='${BUILD_DIR}/logging.js'
tofile='${CLAYPOOL_MODULE_LOGGING}'/>
<echo message="Building ${CLAYPOOL_MODULE_LOGGING}" />
<copy file='${BUILD_DIR}/ioc.js'
tofile='${CLAYPOOL_MODULE_IOC}'/>
<echo message="Building ${CLAYPOOL_MODULE_MVC}" />
<copy file='${BUILD_DIR}/mvc.js'
tofile='${CLAYPOOL_MODULE_MVC}'/>
<echo message="Building ${CLAYPOOL_MODULE_AOP}" />
<copy file='${BUILD_DIR}/aop.js'
tofile='${CLAYPOOL_MODULE_AOP}'/>
<echo message="Building ${CLAYPOOL_MODULE_MODELS}" />
<copy file='${BUILD_DIR}/models.js'
tofile='${CLAYPOOL_MODULE_MODELS}'/>
<echo message="Building ${CLAYPOOL_MODULE_SERVER}" />
<copy file='${BUILD_DIR}/server.js'
tofile='${CLAYPOOL_MODULE_SERVER}'/>
<!-- ALL CORE -->
<echo message="Building ${CLAYPOOL_ALL}" />
<concat destfile="${CLAYPOOL_ALL}">
<fileset dir="${BUILD_DIR}" includes="core.js" />
<fileset dir="${BUILD_DIR}" includes="logging.js" />
<fileset dir="${BUILD_DIR}" includes="app.js" />
<fileset dir="${BUILD_DIR}" includes="aop.js" />
<fileset dir="${BUILD_DIR}" includes="ioc.js" />
<fileset dir="${BUILD_DIR}" includes="mvc.js" />
<fileset dir="${BUILD_DIR}" includes="models.js" />
<fileset dir="${BUILD_DIR}" includes="server.js" />
</concat>
<copy file='${CLAYPOOL_ALL}' tofile='${CLAYPOOL_LATEST}'/>
<copy file='${CLAYPOOL_LATEST}' todir='${LIB_DIR}'/>
<echo message="${CLAYPOOL_ALL} built." />
<!-- LITE CORE -->
<echo message="Building ${CLAYPOOL_LITE}" />
<concat destfile="${CLAYPOOL_LITE}">
<fileset dir="${BUILD_DIR}" includes="core.js" />
<fileset dir="${BUILD_DIR}" includes="logging.js" />
<fileset dir="${BUILD_DIR}" includes="app.js" />
<fileset dir="${BUILD_DIR}" includes="aop.js" />
<fileset dir="${BUILD_DIR}" includes="ioc.js" />
<fileset dir="${BUILD_DIR}" includes="mvc.js" />
</concat>
<copy file='${CLAYPOOL_LITE}' tofile='${CLAYPOOL_LATEST_LITE}'/>
<echo message="${CLAYPOOL_LITE} built." />
</target>
<target name="min" depends="concat" >
<echo message="Compressing Distibutions" />
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_ALL_MIN}"/>
<arg value="${CLAYPOOL_ALL}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<copy file='${CLAYPOOL_ALL_MIN}' tofile='${CLAYPOOL_LATEST_MIN}'/>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_LITE_MIN}"/>
<arg value="${CLAYPOOL_LITE}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<copy file='${CLAYPOOL_LITE_MIN}' tofile='${CLAYPOOL_LATEST_LITE_MIN}'/>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_APP_MIN}"/>
<arg value="${CLAYPOOL_MODULE_APP}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_LOGGING_MIN}"/>
<arg value="${CLAYPOOL_MODULE_LOGGING}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_IOC_MIN}"/>
<arg value="${CLAYPOOL_MODULE_IOC}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_MVC_MIN}"/>
<arg value="${CLAYPOOL_MODULE_MVC}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_AOP_MIN}"/>
<arg value="${CLAYPOOL_MODULE_AOP}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_MODELS_MIN}"/>
<arg value="${CLAYPOOL_MODULE_MODELS}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<java jar="${YUI_MIN_JAR}" fork="true">
<arg value="--charset=utf8"/>
<arg value="--line-break"/>
<arg value="8000"/>
<arg value="-o"/>
<arg value="${CLAYPOOL_MODULE_SERVER_MIN}"/>
<arg value="${CLAYPOOL_MODULE_SERVER}" />
<classpath>
<pathelement location="${RHINO_JAR}"/>
</classpath>
</java>
<echo message="Finished Compressing Distibution" />
</target>
<target name='plugins'>
<copy file='${JQUERY_E4X}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_JSON}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_JSPATH}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_LOREMIPSUM}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_OBJTREE}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_SDB}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_SDB_REST}' todir='${PLUGIN_DIR}' />
<copy file='${JQUERY_XSLT}' todir='${PLUGIN_DIR}' />
</target>
<target name='server-jar'>
<copy file='${CLAYPOOL_SERVER_JAR}' todir='${JAVA_LIB_DIR}' />
<copy file='${ENVJS_JAR}' todir='${JAVA_LIB_DIR}' />
<copy file='${ENV_RHINO_JS}' todir='${JAVA_LIB_DIR}' />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.