forked from moxiecode/plupload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
200 lines (171 loc) · 7.73 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?xml version="1.0" encoding="UTF-8"?>
<project name="Plupload" default="build" basedir=".">
<!-- Properties -->
<property description="Temp directory" name="tmp_dir" value="tmp" />
<!-- Setup classpath for js-build-tools ant tasks -->
<path id="tasks.classpath">
<pathelement location="."/>
<fileset dir="tools/ant">
<include name="**/*.jar"/>
<!-- Exclude jslint since it also has the Rhino API -->
<exclude name="**/jslint4java.jar"/>
</fileset>
</path>
<!-- Task definitions - register new js-build-tools ant tasks -->
<taskdef name="preprocess" classname="com.moxiecode.ant.tasks.PreProcessTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="yuicompress" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="moxiedoc" classname="com.moxiecode.ant.tasks.MoxieDocTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="jslint" classname="com.googlecode.jslint4java.ant.JSLintTask" classpath="tools/ant/jslint4java.jar" />
<!-- Generate JS documentation -->
<target name="moxiedoc" depends="" description="Generates HTML documentation out of js source">
<delete quiet="true">
<fileset dir="docs/api" includes="**/*"/>
</delete>
<mkdir dir="docs" />
<moxiedoc outdir="docs/api" templatedir="tools/templates" msintellisense="docs/api/plupload.vsdoc.js" title="Plupload API">
<fileset dir="src">
<exclude name="jquery.*" />
<include name="javascript/**/*.js" />
</fileset>
</moxiedoc>
</target>
<target name="jslint">
<jslint options="browser,undef,forin">
<formatter type="plain" />
<formatter type="xml" destfile="jslint.xml" />
<fileset dir="src/javascript" includes="*.js" />
</jslint>
</target>
<target name="build-flash">
<exec executable="mxmlc">
<arg value="-compiler.source-path=./src/flash/plupload/src" />
<arg value="-target-player=10.1.0" />
<!-- <arg value="-compiler.debug" /> -->
<arg value="-output=./bin/plupload.flash.swf" />
<arg value="./src/flash/plupload/src/com/plupload/Plupload.as" />
</exec>
</target>
<target name="clean">
<delete quiet="true">
<fileset dir="js" includes="**/*">
<exclude name="plupload.flash.swf"/>
<exclude name="plupload.silverlight.xap"/>
</fileset>
</delete>
</target>
<target name="build-jquery-widgets">
<!-- Copy all jquery.plupload.queue resources -->
<copy todir="js/jquery.plupload.queue">
<fileset dir="src/javascript/jquery.plupload.queue">
<include name="**"/>
</fileset>
</copy>
<!-- Copy all jquery.ui.plupload resources -->
<copy todir="js/jquery.ui.plupload">
<fileset dir="src/javascript/jquery.ui.plupload">
<include name="**"/>
</fileset>
</copy>
<!-- Minify the scripts -->
<yuicompress infile="src/javascript/jquery.plupload.queue/jquery.plupload.queue.js" outfile="js/jquery.plupload.queue/jquery.plupload.queue.js" />
<yuicompress infile="src/javascript/jquery.ui.plupload/jquery.ui.plupload.js" outfile="js/jquery.ui.plupload/jquery.ui.plupload.js" />
</target>
<target name="build" depends="clean,build-jquery-widgets">
<!-- Concat multuple JS files together -->
<concat destfile="js/plupload.full.tmp.js">
<fileset dir="src/javascript" includes="plupload.js" />
<fileset dir="src/javascript" includes="plupload.gears.js" />
<fileset dir="src/javascript" includes="plupload.silverlight.js" />
<fileset dir="src/javascript" includes="plupload.flash.js" />
<fileset dir="src/javascript" includes="plupload.browserplus.js" />
<fileset dir="src/javascript" includes="plupload.html5.js" />
<fileset dir="src/javascript" includes="plupload.html4.js" />
</concat>
<!-- Compress Plupload full and base using the YUI Compressor -->
<yuicompress infile="js/plupload.full.tmp.js" outfile="js/plupload.full.js" />
<yuicompress infile="src/javascript/plupload.js" outfile="js/plupload.js" />
<yuicompress infile="src/javascript/plupload.gears.js" outfile="js/plupload.gears.js" />
<yuicompress infile="src/javascript/plupload.silverlight.js" outfile="js/plupload.silverlight.js" />
<yuicompress infile="src/javascript/plupload.flash.js" outfile="js/plupload.flash.js" />
<yuicompress infile="src/javascript/plupload.browserplus.js" outfile="js/plupload.browserplus.js" />
<yuicompress infile="src/javascript/plupload.html5.js" outfile="js/plupload.html5.js" />
<yuicompress infile="src/javascript/plupload.html4.js" outfile="js/plupload.html4.js" />
<delete file="js/plupload.full.tmp.js" quiet="true" />
</target>
<target name="release" depends="build">
<!-- Copy the current repos and start processing it -->
<delete dir="${tmp_dir}" quiet="true" />
<copy todir="${tmp_dir}/plupload">
<fileset dir=".">
<include name="**"/>
<exclude name="**/.git/**"/>
<exclude name="**/.*"/>
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/tmp/**"/>
<exclude name="**/jslint.xml"/>
</fileset>
</copy>
<copy todir="${tmp_dir}/plupload/js">
<fileset dir="js/">
<include name="plupload.flash.swf"/>
<include name="plupload.silverlight.xap"/>
</fileset>
</copy>
<!-- Parse minor version, major version and release date from changelog -->
<loadfile property="changelog" srcFile="${tmp_dir}/plupload/changelog.txt" />
<propertyregex property="version" input="${changelog}" regexp="^Version ([0-9xabrc.]+)" select="\1" />
<propertyregex property="release_date" input="${changelog}" regexp="^Version [^\(]+\(([^\)]+)\)" select="\1" />
<propertyregex property="file_version" input="${version}" regexp="\." replace="_" />
<!-- Replace major version -->
<replaceregexp byline="true">
<regexp pattern="@@version@@" />
<substitution expression="${version}" />
<fileset dir="${tmp_dir}/plupload/js">
<include name="*/**" />
</fileset>
</replaceregexp>
<!-- Compress dev package -->
<delete file="${tmp_dir}/plupload_${file_version}_dev.zip" quiet="true" />
<zip destfile="${tmp_dir}/plupload_${file_version}_dev.zip">
<zipfileset dir="${tmp_dir}/plupload" prefix="plupload">
<include name="*/**" />
</zipfileset>
</zip>
<!-- Load proper versions of scripts in examples -->
<replaceregexp byline="true">
<regexp pattern="src\/javascript\/" />
<substitution expression="js\/" />
<fileset dir="${tmp_dir}/plupload/examples">
<include name="*/**" />
</fileset>
</replaceregexp>
<!-- Compress core package -->
<delete file="${tmp_dir}/plupload_${file_version}.zip" quiet="true" />
<zip destfile="${tmp_dir}/plupload_${file_version}.zip">
<zipfileset dir="${tmp_dir}/plupload" prefix="plupload">
<include name="*/**" />
<!-- <exclude name="examples/jquery/**" /> -->
<exclude name="src/**" />
<!-- <exclude name="js/jquery*/**" /> -->
<exclude name="tools/**" />
<exclude name="build.xml" />
<exclude name="build.bat" />
<exclude name="tests/**" />
</zipfileset>
</zip>
<!-- Compress jQuery package -->
<!--<delete file="${tmp_dir}/plupload_${file_version}_jquery.zip" quiet="true" />
<zip destfile="${tmp_dir}/plupload_${file_version}_jquery.zip">
<zipfileset dir="${tmp_dir}/plupload" prefix="plupload">
<include name="*/**" />
<exclude name="src/**" />
<exclude name="tools/**" />
<exclude name="build.xml" />
<exclude name="build.bat" />
<exclude name="tests/**" />
</zipfileset>
</zip>-->
</target>
</project>