]> git.proxmox.com Git - extjs.git/blob - extjs/examples/kitchensink/.sencha/app/phonegap-impl.xml
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / kitchensink / .sencha / app / phonegap-impl.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="PhoneGap" default="phonegap-help">
3 <!--Legacy properties file support-->
4 <property file="${app.dir}/phonegap.local.properties"/>
5
6 <!--Init for All PhoneGap Tasks-->
7 <target name="-before-phonegap-init"/>
8 <target name="-phonegap-init">
9 <if>
10 <or>
11 <x-is-true value="${args.emulate}"/>
12 <x-is-true value="${args.autorun}"/>
13 </or>
14 <then>
15 <property name="phonegap.skip.build" value="true"/>
16 </then>
17 </if>
18
19 <!--Check for verbose output config from the user-->
20 <if>
21 <x-is-true value="app.phonegap.config.verbose"/>
22 <then>
23 <property name="phonegap.cli.options" value="-d"/>
24 </then>
25 <else>
26 <property name="phonegap.cli.options" value=""/>
27 </else>
28 </if>
29 </target>
30 <target name="-after-phonegap-init"/>
31 <target name="phonegap-init"
32 depends="-init, -before-phonegap-init, -phonegap-init, -after-phonegap-init"/>
33
34 <!--Default target outputs help information-->
35 <target name="phonegap-help"/>
36
37 <!-- Create Phonegap Application-->
38 <target name="phonegap-create" depends="phonegap-init">
39 <if>
40 <not>
41 <available file="${app.phonegap.config.path}" type="dir"/>
42 </not>
43 <then>
44 <phonegap-echo message="Creating Phonegap Application with ID &quot;${app.phonegap.config.id}&quot; and Name &quot;${app.phonegap.config.name}&quot;"/>
45 <x-shell reloadprofile="true" dir="${app.dir}">
46 phonegap ${phonegap.cli.options} create "${app.phonegap.config.path}" ${app.phonegap.config.id} ${app.phonegap.config.name}
47 </x-shell>
48 <!--
49 Phonegap puts config.xml in the www root folder, this is dangerous due to how we clean this folder out
50 we will move it up to the phonegap root in order to keep parity with cordova.
51 Later we will copy this file back into www during remote builds
52 -->
53 <move file="${build.out.base.path}/config.xml" todir="${app.phonegap.config.path}" failonerror="false" overwrite="false" />
54 </then>
55 </if>
56 </target>
57
58 <!-- Prepares application for specified platform -->
59 <target name="-before-phonegap-prepare"/>
60 <target name="-phonegap-prepare" if="args.prepare">
61 <fail status="0" message="Phonegap does not currently support prepare command, if this is required for your workflow please try Apache Cordova "/>
62 </target>
63 <target name="-after-phonegap-prepare"/>
64 <target name="phonegap-prepare" depends="phonegap-init, -before-phonegap-prepare, -phonegap-prepare, -after-phonegap-prepare"/>
65
66 <!-- Emulates application for the specified platform -->
67 <target name="-before-phonegap-emulate"/>
68 <target name="-phonegap-emulate" depends="-phonegap-check-platform, -phonegap-check-config-xml" if="args.emulate">
69 <if>
70 <x-is-true value="${phonegap.build.remote}"/>
71 <then>
72 <x-ant-call target="-phonegap-remote-emulate"/>
73 </then>
74 <else>
75 <x-ant-call target="-phonegap-local-emulate"/>
76 </else>
77 </if>
78 </target>
79 <target name="-after-phonegap-emulate"/>
80 <target name="phonegap-emulate" depends="phonegap-init, -before-phonegap-emulate, -phonegap-emulate, -after-phonegap-emulate"/>
81
82
83 <!-- Runs application on a device for the specified platform -->
84 <target name="-before-phonegap-run"/>
85 <target name="-phonegap-run" depends="-phonegap-check-platform, -phonegap-check-config-xml" if="args.autorun">
86 <if>
87 <x-is-true value="${phonegap.build.remote}"/>
88 <then>
89 <x-ant-call target="-phonegap-remote-run"/>
90 </then>
91 <else>
92 <x-ant-call target="-phonegap-local-run"/>
93 </else>
94 </if>
95 </target>
96 <target name="-after-phonegap-run"/>
97 <target name="phonegap-run" depends="phonegap-init, -before-phonegap-run, -phonegap-run, -after-phonegap-run"/>
98
99
100 <!-- Overall Phonegap Build Target. Determines type of build to use -->
101 <target name="-before-phonegap-build"/>
102 <target name="-phonegap-build" depends="-phonegap-check-platform, -phonegap-check-config-xml" unless="phonegap.skip.build">
103 <if>
104 <x-is-true value="${phonegap.build.remote}"/>
105 <then>
106 <x-ant-call target="-phonegap-remote-build"/>
107 </then>
108 <else>
109 <x-ant-call target="-phonegap-local-build"/>
110 </else>
111 </if>
112 </target>
113 <target name="-after-phonegap-build"/>
114 <target name="phonegap-build" depends="phonegap-init, -before-phonegap-build, -phonegap-build, -after-phonegap-build" />
115
116 <!-- Private Utility Target to make sure users have declared a platform to take action on -->
117 <target name="-phonegap-check-platform">
118 <fail status="0" message="No platforms were specified, add a platform to ${build.name}'s -> phonegap -> config -> platform property in app.json">
119 <condition>
120 <or>
121 <not>
122 <isset property="phonegap.platform"/>
123 </not>
124 <contains string="${phonegap.platform}" substring="$"/>
125 </or>
126 </condition>
127 </fail>
128
129
130
131 </target>
132
133 <!-- Private Utility target to copy the config.xml file back into the WWW folder -->
134 <target name="-phonegap-check-config-xml">
135 <copy todir="${build.out.base.path}" file="${app.phonegap.config.path}/config.xml" failonerror="false" overwrite="true" quiet="true"/>
136 </target>
137
138 <!-- Private Remote Build Targets-->
139 <target name="-phonegap-remote-login">
140 <phonegap-echo message="Attempting login to PhoneGap Build"/>
141 <if>
142 <not>
143 <and>
144 <isset property="phonegap.build.remote.username"/>
145 <isset property="phonegap.build.remote.password"/>
146 </and>
147 </not>
148 <then>
149 <phonegap-echo level="warning">
150 Phonegap Build login credentials were was not found. If you have not logged in prior to running this command.
151 Please either login via &quot;phonegap remote login&quot; or edit your [APP_ROOT]/local.properties and set &quot;phonegap.username&quot; and &quot;phonegap.password&quot; appropriately
152 </phonegap-echo>
153 </then>
154 </if>
155
156 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
157 phonegap ${phonegap.cli.options} remote login --username="${phonegap.build.remote.username}" --password="${phonegap.build.remote.password}"
158 </x-shell>
159 </target>
160
161 <target name="-phonegap-remote-build" depends="-phonegap-remote-login">
162 <phonegap-echo message="Attempting PhoneGap remote build for ${phonegap.platform}"/>
163 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
164 phonegap ${phonegap.cli.options} remote build ${phonegap.platform}
165 </x-shell>
166 </target>
167
168 <target name="-phonegap-remote-run" depends="-phonegap-remote-login">
169 <phonegap-echo message="Attempting PhoneGap remote run for ${phonegap.platform}"/>
170 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
171 phonegap ${phonegap.cli.options} remote run ${phonegap.platform}
172 </x-shell>
173 </target>
174
175 <target name="-phonegap-remote-emulate" depends="-phonegap-remote-login">
176 <phonegap-echo message="Attempting PhoneGap remote emulate for ${phonegap.platform}"/>
177 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
178 phonegap ${phonegap.cli.options} remote run ${phonegap.platform} --emulator
179 </x-shell>
180 </target>
181
182 <!-- Private Local Build Targets-->
183 <target name="-phonegap-local-build">
184 <phonegap-echo message="Attempting PhoneGap local build for ${phonegap.platform}"/>
185 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
186 phonegap ${phonegap.cli.options} local build ${phonegap.platform}
187 </x-shell>
188 </target>
189
190 <target name="-phonegap-local-run">
191 <phonegap-echo message="Attempting PhoneGap local run for ${phonegap.platform}"/>
192 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
193 phonegap ${phonegap.cli.options} local run ${phonegap.platform}
194 </x-shell>
195 </target>
196
197 <target name="-phonegap-local-emulate">
198 <phonegap-echo message="Attempting PhoneGap local emulate for ${phonegap.platform}"/>
199 <x-shell reloadprofile="true" dir="${app.phonegap.config.path}">
200 phonegap ${phonegap.cli.options} local run ${phonegap.platform} --emulator
201 </x-shell>
202 </target>
203
204 <!-- Internal Packager Hooks -->
205 <target name="-before-phonegap-init-native-package"/>
206 <target name="-phonegap-init-native-package" depends="phonegap-init, phonegap-create"/>
207 <target name="-after-phonegap-init-native-package"/>
208 <target name="phonegap-init-native-package" depends="-before-phonegap-init-native-package, -phonegap-init-native-package, -after-phonegap-init-native-package"/>
209
210 <target name="-before-phonegap-native-package"/>
211 <target name="-phonegap-native-package" depends="phonegap-build, phonegap-emulate, phonegap-run"/>
212 <target name="-after-phonegap-native-package"/>
213 <target name="phonegap-native-package" depends="phonegap-init, -before-phonegap-native-package, -phonegap-native-package, -after-phonegap-native-package"/>
214
215 <macrodef name="phonegap-echo">
216 <text name="text" optional="true"/>
217 <attribute name="message" default=""/>
218 <attribute name="level" default="info"/>
219 <sequential>
220 <if>
221 <equals arg1="@{message}" arg2=""/>
222 <then>
223 <x-echo message="[Phonegap] @{text}" level="@{level}"/>
224 </then>
225 <else>
226 <x-echo message="[Phonegap] @{message}" level="@{level}"/>
227 </else>
228 </if>
229 </sequential>
230 </macrodef>
231 </project>