Now loads the cordoba-plugin-file if needed.

Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b7021112
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b7021112
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b7021112

Branch: refs/heads/refactor-sprite
Commit: b7021112344aee4de354f25f3abc4bae4e381def
Parents: 3292ce3
Author: Peter Ent <p...@apache.org>
Authored: Wed Oct 19 16:44:45 2016 -0400
Committer: Peter Ent <p...@apache.org>
Committed: Wed Oct 19 16:44:45 2016 -0400

----------------------------------------------------------------------
 cordova-build.xml | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b7021112/cordova-build.xml
----------------------------------------------------------------------
diff --git a/cordova-build.xml b/cordova-build.xml
index 707e61a..1f78da8 100644
--- a/cordova-build.xml
+++ b/cordova-build.xml
@@ -139,7 +139,21 @@
        Running the app on the platform
     -->
     
-    <target name="run.android" description="Runs the Cordova application on 
the specified platform">
+    <target name="check-fileplugin">
+       <property name="storage.file" 
value="${projectdir}/bin/js-debug/org/apache/flex/storage/IPermanentStorage.js" 
/>
+       <available file="${storage.file}" type="file" 
property="file.plugin.needed" />
+    </target>
+    
+    <target name="load-fileplugin" depends="check-fileplugin" 
if="file.plugin.needed">
+       <echo message="Loading cordova file-plugin" />
+       <exec executable="cordova" dir="${cordova.target.dir}">
+               <arg value="plugin" />
+               <arg value="add" />
+               <arg value="cordova-plugin-file" />
+       </exec>
+       </target>
+    
+    <target name="run.android" depends="load-fileplugin" description="Runs the 
Cordova application on the specified platform">
        <echo message="Launching ${appname} on platform ${platform.android}" />
        <exec executable="cordova" dir="${cordova.target.dir}">
                <arg value="run" />
@@ -147,7 +161,7 @@
        </exec>
     </target>
     
-    <target name="run.ios" description="Runs the Cordova application on the 
specified platform">
+    <target name="run.ios" depends="load-fileplugin" description="Runs the 
Cordova application on the specified platform">
        <echo message="Launching ${appname} on platform ${platform.ios}" />
        <exec executable="cordova" dir="${cordova.target.dir}">
                <arg value="run" />

Reply via email to