Andrew Grieve created CB-4776:
---------------------------------

             Summary: Add `cordova platform upgrade` command
                 Key: CB-4776
                 URL: https://issues.apache.org/jira/browse/CB-4776
             Project: Apache Cordova
          Issue Type: Bug
            Reporter: Andrew Grieve
            Assignee: Andrew Grieve


Example workflow:

{code}
$ cd MyProject
$ cordova --version
3.0.9
$ npm update -g cordova
$ cordova --version
3.1.0-1.0.0
$ cordova platform ls
Installed platforms: 
 android 3.0.0
 ios 3.0.0
Available platforms:
 android 3.1.0
 ios 3.1.0
 blackberry10 3.1.0
$ cordova platform add android
Platform android already exists. Use `update` to upgrade it.
$ cordova platform update android
Updated android from 3.0.0 to 3.1.0
$ cordova platform ls
Installed platforms: 
 android 3.1.0
 ios 3.0.0
Available platforms:
 ios 3.1.0
 blackberry10 3.1.0
{code}

How does `cordova platform update` work?
- It uses platforms/*/cordova/version script to discover current version
- It fetches the new version into $HOME/.cordova/libs
- It runs new_version/bin/upgrade path/to/platforms/$PLATFORM for the specified 
platform

The platform script is responsible for:
#1 - doing all easily automated steps (e.g. update Cordova.jar, update scripts 
within cordova/)
#2 - Printing out a message saying what manual steps should be taken to 
complete the upgrade (e.g. Please add this snippet to your ApplicationDelegate)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to