forked from caelum/mamute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
merge-assets.xml
103 lines (81 loc) · 3.66 KB
/
merge-assets.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
<project name="mamute" default="merge-all" basedir="./">
<property name="tmp.dir" value="tmp" />
<property name="webapp.target.dir" value="target/mamute-${mamute.version}/" />
<property name="webapp.dir" value="src/main/webapp/" />
<property name="css.dir" value="${webapp.dir}/css" />
<property name="js.dir" value="${webapp.dir}/js" />
<property name="js.deps.dir" value="${js.dir}/deps/" />
<property name="linebreak" value="1000000" />
<taskdef resource="yuicompressor.tasks" classpath="ant-lib/yuicompressor-taskdef-1.0.jar"/>
<target name="merge-all">
<antcall target="prepare" />
<antcall target="merge-css" />
<antcall target="process-js-deps" />
<antcall target="process-mamute-js" />
<antcall target="merge-all-js" />
<antcall target="merge-jquery-plugins" />
</target>
<target name="prepare">
<mkdir dir="${tmp.dir}"/>
<mkdir dir="${webapp.target.dir}"/>
</target>
<target name="merge-css" depends="">
<echo message="Merging css's..." />
<concat destfile="${webapp.target.dir}/css/all-${timestamp}.css">
<fileset file="${css.dir}/reset.css" />
<fileset file="${css.dir}/deps/*.css"/>
<fileset file="${css.dir}/deps/pickadate/*.css" />
<fileset file="${css.dir}/mamute.css" />
<fileset file="${css.dir}/responsive-mamute.css" />
</concat>
</target>
<target name="process-js-deps" depends="">
<echo message="Merging js deps's..." />
<concat destfile="${tmp.dir}/all-deps.js">
<fileset file="${js.deps.dir}/Markdown.Converter.js"/>
<fileset file="${js.deps.dir}/Markdown.Sanitizer.js"/>
<fileset file="${js.deps.dir}/Markdown.Editor.js"/>
<fileset file="${js.deps.dir}/marked.js"/>
<fileset file="${js.deps.dir}/filepicker.js"/>
</concat>
<echo message="Compressing js deps..." />
<yuicompressor linebreak="${linebreak}" disableOptimizations="true" todir="${tmp.dir}">
<fileset dir="${tmp.dir}" includes="all-deps.js"/>
<mapper type="glob" from="all-deps.js" to="all-deps-min.js"/>
</yuicompressor>
</target>
<target name="process-mamute-js" depends="">
<echo message="Merging mamute js's..." />
<concat destfile="${tmp.dir}/all-mamute.js">
<fileset dir="${js.dir}" includes="*.js"
excludes="mediakit-plugin.js, mediakit.js, all-deps.js, all-deps-min.js, all.js" />
</concat>
<echo message="Compressing mamute js's..." />
<yuicompressor linebreak="${linebreak}" disableOptimizations="true" todir="${tmp.dir}">
<fileset dir="${tmp.dir}" includes="all-mamute.js"/>
<mapper type="glob" from="all-mamute.js" to="all-mamute-min.js"/>
</yuicompressor>
</target>
<target name="merge-all-js" depends="">
<echo message="Merging mamute + deps js's..." />
<concat destfile="${webapp.target.dir}/js/all-${timestamp}.js">
<fileset dir="${tmp.dir}" includes="all-deps-min.js" />
<fileset file="${js.deps.dir}/prettify.js"/>
<fileset dir="${js.deps.dir}" includes="feather.js" />
<fileset dir="${tmp.dir}" includes="all-mamute-min.js" />
</concat>
</target>
<target name="merge-jquery-plugins" depends="">
<echo message="Merging jquery plugins..." />
<mkdir dir="${js.dir}/jquery/"/>
<concat fixlastline="yes" destfile="${webapp.target.dir}/js/jquery/jquery-plugins-${timestamp}.js">
<fileset file="${js.deps.dir}/picker.js"/>
<fileset file="${js.deps.dir}/picker.date.js"/>
<fileset file="${js.deps.dir}/translations/pt_BR.js"/>
<fileset file="${js.deps.dir}/jquery.validate.min.js"/>
<fileset file="${js.deps.dir}/jquery.joyride-2.0.3.js"/>
<fileset file="${js.deps.dir}/diff_match_patch.js"/>
<fileset file="${js.deps.dir}/pretty-text-diff.js"/>
</concat>
</target>
</project>