forked from CSSLint/csslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
114 lines (93 loc) · 4.28 KB
/
build.xml
File metadata and controls
114 lines (93 loc) · 4.28 KB
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
110
111
112
113
114
<project name="csslint" default="all">
<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
<property name="npm.dir" value="./npm" />
<property name="tests.dir" value="./tests" />
<!-- the directories and files to output to -->
<property name="build.dir" value="./build" />
<property name="build.npm.dir" value="${build.dir}/npm" />
<!-- the directory containing library files -->
<property name="lib.dir" value="./lib" />
<!-- output filenames -->
<property name="core.build.file" value="csslint.js"/>
<property name="node.build.file" value="csslint-node.js"/>
<property name="worker.build.file" value="csslint-worker.js"/>
<property name="tests.build.file" value="csslint-tests.js"/>
<property name="rhino.build.file" value="csslint-rhino.js"/>
<loadfile property="license.text" srcfile="LICENSE" />
<!-- clean -->
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!-- build the core library -->
<target name="build.core">
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
var CSSLint = (function(){
</header>
<fileset dir="${lib.dir}" includes="*.js" />
<filelist dir="${src.dir}/core" files="CSSLint.js" />
<fileset dir="${src.dir}/core" includes="*.js" excludes="CSSLint.js"/>
<fileset dir="${src.dir}/rules" includes="*.js" />
<footer trimleading="yes">
return CSSLint;
})();
</footer>
</concat>
</target>
<!-- build the web worker library -->
<target name="build.worker">
<concat destfile="${build.dir}/${worker.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
</header>
<fileset dir="${lib.dir}" includes="*.js" />
<filelist dir="${src.dir}/core" files="CSSLint.js" />
<fileset dir="${src.dir}/core" includes="*.js" excludes="CSSLint.js"/>
<fileset dir="${src.dir}/rules" includes="*.js" />
<fileset dir="${src.dir}/worker" includes="*.js" />
</concat>
</target>
<!-- build the Node.js package -->
<target name="build.node">
<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
</header>
<fileset dir="${lib.dir}" includes="*.js" />
<filelist dir="${src.dir}/core" files="CSSLint.js" />
<fileset dir="${src.dir}/core" includes="*.js" excludes="CSSLint.js"/>
<fileset dir="${src.dir}/rules" includes="*.js" />
<footer trimleading="yes">
exports.CSSLint = CSSLint;
</footer>
</concat>
<mkdir dir="${build.npm.dir}"/>
<mkdir dir="${build.npm.dir}/lib"/>
<copy file="${npm.dir}/package.json" todir="${build.npm.dir}"/>
<concat destfile="${build.npm.dir}/cli.js" fixlastline="true">
<header trimleading="yes">#!/usr/bin/env node</header>
<filelist dir="${src.dir}/cli" files="util.js,node.js" />
</concat>
<copy file="${build.dir}/${node.build.file}" todir="${build.npm.dir}/lib"/>
</target>
<!-- build the tests into a single file -->
<target name="build.tests">
<concat destfile="${build.dir}/${tests.build.file}" fixlastline="true">
<fileset dir="${tests.dir}/rules" includes="*.js" />
</concat>
</target>
<!-- build for rhino CLI integration -->
<target name="build.rhino" depends="build.core">
<concat destfile="${build.dir}/${rhino.build.file}" fixlastline="true">
<filelist dir="${build.dir}" files="${core.build.file}" />
<filelist dir="${src.dir}/cli" files="util.js,rhino.js" />
</concat>
</target>
<!-- Build all files -->
<target name="all" depends="clean,build.core,build.worker,build.node,build.tests,build.rhino"/>
</project>