-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
109 lines (97 loc) · 3.73 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<project name="iRail-webclient" default="build" basedir=".">
<target name="-load.properties"
description="Set properties for this build">
<property name="devdir" value="src"/>
<!--YUI Compressor location-->
<property name="yui.dir" value="${devdir}/tools/yuicompressor.jar"/>
<!--Source JS dir-->
<property name="src.js.dir" value="${devdir}/js"/>
<!--Source css dir -->
<property name="src.css.dir" value="${devdir}/css"/>
<!--Output dir-->
<property name="build.dir" value="client"/>
<!--Build version information -->
<property name="build.major" value="1"/>
<property name="build.minor" value="0"/>
</target>
<!--Create build directories-->
<target name="-init" depends="-load.properties"
description="Create build directory structure">
<!--Delete previous build files-->
<delete dir="${build.dir}/js"/>
<!--Recreate the build directories-->
<mkdir dir="${build.dir}/js"/>
<mkdir dir="${build.dir}/css"/>
</target>
<!--Concatenate JS files-->
<target name="-js.concatenate" depends="-init"
description="Concatenates specified Javascript files">
<!-- Core -->
<concat destfile="${build.dir}/js/irail.js">
<fileset
dir="${src.js.dir}"
includes="core/*.js,core/controller/*.js,core/prefill/build/bundle.js"/>
</concat>
<echo>Finished</echo>
</target>
<!--Minify JS files-->
<target name="-js.minify" depends="-js.concatenate"
description="Minifies JavaScript files">
<apply executable="java" parallel="false" dest="${build.dir}/js">
<fileset
dir="${build.dir}/js"
includes="*.js" />
<arg line="-jar"/>
<arg path="${yui.dir}"/>
<srcfile/>
<arg line="-o"/>
<mapper type="glob" from="*.js" to="*.min.js"/>
<targetfile/>
</apply>
<echo>Finished</echo>
</target>
<target name="-js.copy.libs" depends="-js.minify"
description="Copies (minified) libraries to build dir">
<copy description="" todir="${build.dir}/js">
<fileset dir="${src.js.dir}/libs" includes="*.js">
</fileset>
</copy>
<echo>Finished</echo>
</target>
<!-- compile css-->
<target name="-sass.compile" depends="-js.copy.libs"
description="compile css files with sass">
<apply executable="sass" parallel="false" dest="${build.dir}/css" verbose="true" force="true" failonerror="true">
<fileset dir="${src.css.dir}" includes="style.scss"/>
<arg path="${src.css.dir}/style.scss"/>
<arg path="${build.dir}/css/style.css"/>
<srcfile/>
<mapper type="glob" from="*.scss" to="*.css"/>
</apply>
<echo>Finished</echo>
</target>
<!-- Clean -->
<target name="-clean" depends="-sass.compile"
description="Clean build directory">
<delete includeemptydirs="true">
<fileset dir="${build.dir}/js" defaultexcludes="false">
<exclude name="irail.min.js" />
<exclude name="modernizr.min.js" />
<exclude name="geoPosition.js" />
</fileset>
</delete>
<echo>Finished</echo>
</target>
<!--Build-->
<target name="build"
description="Builds project files for production use"
depends="
-load.properties,
-init,
-js.concatenate,
-js.minify,
-js.copy.libs,
-sass.compile,
-clean">
</target>
</project>