forked from vitmalina/w2ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
100 lines (88 loc) · 3.25 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
<project name="w2ui" basedir="." default="build">
<property name="w2ui.version" value="/* w2ui 1.x (c) http://w2ui.com, [email protected] */"/>
<target name="clean">
<delete file="css/w2ui.css"/>
<delete file="css/w2ui.min.css"/>
<delete file="css/w2ui-dark.css"/>
<delete file="css/w2ui-dark.min.css"/>
<delete file="js/w2ui.js"/>
<delete file="js/w2ui.min.js"/>
</target>
<target name="css">
<!-- Compile w2ui.less files -->
<echo message="LESS: src/less/w2ui.less ==> css/w2ui.css"/>
<exec executable="lessc" osfamily="unix">
<arg value="src/less/w2ui.less"/>
<arg value="css/w2ui.css"/>
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="src/less/w2ui.less"/>
<arg value="css/w2ui.css"/>
</exec>
<!-- Minify w2ui.css files -->
<echo message="CleanCSS: /css/w2ui.css ==> /css/w2ui.min.css"/>
<exec executable="cleancss" output="css/w2ui.min.css" osfamily="unix">
<arg value="css/w2ui.css"/>
</exec>
<exec executable="cmd" output="css/w2ui.min.css" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="css/w2ui.css"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${w2ui.version}${line.separator}" flags="s">
<fileset dir="css" includes="w2ui.min.css" />
</replaceregexp>
<!-- Compile w2ui-dark.less files -->
<echo message="LESS: src/less/w2ui-dark.less ==> css/w2ui-dark.css"/>
<exec executable="lessc" osfamily="unix">
<arg value="src/less/w2ui-dark.less"/>
<arg value="css/w2ui-dark.css"/>
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="src/less/w2ui-dark.less"/>
<arg value="css/w2ui-dark.css"/>
</exec>
<!-- Minify w2ui.css files -->
<echo message="CleanCSS: /css/w2ui-dark.css ==> /css/w2ui-dark.min.css"/>
<exec executable="cleancss" output="css/w2ui-dark.min.css" osfamily="unix">
<arg value="css/w2ui-dark.css"/>
</exec>
<exec executable="cmd" output="css/w2ui-dark.min.css" osfamily="windows">
<arg value="/c"/>
<arg value="cleancss"/>
<arg value="css/w2ui-dark.css"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${w2ui.version}${line.separator}" flags="s">
<fileset dir="css" includes="w2ui-dark.min.css" />
</replaceregexp>
</target>
<target name="js">
<echo message="Concatenate JS Files"/>
<concat destfile="js/w2ui.js">
<filelist dir="./src/" files="w2utils.js w2grid.js w2layout.js w2popup.js w2tabs.js w2toolbar.js w2sidebar.js w2fields.js w2form.js"/>
</concat>
<!-- Minify JS files -->
<echo message="Uglify-JS: /js/w2ui.js ==> /js/w2ui.min.js"/>
<exec executable="uglifyjs" output="js/w2ui.min.js" osfamily="unix">
<arg value="js/w2ui.js"/>
</exec>
<exec executable="cmd" output="js/w2ui.min.js" osfamily="windows">
<arg value="/c"/>
<arg value="uglifyjs"/>
<arg value="js/w2ui.js"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${w2ui.version}${line.separator}" flags="s">
<fileset dir="js" includes="w2ui.min.js" />
</replaceregexp>
</target>
<target name="build" depends="clean,js,css">
<echo message="Wrapping Up"/>
</target>
</project>