-
Notifications
You must be signed in to change notification settings - Fork 662
/
build.xml
81 lines (70 loc) · 3.53 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="wet-boew.core" default="default" basedir=".">
<description>Web Experience Toolkit Core Framework</description>
<property file="build.properties"/>
<import file="${build.dir}/../build-tasks.xml"/>
<!--I18nMergeTask -->
<path id="wet-boew-anttasks.classpath">
<pathelement location="${wet-boew-anttasks.jar}" />
<pathelement location="${opencsv.jar}" />
</path>
<taskdef name="I18nMergeTask" classname="org.wet_boew.wet_boew.ant.I18nMergeTask">
<classpath refid="wet-boew-anttasks.classpath" />
</taskdef>
<target name="default" depends="clean,build" description="Performs a clean and build when calling ant without any target"/>
<target name="copy-all" extensionOf="prepare-files" depends="-copy-css,-copy-images,-copy-js,-build-flot,-build-pe,-copy-binaries"/>
<target name="-copy-binaries">
<copy todir="${dist.dir}">
<fileset dir="${src.dir}">
<include name="binary/**"/>
</fileset>
</copy>
</target>
<fileset id="jsfiles" dir="${src.dir}">
<include name="**/*.js"/>
<exclude name="workers/**"/>
<exclude name="pe-ap.js"/>
<exclude name="i18n/base.js"/>
<exclude name="dependencies/flot*.js"/>
</fileset>
<!-- Build JS Tasks -->
<target name="-build-pe" depends="-build-i18n">
<concat dest="${dist.dir}/pe-ap.js" fixlastline="yes">
<file file="${src.dir}/pe-ap.js"/>
<fileset dir="${src.dir}/workers" includes="**/**.js" />
<filterchain>
<replacetokens>
<token key="wet-boew-build.languagelist" value="${languagelist}"/>
<token key="wet-boew-build.validlanguagelist" value="${validlanguagelist}"/>
<token key="wet-boew-build.validlanguagemethod" value="${validlanguagemethod}"/>
</replacetokens>
</filterchain>
</concat>
<!-- Temporary fix - to be replaced by modern and old IE targeted output -->
<copy file="${dist.dir}/pe-ap.js" tofile="${dist.dir}/pe-ap-ie.js" encoding="UTF-8"/>
</target>
<target name="-build-flot" description="Concat flot and any plugins into single file. Done for gh-1276">
<concat dest="${dist.dir}/dependencies/flot.js" fixlastline="yes">
<fileset dir="${src.dir}/dependencies" includes="flot*.js" />
</concat>
</target>
<target name="-build-i18n" depends="-get-validation-languages">
<I18nMergeTask i18nfile="${src.dir}/i18n/i18n.csv" templatefile="${src.dir}/i18n/base.js" languagelistproperty="languagelist" languagelistseparator="','" outdir="${dist.dir}/i18n" />
<echo message="Supported core languages: '${languagelist}'" level="info"/>
<echo message="Supported jQuery validation languages: '${validlanguagelist}'" level="info"/>
</target>
<target name="-get-validation-languages">
<fileset id="validlanguages" dir="${src.dir}/i18n/formvalid" includes="messages_*.js"/>
<pathconvert pathsep="','" property="validlanguagelist" refid="validlanguages">
<globmapper from="${basedir}${file.separator}i18n${file.separator}formvalid${file.separator}messages_*.js" to="*" />
</pathconvert>
<fileset id="validlanguagesmethod" dir="${src.dir}/i18n/formvalid" includes="methods_*.js"/>
<pathconvert pathsep="','" property="validlanguagemethod" refid="validlanguagesmethod">
<globmapper from="${basedir}${file.separator}i18n${file.separator}formvalid${file.separator}methods_*.js" to="*" />
</pathconvert>
</target>
<target name="fix-spanish-character" extensionOf="compress" depends="-minify">
<!-- Hack to fix http://yuilibrary.com/projects/yuicompressor/ticket/2528132 -->
<replace file="${dist.dir}/i18n/es-min.js" encoding="UTF-8" token="�?" value="Í" />
</target>
</project>