forked from gardenofwine/Open-Knesset-Mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
208 lines (167 loc) · 6.62 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Open Knesset" default="development" basedir=".">
<property name="GoogleClosureDir" value="compiler-latest"/>
<property name="concat.dir" value="temp/www"/>
<property name="source.web.dir" value="src/web/www"/>
<property name="target.web.dir" value="target/web/www/"/>
<property name="xcodeWWWDir" value="native/iOS/OKnesset/www"/>
<property name="androidWWWDir" value="native/Android/OKnesset/assets/www"/>
<target name="buildweb">
<delete dir="${target.web.dir}"/>
<copy todir="${target.web.dir}">
<fileset dir="${source.web.dir}">
<include name="**"/>
</fileset>
</copy>
</target>
<target name="customize">
<copy todir="target/${channel.dir}/www">
<fileset dir="${source.web.dir}">
<include name="**"/>
</fileset>
</copy>
<copy todir="target/${channel.dir}/www" overwrite="true">
<fileset dir="src/${channel.dir}/www">
<include name="**"/>
</fileset>
</copy>
</target>
<target name="buildProd">
<!-- Copy all files except javascripts files that need concatenation -->
<copy todir="target_prod/${channel.dir}/www">
<fileset dir="target/${channel.dir}/www">
<exclude name="**/*.js"/>
<exclude name="index*.html"/>
</fileset>
</copy>
<copy todir="target_prod/${channel.dir}/www">
<fileset dir="target/${channel.dir}/www">
<include name="javascripts/createInitialData.js"/>
</fileset>
</copy>
<!-- copy all javascript files to a temp dir for concatenation -->
<copy todir="${concat.dir}" overwrite="true">
<fileset dir="target/${channel.dir}/www/">
<include name="**/*.js"/>
</fileset>
</copy>
<!-- concatenate the javascript files -->
<concat destfile="${concat.dir}/concat.js">
<filelist refid="essentialConcatFiles"/>
<fileset refid="concatFiles"/>
</concat>
<echo message="Minifying ${channel.dir}"/>
<!-- minify concatenated file -->
<java jar="${GoogleClosureDir}/compiler.jar" fork="true">
<arg line="--js ${concat.dir}/concat.js --compilation_level WHITESPACE_ONLY --jscomp_off=internetExplorerChecks --js_output_file target_prod/${channel.dir}/www/javascripts/concat.min.js"/>
</java>
<!-- delete temp directory -->
<delete dir="${concat.dir}"/>
<!-- copy index-prod.html file -->
<copy file="target/${channel.dir}/www/index-prod.html" tofile="target_prod/${channel.dir}/www/index.html"/>
</target>
<target name="copyToXcode">
<delete dir="${xcodeWWWDir}"/>
<copy todir="${xcodeWWWDir}">
<fileset dir="${source.dir}">
<include name="**"/>
</fileset>
</copy>
</target>
<target name="copyToAndroid">
<delete dir="${androidWWWDir}"/>
<copy todir="${androidWWWDir}">
<fileset dir="${source.dir}">
<include name="**"/>
</fileset>
</copy>
</target>
<target name="development">
<antcall target="setup"/>
<antcall target="copyToXcode">
<param name="source.dir" value="target/ios/www"/>
</antcall>
<antcall target="copyToAndroid">
<param name="source.dir" value="target/android/www"/>
</antcall>
<set.timestamp/>
<echo message="build complete at ${current.time}"/>
</target>
<target name="production">
<antcall target="setup"/>
<antcall target="buildProd">
<param name="channel.dir" value="ios"/>
</antcall>
<antcall target="copyToXcode">
<param name="source.dir" value="target_prod/ios/www"/>
</antcall>
<antcall target="buildProd">
<param name="channel.dir" value="android"/>
</antcall>
<antcall target="copyToAndroid">
<param name="source.dir" value="target_prod/android/www"/>
</antcall>
<set.timestamp/>
<echo message="build complete at ${current.time}"/>
</target>
<patternset id="appFiles">
<include name="**/*.js"/>
<exclude name="**/debug.js"/>
<exclude name="**/time.js"/>
<exclude name="phonegap-1.0.0*.js"/>
<exclude name="sencha-touch/sencha-touch.js"/>
<exclude name="sencha-touch/sencha-touch-fixes.js"/>
<exclude name="customization.js"/>
<exclude name="views/disclaimer.js"/>
<exclude name="views/memberPanel.js"/>
<exclude name="utils.js"/>
<exclude name="index.js"/>
<exclude name="private.js"/>
<exclude name="models/strings.js"/>
<exclude name="models/slimData.js"/>
<exclude name="models/data.js"/>
</patternset>
<filelist id="essentialConcatFiles" dir="${concat.dir}/javascripts">
<file name="phonegap-1.0.0.js"/>
<file name="sencha-touch/sencha-touch.js"/>
<file name="sencha-touch/sencha-touch-fixes.js"/>
<file name="customization.js"/>
<file name="views/disclaimer.js"/>
<file name="views/memberPanel.js"/>
<file name="utils.js"/>
<file name="index.js"/>
<file name="private.js"/>
<file name="models/strings.js"/>
<file name="models/slimData.js"/>
<file name="models/data.js"/>
</filelist>
<fileset id="concatFiles" dir="${concat.dir}/javascripts">
<patternset refid="appFiles"/>
</fileset>
<target name="setup">
<defaultexcludes add="**/.settings"/>
<defaultexcludes add="**/.settings/**"/>
<defaultexcludes add="**/.git"/>
<defaultexcludes add="**/.git/**"/>
<defaultexcludes add=".project"/>
<defaultexcludes add=".gitignore"/>
<defaultexcludes add=".rockstarapps"/>
<defaultexcludes add=".DS_Store"/>
<defaultexcludes add="createInitialData.html"/>
<defaultexcludes add="sencha-touch/sencha-touch-debug-w-comments.js"/>
<antcall target="buildweb"/>
<antcall target="customize">
<param name="channel.dir" value="ios"/>
</antcall>
<antcall target="customize">
<param name="channel.dir" value="android"/>
</antcall>
</target>
<macrodef name="set.timestamp">
<sequential>
<tstamp>
<format property="current.time" pattern="MM/dd/yyyy hh:mm"/>
</tstamp>
</sequential>
</macrodef>
</project>