forked from citrix-research/js-signals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
108 lines (82 loc) · 3.6 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
101
102
103
104
105
106
107
108
<?xml version="1.0" encoding="utf-8"?>
<project name="js-signals" default="" basedir=".">
<!-- properties -->
<property file="build/build.properties" />
<!-- custom tasks -->
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="${closure_compiler.jar}"/>
<!-- targets -->
<target name="-purgeJsDeploy">
<delete>
<fileset dir="${dist.dir}" includes="${dist.name} ${dist.min.name}" />
</delete>
</target>
<target name="compile" depends="-purgeJsDeploy">
<echo message="Building ${dist.name}..." />
<buildnumber file="${build.dir}/build.number"/>
<tstamp>
<format property="build.date" pattern="yyyy/MM/dd hh:mm aa" unit="hour"/>
</tstamp>
<loadfile property="license.txt" srcFile="${src.dir}/license.txt"/>
<loadfile property="SignalBinding.js" srcFile="${src.dir}/SignalBinding.js"/>
<loadfile property="Signal.js" srcFile="${src.dir}/Signal.js"/>
<copy file="${src.dir}/wrapper.js" tofile="${dist.dir}/${dist.name}" />
<replace>
<fileset dir="${dist.dir}" includes="${dist.name}" />
<replacefilter token="//::LICENSE:://" value="${license.txt}" />
<replacefilter token="//::SIGNAL_BINDING_JS:://" value="${SignalBinding.js}" />
<replacefilter token="//::SIGNAL_JS:://" value="${Signal.js}" />
<!-- version number, build number/date should come after other replaces -->
<replacefilter token="::VERSION_NUMBER::" value="${version.number}" />
<replacefilter token="::BUILD_NUMBER::" value="${build.number}" />
<replacefilter token="::BUILD_DATE::" value="${build.date}" />
</replace>
<echo message="${dist.name} built." />
</target>
<target name="lint">
<echo message="JSLinting ${dist.name}..."/>
<apply executable="java">
<filelist dir="${dist.dir}">
<file name="${dist.name}"/>
</filelist>
<arg line="-jar"/>
<arg path="${jslint.jar}"/>
</apply>
<echo message="JSLinted ${dist.name}."/>
</target>
<target name="minify">
<echo message="Building ${dist.min.name}..." />
<jscomp compilationLevel="simple" debug="false" output="${dist.dir}/${dist.min.name}">
<externs dir="${build.dir}">
<file name="externs.js"/>
</externs>
<sources dir="${dist.dir}">
<file name="${dist.name}"/>
</sources>
</jscomp>
<echo message="${dist.min.name} built." />
</target>
<target name="-purgeDocs">
<delete dir="${docs.dir}" />
<mkdir dir="${docs.dir}"/>
</target>
<target name="generateDocs" depends="-purgeDocs">
<echo message="Generating documentation" />
<apply executable="java" parallel="false" verbose="true">
<fileset dir="${dist.dir}">
<include name="${dist.name}" />
</fileset>
<arg line="-jar" />
<arg path="${jsdoc-toolkit.dir}/jsrun.jar" />
<arg value="${jsdoc-toolkit.dir}/app/run.js" />
<arg value="-t=${jsdoc-toolkit.dir}/templates/jsdoc-simple" />
<arg value="-d=${docs.dir}" />
</apply>
<echo message="Documentation generated" />
</target>
<target name="build" depends="compile, lint, minify">
<echo message="Build Complete." />
</target>
<target name="deploy" depends="build, generateDocs">
<echo message="Build Complete." />
</target>
</project>