Commit 2a3ff6f6 authored by Andreas Gärtner's avatar Andreas Gärtner

updated build process for sencha cmd.

parent 4ebb55b7
<project name="ARSnova" default="run">
<property name="main.dir" value="src/main/webapp" />
<property name="main.lib.dir" value="${main.dir}/lib" />
<property name="main.sencha.dir" value="${main.lib.dir}/touch-2.3.1" />
<property name="sencha.build.dir" value="${main.dir}/build" />
<property name="sencha.build.testing.dir" value="${sencha.build.dir}/testing/ARSnova" />
<property name="sencha.build.production.dir" value="${sencha.build.dir}/production/ARSnova" />
<property name="build.dir" value="src/main/build" />
<property name="build.lib.dir" value="${build.dir}/lib" />
<property name="build.sencha.dir" value="${build.lib.dir}/touch-2.3.1" />
<target name="-build:init">
<mkdir dir="${build.dir}" />
</target>
<target name="-min:js:minify">
<apply executable="java" dest="${main.dir}" failonerror="true">
<arg value="-jar"/>
<arg value="${main.lib.dir}/compiler.jar"/>
<arg value="--js"/>
<srcfile/>
<arg value="--js_output_file"/>
<targetfile/>
<fileset dir="${main.dir}">
<include name="**/*.js"/>
</fileset>
<mapper type="glob" from="*.js" to="*.js.min"/>
</apply>
<target name="sencha:build:testing">
<exec executable="sencha" dir="${main.dir}">
<arg value="app"/>
<arg value="build"/>
<arg value="testing"/>
</exec>
</target>
<target name="-min:js:move" depends="-min:js:minify">
<move todir="${build.dir}" verbose="true">
<fileset dir="${main.dir}">
<include name="**/*.js.min"/>
</fileset>
<mapper type="glob" from="*.min" to="*"/>
</move>
<target name="sencha:build:production">
<exec executable="sencha" dir="${main.dir}">
<arg value="app"/>
<arg value="build"/>
<arg value="production"/>
</exec>
</target>
<target name="-assets:copy" depends="-build:init">
<copy todir="${build.dir}/resources">
<fileset dir="${main.dir}/resources" />
</copy>
<target name="-assets:testing:copy" depends="-build:init">
<copy todir="${build.dir}">
<fileset dir="${main.dir}">
<include name="index.html" />
<include name="arsnova.manifest" />
<include name="favicon.png" />
<include name="WEB-INF/**" />
</fileset>
</copy>
<!-- copy required Sencha Touch resources -->
<copy todir="${build.sencha.dir}/resources">
<fileset dir="${main.sencha.dir}/resources" />
<fileset dir="${sencha.build.testing.dir}" />
</copy>
</target>
<target name="min:js" depends="-build:init,-assets:copy,-min:js:move" />
<target name="min:css" depends="-build:init,-assets:copy">
<java jar="${main.lib.dir}/stylesheets.jar" fork="true" failonerror="true">
<arg line="--allowed-non-standard-function color-stop" />
<arg line="--allowed-non-standard-function progid:DXImageTransform.Microsoft.gradient" />
<arg value="--output-file" />
<arg value="${build.dir}/resources/css/st2-arsnova_min.css" />
<arg value="${main.dir}/resources/css/st2-arsnova_new.css" />
</java>
<target name="-assets:production:copy" depends="-build:init">
<copy todir="${build.dir}">
<fileset dir="${sencha.build.production.dir}" />
</copy>
</target>
<target name="run" depends="min:css,min:js" />
</project>
<target name="run" depends="sencha:build:testing, -assets:testing:copy"/>
</project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment