Repository navigation
Expand file tree
/
Copy pathbuild.xml
More file actions
205 lines (162 loc) · 6.87 KB
/
Copy pathbuild.xml
File metadata and controls
205 lines (162 loc) · 6.87 KB
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
<?xml version="1.0"?>
<project name="Impact Ant Build" basedir="." default="full-build">
<!-- Change these properties based on your project -->
<!-- Project meta data -->
<property name="project.name" value="Super Jetroid"/>
<property name="company.name" value="Game Cook"/>
<property name="company.site" value="http://gamecook.com"/>
<property name="project.version" value="1.0.0"/>
<property name="project.description" value="Welcome to Super Paper Monster Smasher. It's your turn to finally take over as the monster and smash your way through level after level of good guys all trying to put an end to your evil reign of terror."/>
<!-- Deployment directories -->
<property name="deploy.dir" value="deploy"/>
<property name="web.dir" value="${deploy.dir}/web"/>
<property name="wordpress.dir" value="${deploy.dir}/wordpress"/>
<property name="chrome.dir" value="${deploy.dir}/chrome"/>
<property name="mozilla.dir" value="${deploy.dir}/mozilla"/>
<property name="ios.dir" value="${deploy.dir}/ios"/>
<property name="win8.dir" value="${deploy.dir}/win8"/>
<!-- Path to Impact directory -->
<property name="impact.dir" value="${basedir}"/>
<property name="worpress.path" value="/wp-content/games/play/super-jetroid/media"/>
<target name="full-build">
<!-- Clean -->
<antcall target="pre-build-cleanup"/>
<antcall target="bake"/>
<antcall target="bake-demos"/>
<antcall target="web-build"/>
<antcall target="chrome-build"/>
<antcall target="wordpress-build"/>
<!-- <antcall target="ios-build"/>
<antcall target="mozilla-build"/>
<antcall target="post-build-cleanup"/>-->
<!-- Bake -->
</target>
<!-- Delete deploy directory and create a new one -->
<target name="pre-build-cleanup">
<delete dir="${deploy.dir}"/>
<mkdir dir="${deploy.dir}"/>
</target>
<!-- Removes the minified game from the impact directory-->
<target name="post-build-cleanup">
<delete file="${impact.dir}/js/game.min.js"/>
</target>
<!-- Run the bake script - you need PHP to be runnable from the command line. -->
<target name="bake">
<exec dir="${impact.dir}" executable="php">
<arg value="${impact.dir}/tools/bake.php"/>
<arg value="lib/impact/impact.js"/>
<arg value="lib/game/main.js"/>
<arg value="js/game.min.js"/>
</exec>
</target>
<!-- Run the bake script - you need PHP to be runnable from the command line. -->
<target name="bake-demos">
<exec dir="${impact.dir}" executable="php">
<arg value="${impact.dir}/tools/bake.php"/>
<arg value="lib/impact/impact.js"/>
<arg value="lib/game/main-demos.js"/>
<arg value="js/game-demos.min.js"/>
</exec>
</target>
<target name="web-build">
<copy todir="${web.dir}">
<fileset file="${impact.dir}/index.html"/>
</copy>
<copy todir="${web.dir}">
<fileset file="${impact.dir}/demos.html"/>
</copy>
<copy todir="${web.dir}/lib/impact/debug/">
<fileset file="${impact.dir}/lib/impact/debug/debug.css"/>
</copy>
<copy todir="${web.dir}/js">
<fileset dir="${impact.dir}/js"/>
</copy>
<copy todir="${web.dir}/media">
<fileset dir="${impact.dir}/media"/>
</copy>
<copy todir="${web.dir}/css">
<fileset dir="${impact.dir}/css"/>
</copy>
<!-- replace js source paths in HTML with minified game js. Make sure code is surrounded by "source script" comments so the regex can find it. -->
<replaceregexp file="${web.dir}/index.html"
match="\<!--source scripts--\>(.*?)\<!--end source scripts--\>"
replace="\<script src='js/game.min.js'\>\</script\>" flags="gs">
</replaceregexp>
<!-- This will copy over debug CSS if game is running in debug mode. -->
<!-- replace js source paths in HTML with minified game js. Make sure code is surrounded by "source script" comments so the regex can find it. -->
<replaceregexp file="${web.dir}/demos.html"
match="\<!--source scripts--\>(.*?)\<!--end source scripts--\>"
replace="\<script src='js/game-demos.min.js'\>\</script\>" flags="gs">
</replaceregexp>
<!-- This will copy over debug CSS if game is running in debug mode. -->
</target>
<target name="ios-build">
<!-- copy over files for iOS -->
<sync todir="${ios.dir}">
<fileset dir="${web.dir}">
</fileset>
</sync>
</target>
<target name="wordpress-build">
<!-- Create chrome market app -->
<sync todir="${wordpress.dir}/">
<fileset dir="${web.dir}">
</fileset>
</sync>
<replaceregexp file="${wordpress.dir}/js/game.min.js"
match="media/"
replace="/wp-content/games/super-jetroid/media/" flags="g">
</replaceregexp>
<replaceregexp file="${wordpress.dir}/js/game-demos.min.js"
match="media/"
replace="/wp-content/games/super-jetroid/media/" flags="g">
</replaceregexp>
</target>
<target name="chrome-build">
<!-- Create chrome market app -->
<sync todir="${chrome.dir}/tmp">
<fileset dir="${web.dir}">
</fileset>
</sync>
<copy todir="${chrome.dir}/tmp/images">
<fileset dir="${impact.dir}/images"/>
</copy>
<echo file="${chrome.dir}/tmp/manifest.json" append="false">
{
"name": "${project.name}",
"version": "${project.version}",
"icons": { "16": "images/icons/icon-16x16.png", "48": "images/icons/icon-48x48.png", "128": "images/icons/icon-128x128.png" },
"app": {
"launch": {
"local_path": "index.html"
}
},
"manifest_version": 2
}
</echo>
<zip destfile="${chrome.dir}/${project.name}-${project.version}.zip" basedir="${chrome.dir}/tmp"/>
<delete dir="${chrome.dir}/tmp/"/>
</target>
<target name="mozilla-build">
<!-- Create Mozilla App -->
<sync todir="${mozilla.dir}">
<fileset dir="${web.dir}">
</fileset>
</sync>
<echo file="${mozilla.dir}/manifest.json" append="false">
{
"name":"${project.name}",
"developer": {
"name":"${company.name}",
"url":"${company.site}"
},
"description":"${project.description}",
"icons":{
"16": "/images/icons/icon-16x16.png",
"48": "/images/icons/icon-48x48.png",
"128": "/images/icons/icon-128x128.png"
}
}
</echo>
</target>
</project>