forked from moxiecode/plupload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
138 lines (121 loc) · 6.01 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
<?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.*" />
<exclude name="gears_init.js" />
<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" excludes="gears_init.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="build">
<!-- 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.min.js" />
<yuicompress infile="src/javascript/jquery.plupload.queue.js" outfile="js/jquery.plupload.queue.min.js" />
<yuicompress infile="src/javascript/jquery.ui.plupload.js" outfile="js/jquery.ui.plupload.min.js" />
<yuicompress infile="src/javascript/plupload.js" outfile="js/plupload.min.js" />
<yuicompress infile="src/javascript/plupload.gears.js" outfile="js/plupload.gears.min.js" />
<yuicompress infile="src/javascript/plupload.silverlight.js" outfile="js/plupload.silverlight.min.js" />
<yuicompress infile="src/javascript/plupload.flash.js" outfile="js/plupload.flash.min.js" />
<yuicompress infile="src/javascript/plupload.browserplus.js" outfile="js/plupload.browserplus.min.js" />
<yuicompress infile="src/javascript/plupload.html5.js" outfile="js/plupload.html5.min.js" />
<yuicompress infile="src/javascript/plupload.html4.js" outfile="js/plupload.html4.min.js" />
<delete file="js/plupload.full.tmp.js" quiet="true" />
<copy file="src/javascript/gears_init.js" todir="js" />
</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>
<!-- 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 production 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="tools/**" />
<exclude name="build.xml" />
<exclude name="build.bat" />
<exclude name="tests/**" />
</zipfileset>
</zip>
<!-- 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>
</target>
</project>