Skip to content

Commit bf46e7d

Browse files
committed
Try to fix Travis build
1 parent 6e19625 commit bf46e7d

File tree

2 files changed

+74
-53
lines changed

2 files changed

+74
-53
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
script: "ant test"
1+
language: node_js
2+
node_js:
3+
- 0.8
4+
before_install: "npm install -g yuitest"
5+
script: "ant test.node"

build.xml

Lines changed: 69 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
<property name="src.dir" value="./src" />
88
<property name="npm.dir" value="./npm" />
99
<property name="tests.dir" value="./tests" />
10-
10+
1111
<!-- the directories and files to output to -->
1212
<property name="build.dir" value="./build" />
1313
<property name="release.dir" value="./release" />
1414
<property name="build.npm.dir" value="${build.dir}/npm" />
1515

1616
<!-- the directory containing library files -->
17-
<property name="lib.dir" value="./lib" />
18-
17+
<property name="lib.dir" value="./lib" />
18+
1919
<!-- library files -->
2020
<property name="jshint.js" value="jshint.js" />
2121
<property name="parserlib.js" value="parserlib.js" />
2222
<property name="yuitest.js" value="yuitest.js" />
23-
23+
2424
<!-- external resources -->
2525
<property name="parser.url" value="https://raw.github.com/nzakas/parser-lib/master/release/parserlib.js"/>
2626

@@ -29,11 +29,12 @@
2929
<property name="node.build.file" value="csslint-node.js"/>
3030
<property name="worker.build.file" value="csslint-worker.js"/>
3131
<property name="tests.build.file" value="csslint-tests.js"/>
32+
<property name="tests.node.build.file" value="csslint-node-tests.js"/>
3233
<property name="rhino.build.file" value="csslint-rhino.js"/>
3334
<property name="wsh.build.file" value="csslint-wsh.js"/>
34-
35+
3536
<!-- embeddable license -->
36-
<loadfile property="license.text" srcfile="LICENSE" />
37+
<loadfile property="license.text" srcfile="LICENSE" />
3738

3839
<!-- get a timestamp -->
3940
<tstamp>
@@ -45,81 +46,89 @@
4546
<format property="SIMPLE_DATE"
4647
pattern="MMMM d, yyyy"
4748
locale="en,US"/>
48-
</tstamp>
49-
49+
</tstamp>
50+
5051
<!-- clean -->
5152
<target name="clean">
5253
<delete dir="${build.dir}" />
5354
</target>
54-
55+
5556
<target name="changelog.update">
5657
<exec executable="git" failonerror="true" outputproperty="git.tag">
5758
<arg line="tag"/>
58-
</exec>
59+
</exec>
5960
<script language="javascript"><![CDATA[
6061
//get the most recent tag to get the diff
6162
var tags = csslint.getProperty("git.tag").replace("\r", "").split("\n"),
6263
lastTag = tags[tags.length-1];
6364
csslint.setProperty("git.log.range", lastTag + "..HEAD");
6465
]]></script>
65-
66+
6667
<!-- git log -pretty=format:'* %s (%an)' v0.4.0..v0.5.0-->
6768
<exec executable="git" failonerror="true" outputproperty="git.changelog">
6869
<arg line="log --pretty=format:'* %s (%an)' ${git.log.range}"/>
69-
</exec>
70-
70+
</exec>
71+
7172
<concat destfile="CHANGELOG.tmp" fixlastline="true">
7273
<header trimleading="yes">${SIMPLE_DATE} - v${csslint.version}
73-
74+
7475
${git.changelog}
75-
76+
7677
</header>
7778
<fileset dir="." includes="CHANGELOG" />
7879
</concat>
79-
80+
8081
<delete file="CHANGELOG"/>
8182
<move file="CHANGELOG.tmp" tofile="CHANGELOG"/>
82-
83+
8384
</target>
84-
85+
8586
<!-- validate JS files with JSHint -->
86-
<target name="lint">
87+
<target name="lint">
8788
<fileset dir="${src.dir}" includes="**/*.js" id="jsfiles.raw"/>
8889
<pathconvert pathsep=" " property="jsfiles.clean" refid="jsfiles.raw" />
8990
<exec executable="java" failonerror="true">
9091
<arg line="-jar"/>
9192
<arg path="${lib.dir}/js.jar"/>
92-
<arg path="${lib.dir}/jshint.js" />
93+
<arg path="${lib.dir}/jshint.js" />
9394
<arg line="${jsfiles.clean} curly=true,forin=true,latedef=true,noempty=true,undef=true,rhino=false" />
94-
</exec>
95+
</exec>
9596
</target>
9697

9798
<!-- run tests on the command line -->
98-
<target name="test" depends="build.all,lint,test.general.rules">
99+
<target name="test" depends="build.all,lint,test.general.rules">
99100
<exec executable="java" failonerror="true">
100101
<arg line="-jar"/>
101102
<arg path="${lib.dir}/js.jar"/>
102103
<arg path="${lib.dir}/yuitest-rhino-cli.js" />
103104
<arg path="${build.dir}/${core.build.file}" />
104105
<arg path="${build.dir}/${tests.build.file}" />
105-
</exec>
106+
</exec>
106107
</target>
107108

108109
<!-- must be done separately from other tests due to Rhino limitations -->
109-
<target name="test.general.rules">
110+
<target name="test.general.rules">
110111
<exec executable="java" failonerror="true">
111112
<arg line="-jar"/>
112113
<arg path="${lib.dir}/js.jar"/>
113114
<arg path="${lib.dir}/yuitest-rhino-cli.js" />
114115
<arg path="${build.dir}/${core.build.file}" />
115116
<arg path="${tests.dir}/all-rules.js" />
116-
</exec>
117+
</exec>
118+
</target>
119+
120+
<!-- tests using Node.js for better performance -->
121+
<target name="test.node" depends="build.all,lint">
122+
<exec executable="yuitest" failonerror="true">
123+
<arg line="--webcompat"/>
124+
<arg path="${build.dir}/${tests.node.build.file}" />
125+
</exec>
117126
</target>
118127

