build.xml 2.3 KB
Newer Older
1
<project name="ARSnova" default="run">
2
3
	<property name="main.dir" value="src/main/webapp" />
	<property name="lib.dir" value="${main.dir}/lib" />
4
	<property name="sencha.dir" value="${lib.dir}/sencha1.1.1" />
5
	<property name="build.dir" value="src/main/build" />
6
	
7
8
9
10
	<target name="-build:init">
		<mkdir dir="${build.dir}" />
	</target>
	
11
	<target name="-min:js:minify">
12
		<apply executable="java" dest="${main.dir}" failonerror="true">
13
14
15
16
17
18
19
			<arg value="-jar"/>
			<arg value="${lib.dir}/compiler.jar"/>
			<arg value="--js"/>
			<srcfile/>
			<arg value="--js_output_file"/>
			<targetfile/>
			
20
21
22
23
24
25
			<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>
26
27
			<mapper type="glob" from="*.js" to="*.js.min"/>
		</apply>
28
29
30
31
32
33
		<!-- copy Touch Charts manually -->
		<copy todir="${build.dir}/lib/touch-charts-2.0">
			<fileset dir="${main.dir}/lib/touch-charts-2.0">
				<include name="touch-charts.js"/>
			</fileset>
		</copy>
34
35
	</target>
	
36
37
	<target name="-min:js:move" depends="-min:js:minify">
		<move todir="${build.dir}" verbose="true">
38
			<fileset dir="${main.dir}">
39
40
41
42
43
44
				<include name="**/*.js.min"/>
			</fileset>
			<mapper type="glob" from="*.min" to="*"/>
		</move>
	</target>
	
45
46
47
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>
	</target>
	
	<target name="min:js" depends="-build:init,-assets:copy,-min:js:move" />
60
	
61
62
63
64
65
66
67
	<target name="min:css" depends="-build:init,-assets:copy">
		<java jar="${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" />
68
69
		</java> 
	</target>
70
71
	
	<target name="run" depends="min:css,min:js" />
72
73

</project>