forked from CSSLint/parser-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
146 lines (130 loc) · 5.49 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<project name="Parser Lib" default="all">
<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
<!-- the directories and files to output to -->
<property name="build.dir" value="./build" />
<!-- output filenames -->
<property name="full.build.file" value="parserlib.js"/>
<property name="core.build.file" value="parserlib-core.js"/>
<property name="css.build.file" value="parserlib-css.js"/>
<property name="node.build.file" value="node-parserlib.js"/>
<loadfile property="license.text" srcfile="LICENSE" />
<tstamp>
<format property="RIGHT_NOW"
pattern="d-MMMM-yyyy hh:mm:ss"
locale="en,US"/>
</tstamp>
<!-- build the full library -->
<target name="build.full" depends="build.core,build.css">
<concat destfile="${build.dir}/${full.build.file}" fixlastline="true">
<filelist dir="${build.dir}" files="${core.build.file}, ${css.build.file}"/>
</concat>
</target>
<!-- build the core library -->
<target name="build.core">
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/* Build time: ${RIGHT_NOW} */
var parserlib = {};
(function(){
</header>
<!--<filelist dir="${src.dir}/util" files="EventTarget.js, StringReader.js, TokenStream.js"/> -->
<fileset dir="${src.dir}/util" includes="*.js" />
<footer trimleading="yes">
parserlib.util = {
StringReader: StringReader,
SyntaxError : SyntaxError,
SyntaxUnit : SyntaxUnit,
EventTarget : EventTarget,
TokenStreamBase : TokenStreamBase
};
})();
</footer>
</concat>
</target>
<!-- build the CSS library -->
<target name="build.css">
<concat destfile="${build.dir}/${css.build.file}" fixlastline="true">
<header trimleading="yes">/*
${license.text}
*/
/* Build time: ${RIGHT_NOW} */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
StringReader = parserlib.util.StringReader,
SyntaxError = parserlib.util.SyntaxError,
SyntaxUnit = parserlib.util.SyntaxUnit;
</header>
<!--<filelist dir="${src.dir}/css" files="CSSTokens.js, CSSSelectorUnit.js, CSSColors.js, CSSValueUnit.js, CSSParser.js"/>-->
<fileset dir="${src.dir}/css" includes="*.js" />
<footer trimleading="yes">
parserlib.css = {
Colors :Colors,
Combinator :Combinator,
Parser :Parser,
PropertyName :PropertyName,
PropertyValue :PropertyValue,
PropertyValuePart :PropertyValuePart,
MediaFeature :MediaFeature,
MediaQuery :MediaQuery,
Selector :Selector,
SelectorPart :SelectorPart,
SelectorSubPart :SelectorSubPart,
TokenStream :TokenStream,
Tokens :Tokens,
ValidationError :ValidationError
};
})();
</footer>
</concat>
</target>
<!-- Build the Node version -->
<target name="build.node">
<!--<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
<header trimleading="yes">/*
${license.text}
*/
</header>
<fileset dir="${src.dir}/util" includes="*.js" />
<fileset dir="${src.dir}/css" includes="*.js" />
<footer trimleading="yes">
exports.util = {
StringReader: StringReader,
SyntaxError : SyntaxError,
SyntaxUnit : SyntaxUnit,
EventTarget : EventTarget,
TokenStreamBase : TokenStreamBase
};
exports.css = {
Colors :Colors,
Combinator :Combinator,
Parser :Parser,
PropertyName :PropertyName,
PropertyValue :PropertyValue,
MediaFeature :MediaFeature,
MediaQuery :MediaQuery,
Selector :Selector,
SelectorPart :SelectorPart,
SelectorSubPart :SelectorSubPart,
TokenStream :TokenStream,
Tokens :Tokens
};
</footer>
</concat>-->
<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
<filelist dir="${build.dir}" files="${core.build.file}, ${css.build.file}"/>
<footer trimleading="yes">
(function(){
for(var prop in parserlib){
exports[prop] = parserlib[prop];
}
})();
</footer>
</concat>
</target>
<!-- Build all files -->
<target name="all" depends="build.full,build.node"/>
</project>