forked from nzakas/nui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
106 lines (83 loc) · 3.36 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
<project name="nui" default="build.all">
<!-- version number -->
<property name="nui.version" value="0.1.0" />
<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
<property name="components.dir" value="${src.dir}/components" />
<property name="core.dir" value="${src.dir}/core" />
<!-- the directories and files to output to -->
<property name="lib.dir" value="./lib" />
<!-- the directories and files to output to -->
<property name="build.dir" value="./build" />
<!-- output filenames -->
<property name="full.build.file" value="nui.js"/>
<property name="core.build.file" value="nui-core.js"/>
<property name="components.build.file" value="nui-components.js"/>
<property name="css.build.file" value="nui-components.css"/>
<!-- license information -->
<loadfile property="license.text" srcfile="LICENSE" />
<tstamp>
<format property="RIGHT_NOW"
pattern="d-MMMM-yyyy hh:mm:ss"
locale="en,US"/>
</tstamp>
<tstamp>
<format property="SIMPLE_DATE"
pattern="MMMM d, yyyy"
locale="en,US"/>
</tstamp>
<!-- clean -->
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!-- validate JS files with JSHint -->
<target name="lint">
<fileset dir="${src.dir}" includes="core/*.js,components/*/*.js" id="jsfiles.raw"/>
<pathconvert pathsep=" " property="jsfiles.clean" refid="jsfiles.raw" />
<exec executable="java" failonerror="true">
<arg line="-jar"/>
<arg path="${lib.dir}/js.jar"/>
<arg path="${lib.dir}/jshint.js" />
<arg line="${jsfiles.clean} curly=true,forin=true,latedef=true,evil=true,loopfunc=true,undef=true,rhino=false" />
</exec>
</target>
<!-- build the full library -->
<target name="build.full" depends="build.core,build.components,build.css">
</target>
<!-- build the core library -->
<target name="build.core">
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/* Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<filelist dir="${src.dir}/core" files="nui.js" />
<fileset dir="${src.dir}/core" includes="*.js" excludes="nui.js"/>
</concat>
</target>
<!-- build the component library -->
<target name="build.components">
<concat destfile="${build.dir}/${components.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/* Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${components.dir}" includes="**/*.js" />
</concat>
</target>
<!-- build the CSS library -->
<target name="build.css">
<concat destfile="${build.dir}/${css.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/* Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${components.dir}" includes="*.css" />
</concat>
</target>
<!-- Build all files -->
<target name="build.all" depends="lint,build.full"/>
</project>