-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathbuild.xml
213 lines (186 loc) · 8.34 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
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0"?>
<!--+
+ iUI Ant Buildfile
+ http://code.google.com/p/iui
+
+ For help, open a command-line window and set yoru current directory to
+ the iui project root. Then type "ant -p" for help...
+
+ Copyright (c) 2007-2014, iUI Project Members
+ See LICENSE.txt for licensing terms
+
+-->
<project name="iui" default="releasedir" basedir=".">
<description>
Build file for iUI distributions
Targets marked with an "*" (asterisk) are useful when you have local modifications to iUI
Targets marked with an "r" are typically used only by the iUI team for building releases
To run a target type "ant [targetname]"
</description>
<!-- If you wish to override build settings, create a file called local.build.properties in
The project root. Git is configured to ignore this file, so it won't accidentally be
checked in. Note that in Ant, whatever sets a property first "wins". -->
<property file="local.build.properties" />
<loadproperties srcFile="build.properties" /> <!-- Required -->
<!-- If version undefined at this point, use a timestamp -->
<tstamp />
<!-- <property name="iui.version" value="v${DSTAMP}-${TSTAMP}" /> -->
<property name="iui.version" value="v${DSTAMP}" />
<property name="iui.release.summary" value="Release summary goes here" />
<property name="iui.dash.vers" value="iui-${iui.version}" />
<property name="tarfilename" value="${iui.dash.vers}.tar.gz" />
<property name="zipfilename" value="${iui.dash.vers}.zip" />
<property name="src.dir.webapp" location="web-app" />
<property name="src.dir.iui" location="${src.dir.webapp}/iui" />
<property name="target.dir" location="target" />
<property name="release.dir" location="${target.dir}/${iui.dash.vers}" />
<property name="release.dir.webapp" location="${target.dir}/${iui.dash.vers}/web-app" />
<property name="tarfile" location="${target.dir}/${tarfilename}" />
<property name="zipfile" location="${target.dir}/${zipfilename}" />
<path id="compress-js.path">
<fileset dir="releasetools/lib">
<include name="compress-js.jar"/>
<include name="custom_rhino_from_lcasoft.jar"/>
</fileset>
</path>
<path id="yui-compressor.path">
<fileset dir="releasetools/lib">
<include name="yuicompressor-2.2.5.jar"/>
<include name="yui-rhino-1.6R7.jar"/>
<include name="yui-jargs-1.0.jar"/>
</fileset>
</path>
<path id="ant-googlecode.path">
<fileset dir="releasetools/lib">
<include name="ant-googlecode-0.0.0test.jar"/>
</fileset>
</path>
<!-- Define extension Ant tasks that aren't part of the standard Ant distro -->
<taskdef name="compress-js" classname="com.webpanes.tools.ant.taskdefs.CompressJS"
classpathref="compress-js.path" />
<taskdef name="GoogleCodeUploadTask" classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
classpathref="ant-googlecode.path" />
<!-- Ant targets, use "ant -p" for easier reading of the "description" attributes -->
<target name="setup">
<echo message="Building iUI with ${ant.version} on JVM version ${ant.java.version}..." />
</target>
<target name="compress-js" depends="docopy" description="* - Create iuix.js by compressing iui.js">
<mkdir dir="${release.dir}" />
<compress-js file="${src.dir.iui}/iui.js"
tofile="${release.dir.webapp}/iui/iuix.js"
stripCR="true" />
<!-- TODO: Compress/Concat extensions & optional files -->
</target>
<!-- Compress CSS using Yahoo YUI Compressor -->
<target name="compress-css" depends="docopy" description="* - Create iuix.css by compressing iui.css">
<java jar="releasetools/lib/yuicompressor-2.2.5.jar" fork="true" classpathref="yui-compressor.path">
<arg value="--type"/>
<arg value="css"/>
<arg value="${src.dir.iui}/iui.css" />
<arg value="-o"/>
<arg value="${release.dir.webapp}/iui/iuix.css"/>
</java>
<!-- TODO: Compress/Concat themes & extensions -->
</target>
<target name="docopy" depends="setup" description="* - Copy Files to release directory">
<mkdir dir="${release.dir.webapp}/iui"/>
<!-- Copy subset of files of project root to release root -->
<copy todir="${release.dir}">
<fileset dir="${basedir}">
<include name="*.txt"/>
</fileset>
</copy>
<!-- Copy iUI *.js and *.css, using a filter to replace @VERSION@ with the value of iui.version -->
<copy todir="${release.dir.webapp}">
<fileset dir="${src.dir.webapp}" includes="**/*.js, **/*.css" excludes="main.js"/>
<filterset>
<filter token="VERSION" value="${iui.version}"/>
</filterset>
</copy>
<!-- Copy everything else (except .jar files) without filtering -->
<copy todir="${release.dir.webapp}">
<fileset dir="${src.dir.webapp}" excludes="**/*.js, **/*.css, **/*.jar, package.json, WEB-INF/**" />
</copy>
<!-- Make second copy of sample.html in samplex.html that uses iuix.css and iuix.js -->
<!-- Disable for now...
<copy todir="${release.dir}/samples">
<fileset dir="samples">
<include name="*.html"/>
</fileset>
<globmapper from="*.html" to="*x.html"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="../iui/iui.css" replace="../iui/iuix.css" flags="g"/>
<replaceregex pattern="../iui/iui.js" replace="../iui/iuix.js" flags="g"/>
</tokenfilter>
</filterchain>
</copy>
-->
</target>
<target name="releasedir" depends="compress-js, compress-css" description="* - Build releasedir (all tasks)">
</target>
<target name="iui-clean" depends="setup" description="* - Remove all generated files">
<echo message="Deleting ${target.dir}" />
<delete dir="${target.dir}" />
</target>
<target name="iui-tarball" depends="releasedir" description="r - Make the tarball">
<mkdir dir="${release.dir}"/>
<tar basedir="${target.dir}" includes="${iui.dash.vers}/**" destfile="${tarfile}" compression="gzip" longfile="gnu" />
</target>
<target name="iui-zipfile" depends="releasedir" description="r - Make the zipfile">
<mkdir dir="${release.dir}"/>
<zip basedir="${target.dir}" includes="${iui.dash.vers}/**" destfile="${zipfile}" />
</target>
<target name="iui-release" depends="iui-zipfile"
description="r - Upload to download area of project site, requires Ant 1.7">
<echo message="Uploading using username ${gc.username}..." />
<GoogleCodeUploadTask
userName="${gc.username}"
password="${gc.password}"
projectName="iui"
filename="${zipfile}"
targetFileName="${zipfilename}"
summary="${iui.release.summary}"/>
</target>
<target name="update-codedoc" description="r - update doc from in-code comments">
<exec executable="python">
<arg value="docs-src/refresh_docs.py"/>
</exec>
</target>
<!--
<target name="publish-samples" depends="releasedir" description="r - publish sample apps via SSH">
<scp verbose="true" todir="${sample-server.ssh.user}:${sample-server.ssh.password}@${sample-server.ssh.host}:${sample-server.ssh.path}">
<fileset dir="${release.dir}"/>
</scp>
</target>
<target name="install-myproj" depends="releasedir" description="* - Install iUI into YOUR local project">
<mkdir dir="${myproj.dir.scripts}"/>
<mkdir dir="${myproj.dir.styles}"/>
<mkdir dir="${myproj.dir.images}"/>
<copy todir="${myproj.dir.styles}">
<fileset dir="${release.dir}/iui">
<include name="iui.css" if="myproj.copy-uncompressed"/>
<include name="iuix.css" if="myproj.copy-compressed"/>
</fileset>
<filterchain>
<tokenfilter>
<!-+- Adjust image urls in the CSS file to use ${myproj.image.path} -+->
<replaceregex pattern="url\(([^.]*)\.(png|gif)\)" replace="url\(${myproj.image.path}\1.\2\)" flags="g"/>
</tokenfilter>
</filterchain>
</copy>
<copy todir="${myproj.dir.scripts}">
<fileset dir="${release.dir}/iui">
<include name="iui.js" if="myproj.copy-uncompressed"/>
<include name="iuix.js" if="myproj.copy-compressed"/>
</fileset>
</copy>
<copy todir="${myproj.dir.images}">
<fileset dir="${release.dir}/iui">
<include name="*.png"/>
<include name="*.gif"/>
</fileset>
</copy>
</target>
-->
</project>