-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
48 lines (37 loc) · 1.45 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="csslint" default="csslint:check-dir">
<!-- ## Properties -->
<property name="csslint.bin" value="${project.basedir}/node_modules/.bin/csslint" />
<property name="csslint.files.dir" value="" />
<property name="csslint.report.dir" value="${project.basedir}/build/logs/csslint" />
<!-- ## Targets -->
<target name="csslint:check-dir"
description="Checks code against CSS Lint.">
<if>
<equals arg1="${csslint.files.dir}" arg2="" />
<then>
<fail message="Please provide a csslint.files.dir property." />
</then>
</if>
<mkdir dir="${csslint.report.dir}" />
<foreach target="csslint:check-file" param="filename" absparam="absfilename">
<fileset dir="${csslint.files.dir}">
<include name="**/*.css" />
<exclude name="**/*.min.css" />
</fileset>
</foreach>
</target>
<target name="csslint:check-file"
description="CSS Lint a single file."
hidden="true">
<exec command="${csslint.bin} --format=junit-xml ${absfilename}"
outputProperty="csslint.report.output" />
<php function="str_replace" returnProperty="csslint.report.filename">
<param value="/" />
<param value="-" />
<param value="${filename}" />
</php>
<append text="${csslint.report.output}"
destFile="${csslint.report.dir}/csslint-${csslint.report.filename}.xml" />
</target>
</project>