build.xml 2.62 KB
Newer Older
1
<project name="ARSnova" default="run">
2
	<property name="main.dir" value="src/main/webapp" />
Christoph Thelen's avatar
Christoph Thelen committed
3 4 5
	<property name="main.lib.dir" value="${main.dir}/lib" />
	<property name="main.sencha.dir" value="${main.lib.dir}/sencha-touch-2.2.1" />
	
6
	<property name="build.dir" value="src/main/build" />
Christoph Thelen's avatar
Christoph Thelen committed
7 8
	<property name="build.lib.dir" value="${build.dir}/lib" />
	<property name="build.sencha.dir" value="${build.lib.dir}/sencha-touch-2.2.1" />
9
	
10 11 12 13
	<target name="-build:init">
		<mkdir dir="${build.dir}" />
	</target>
	
14
	<target name="-min:js:minify">
15
		<apply executable="java" dest="${main.dir}" failonerror="true">
16
			<arg value="-jar"/>
Christoph Thelen's avatar
Christoph Thelen committed
17
			<arg value="${main.lib.dir}/compiler.jar"/>
18 19 20 21 22
			<arg value="--js"/>
			<srcfile/>
			<arg value="--js_output_file"/>
			<targetfile/>
			
23 24 25 26 27 28
			<fileset dir="${main.dir}">
				<include name="**/*.js"/>
				<!-- do not process Touch Charts - it throws errors! -->
				<exclude name="**/*touch-charts-debug.js"/>
				<exclude name="**/*touch-charts.js"/>
			</fileset>
29 30
			<mapper type="glob" from="*.js" to="*.js.min"/>
		</apply>
31
		<!-- copy Touch Charts manually -->
Christoph Thelen's avatar
Christoph Thelen committed
32 33
		<copy todir="${build.lib.dir}/touch-charts-2.0">
			<fileset dir="${main.lib.dir}/touch-charts-2.0">
34 35 36
				<include name="touch-charts.js"/>
			</fileset>
		</copy>
37 38
	</target>
	
39 40
	<target name="-min:js:move" depends="-min:js:minify">
		<move todir="${build.dir}" verbose="true">
41
			<fileset dir="${main.dir}">
42 43 44 45 46 47
				<include name="**/*.js.min"/>
			</fileset>
			<mapper type="glob" from="*.min" to="*"/>
		</move>
	</target>
	
48 49 50 51 52 53 54 55 56 57 58 59
	<target name="-assets:copy"  depends="-build:init">
		<copy todir="${build.dir}/resources">
			<fileset dir="${main.dir}/resources" />
		</copy>
		<copy todir="${build.dir}">
			<fileset dir="${main.dir}">
				<include name="st2-index.html" />
				<include name="st2-arsnova.manifest" />
				<include name="favicon.png" />
				<include name="WEB-INF/**" />
			</fileset>
		</copy>
Christoph Thelen's avatar
Christoph Thelen committed
60 61 62 63
		<!-- copy required Sencha Touch resources -->
		<copy todir="${build.sencha.dir}/resources">
			<fileset dir="${main.sencha.dir}/resources" />
		</copy>
64 65 66
	</target>
	
	<target name="min:js" depends="-build:init,-assets:copy,-min:js:move" />
67
	
68
	<target name="min:css" depends="-build:init,-assets:copy">
Christoph Thelen's avatar
Christoph Thelen committed
69
		<java jar="${main.lib.dir}/stylesheets.jar" fork="true" failonerror="true">
70 71 72 73 74
			<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" />
75 76
		</java> 
	</target>
77 78
	
	<target name="run" depends="min:css,min:js" />
79 80

</project>