-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathcompress-js.xml
56 lines (48 loc) · 2.15 KB
/
compress-js.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="compress-js" basedir="." default="compress">
<description>
compress-js
</description>
<property name="src.dir" value="app/resource/js" />
<property name="yuicompressor" value="bin/yuicompressor-2.4.7.jar" />
<!-- 合并文件 -->
<target name="concat" depends="" description="concat code">
<concat destfile="${src.dir}/model-compress.js" encoding="utf-8" fixlastline="on">
<fileset dir="${src.dir}" includes="model.js" />
<fileset dir="${src.dir}" includes="model-dsource.js" />
<fileset dir="${src.dir}" includes="model-dset.js" />
<fileset dir="${src.dir}" includes="model-cube.js" />
</concat>
<concat destfile="${src.dir}/portal-compress.js" encoding="utf-8" fixlastline="on">
<fileset dir="${src.dir}" includes="portal.js" />
<fileset dir="${src.dir}" includes="portal-chart.js" />
<fileset dir="${src.dir}" includes="portal-comp.js" />
<fileset dir="${src.dir}" includes="portal-param.js" />
<fileset dir="${src.dir}" includes="portal-table.js" />
</concat>
<concat destfile="${src.dir}/bireport-compress.js" encoding="utf-8" fixlastline="on">
<fileset dir="${src.dir}" includes="bichart.js" />
<fileset dir="${src.dir}" includes="bidrill.js" />
<fileset dir="${src.dir}" includes="bireport.js" />
<fileset dir="${src.dir}" includes="bitable.js" />
</concat>
</target>
<!-- 压缩文件 -->
<target name="compress" depends="concat">
<apply executable="java" parallel="false" failonerror="true" dest="${src.dir}/" append="false" force="true">
<!--单个文件压缩-->
<fileset dir='${src.dir}/' >
<include name="model-compress.js"/>
<include name="portal-compress.js"/>
<include name="bireport-compress.js"/>
</fileset>
<arg line="-jar" />
<arg path="${yuicompressor}" />
<arg line="--charset utf-8" />
<srcfile />
<arg line="-o" />
<mapper type="glob" from="*.js" to="*.js" />
<targetfile />
</apply>
</target>
</project>