Differences between revisions 6 and 7
Revision 6 as of 2014-02-02 19:14:20
Size: 3611
Editor: jbondc
Comment:
Revision 7 as of 2014-02-02 19:24:00
Size: 3774
Editor: jbondc
Comment:
Deletions are marked like this. Additions are marked like this.
Line 119: Line 119:

  * need a migration path to convert existing 3.x project
    And think about easy upgrade process:
{{{
 cordova info
 cordova upgrade [platform list]
}}}

Cordova configs

  • {$PLATFORM_RUNTIME} is either just "android" (default runtime) or "android.chromeview" (alternative runtime)
  • {$CLI_PROJECT} is the root the cordova cli

Hybrid: {$CLI_PROJECT}/config.xml

<app>
 <!-- default/global configuration of application -->
 <name>Some app</name>
 <version>1.0.1</version>
 <icon></icon>

 
 <!-- platform specific config and/or overrides  -->
 <platform name="ios">
    <version build="2">1.0.1</version>
    <icon id="foo@2x">path</icon>    
 </platform>

 <platform name="android">
    <version release="1.0.0" .../>
    <icon/>    
    
     <!-- runtime specific config and/or overrides  -->
    <runtime name="chromeview">
        <name>Some app (beta!)</name>
        <dosomething />    
    </runtime>

 </platform>

  <!-- Rename cordova/worklight... "engine" to view?  -->
  <view name="cordova">
     <content src="index.html" />
     <access origin="*" />
  </view>

  <!-- <engine name="cordova" ..> ? -->
  <!-- <webview name="cordova" ..> ? -->
  <!-- <api name="cordova" ..> -->
  <!-- <context name="cordova" ..> ? -->
  <!-- <env name="cordova" ..> ? -->
  <!-- <js-env name="cordova" ..> ? -->
  <!-- <hostenv name="cordova" ..> ? -->
  
</app>

Could keep 'config.xml' and create new "cordova" namespace: http://phonegap.com/blog/2014/01/30/customizing-your-android-manifest-and-ios-property-list-on-phonegap-build/

XML namespacing is great in theory, never worked well on the web.

Install meta: {$CLI_PROJECT}/platforms/{$PLATFORM_RUNTIME}/cordova/project.json

  • All required metadata for a native cordova project: current version in the project, ...?
  • All required metadata about installed plugins for a specific platform.

(needs to convert all necessary plugin.xml information into a json format)

  • Need enough info to uninstall & re-install a plugin properly (list of files installed + version number).

Runtime meta: {$CLI_PROJECT}/platforms/{$PLATFORM_RUNTIME}/www/wat.json

"WAT" --> "Web app technology? Existing configs:

Typically this would be loaded by the WebView / browser.

{
 "name": "Some app!",
 "version": "1.0.1",
 "meta": { /* meta-data (auto-generated by cli/plugman)

   "cordova": {
     "plugins": [], /* list of plugins installed */
     "modules": []  /* list of modules to load dynamically (if needed) */
    }
 }
}

Defaults: {$CLI_PROJECT}/platforms/{$PLATFORM_RUNTIME}/cordova/project/defaults/

Store all default configuration & platform files here e.g.

  • {$CLI_PROJECT}/platforms/{$PLATFORM_RUNTIME}/cordova/project/defaults/config.xml
  • {$CLI_PROJECT}/platforms/{$PLATFORM_RUNTIME}/cordova/project/defaults/cordova.js
  • ?

Plugman config: {$PLUGMAN_PROJECT}/cordova/config.xml

If using cli, it must update {$PLUGMAN_PROJECT}/cordova/config.xml

NOTES

Some objectives:

  • cli should write plugin information to the same place as 'plugman' (cordova project)
    • offers an aggregate view over all installed platform projects.
  • must be able to safely rollback changes to a previous change.
    • project.transaction(); project.rollback(); project.commit();
  • must be able to add a different plugin version to a specific native platform

e.g. plugin list

org.apache.cordova.file     0.2.5 
org.apache.cordova.camera   0.2.6  (ios, windows8)
org.apache.cordova.camera   0.2.5  (android)
  • need a migration path to convert existing 3.x project
    • And think about easy upgrade process:

 cordova info
 cordova upgrade [platform list]

config/cordova.xml (last edited 2014-06-03 16:52:53 by jbondc)