119128
<!-- build the core library -->
120-
<target name="build.core">
129+
<target name="build.core">
121130
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
122-
<header trimleading="yes">/*!
131+
<header trimleading="yes">/*!
123132
${license.text}
124133
*/
125134
/* Build time: ${RIGHT_NOW} */
@@ -134,12 +143,12 @@
134143
return CSSLint;
135144
})();
136145
</footer>
137-
146+
138147
</concat>
139148
</target>
140-
149+
141150
<!-- build the web worker library -->
142-
<target name="build.worker">
151+
<target name="build.worker">
143152
<concat destfile="${build.dir}/${worker.build.file}" fixlastline="true">
144153
<header trimleading="yes">/*!
145154
${license.text}
@@ -149,16 +158,16 @@
149158
<fileset dir="${lib.dir}" includes="${parserlib.js}" />
150159
<filelist dir="${src.dir}/core" files="CSSLint.js" />
151160
<fileset dir="${src.dir}/core" includes="*.js" excludes="CSSLint.js"/>
152-
<fileset dir="${src.dir}/rules" includes="*.js" />
161+
<fileset dir="${src.dir}/rules" includes="*.js" />
153162
<fileset dir="${src.dir}/formatters" includes="*.js" />
154-
<fileset dir="${src.dir}/worker" includes="*.js" />
155-
</concat>
156-
</target>
157-
158-
163+
<fileset dir="${src.dir}/worker" includes="*.js" />
164+
</concat>
165+
</target>
166+
167+
159168
<!-- build the Node.js package -->
160169
<target name="build.node">
161-
170+
162171
<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
163172
<header trimleading="yes">/*!
164173
${license.text}
@@ -174,7 +183,7 @@
174183
exports.CSSLint = CSSLint;
175184
</footer>
176185
</concat>
177-
186+
178187
<mkdir dir="${build.npm.dir}"/>
179188
<mkdir dir="${build.npm.dir}/lib"/>
180189
<copy file="${npm.dir}/package.json" todir="${build.npm.dir}"/>
@@ -185,34 +194,42 @@
185194
<filelist dir="${src.dir}/cli" files="common.js,node.js" />
186195
</concat>
187196
<copy file="${build.dir}/${node.build.file}" todir="${build.npm.dir}/lib"/>
188-
197+
189198
<!-- CRLF will cause Node version to break -->
190199
<fixcrlf srcdir="${build.dir}" includes="**/*" eol="lf" />
191200
</target>
192-
201+
193202
<!-- build the tests into a single file -->
194-
<target name="build.tests">
203+
<target name="build.tests" depends="build.node.tests">
195204
<concat destfile="${build.dir}/${tests.build.file}" fixlastline="true">
196-
<fileset dir="${tests.dir}/" includes="**/*.js" excludes="all-rules.js" />
197-
</concat>
198-
</target>
205+
<fileset dir="${tests.dir}/" includes="**/*.js" excludes="all-rules.js" />
206+
</concat>
207+
</target>
208+
209+
<!-- build the tests into a single file -->
210+
<target name="build.node.tests" depends="build.core">
211+
<concat destfile="${build.dir}/${tests.node.build.file}" fixlastline="true">
212+
<filelist dir="${build.dir}" files="${core.build.file}" />
213+
<fileset dir="${tests.dir}/" includes="**/*.js" />
214+
</concat>
215+
</target>
199216

200217
<!-- build for rhino CLI integration -->
201218
<target name="build.rhino" depends="build.core">
202219
<concat destfile="${build.dir}/${rhino.build.file}" fixlastline="true">
203220
<filelist dir="${build.dir}" files="${core.build.file}" />
204221
<filelist dir="${src.dir}/cli" files="common.js,rhino.js" />
205222
</concat>
206-
</target>
207-
223+
</target>
224+
208225
<!-- build for WSH CLI integration -->
209226
<target name="build.wsh" depends="build.core">
210227
<concat destfile="${build.dir}/${wsh.build.file}" fixlastline="true">
211228
<filelist dir="${build.dir}" files="${core.build.file}" />
212229
<filelist dir="${src.dir}/cli" files="common.js,wsh.js" />
213230
</concat>
214-
</target>
215-
231+
</target>
232+
216233
<!-- Create a release with version number embedded -->
217234
<target name="release" depends="test,build.all,changelog.update">
218235
<delete dir="${release.dir}" />
@@ -222,20 +239,20 @@
222239
</copy>
223240
<replaceregexp match="@VERSION@" replace="${csslint.version}" flags="g" byline="true">
224241
<fileset dir="${release.dir}" includes="**/*"/>
225-
</replaceregexp>
242+
</replaceregexp>
226243
</target>
227-
244+
228245
<!-- Update CSS parser with the latest -->
229246
<target name="parser.update">
230247
<get src="${parser.url}" dest="${lib.dir}/${parserlib.js}" />
231248
</target>
232-
249+
233250
<!-- Update JSHint with the latest -->
234251
<target name="jshint.update">
235252
<get src="${jshint-rhino.url}" dest="${lib.dir}/" />
236253
<get src="${jshint.url}" dest="${lib.dir}/" />
237254
</target>
238-
255+
239256
<!-- Build all files -->
240257
<target name="build.all" depends="clean,build.core,build.worker,build.node,build.tests,build.rhino,build.wsh"/>
241258

0 commit comments

Comments
 (0)