incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: Completed Cordova Guides for 1.5.0
Date Wed, 22 Feb 2012 11:47:14 GMT
Updated Branches:
  refs/heads/master 199017bdc -> 514d7bd6d


Completed Cordova Guides for 1.5.0

commit d666da56ab97b8ce573dd9dbbdac73ec8638c557
Author: Shazron Abdullah <shazron@apache.org>
Date:   Wed Feb 22 03:39:03 2012 -0800

    Implemented CB-30 - Added CDVAvailability.h

commit 729f69e646899cfec7db7cda165437ea5819df14
Author: Shazron Abdullah <shazron@apache.org>
Date:   Wed Feb 22 03:34:51 2012 -0800

    Completed Guides for 1.5.0

commit f90b5986c80858edeb2c6f4fb4766d5800e57a60
Author: Shazron Abdullah <shazron@apache.org>
Date:   Wed Feb 22 02:08:15 2012 -0800

    Updated Cordova Upgrade Guide doc.

commit 6b9331967bce8557217299b1c6b4edc3750f4584
Author: Shazron Abdullah <shazron@apache.org>
Date:   Tue Feb 21 11:32:44 2012 -0800

    Added link to new Cordova website.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/514d7bd6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/514d7bd6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/514d7bd6

Branch: refs/heads/master
Commit: 514d7bd6d9138a2cdf7ae74a347c9850486f2b0e
Parents: 199017b
Author: Shazron Abdullah <shazron@apache.org>
Authored: Wed Feb 22 03:46:55 2012 -0800
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Wed Feb 22 03:46:55 2012 -0800

----------------------------------------------------------------------
 CordovaInstaller/docs/finishup.md               |    8 +---
 CordovaLib/Classes/CDV.h                        |    2 +
 CordovaLib/Classes/CDVAvailability.h            |   40 +++++++++++++++++
 CordovaLib/CordovaLib.xcodeproj/project.pbxproj |    6 +++
 README.md                                       |    9 +---
 guides/Cordova Plugin Upgrade Guide.md          |   19 +++++++-
 guides/Cordova Upgrade Guide.md                 |   41 +++++++++++++++---
 guides/How to Use Cordova as a Component.md     |    2 +-
 8 files changed, 103 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/CordovaInstaller/docs/finishup.md
----------------------------------------------------------------------
diff --git a/CordovaInstaller/docs/finishup.md b/CordovaInstaller/docs/finishup.md
index d5a5c17..ea4eda5 100644
--- a/CordovaInstaller/docs/finishup.md
+++ b/CordovaInstaller/docs/finishup.md
@@ -59,11 +59,7 @@ That's it! Modify the contents of the "www" directory to add your HTML,
CSS and
 
 ## Links
 
-* [http://docs.phonegap.com](http://docs.phonegap.com)
-* [http://wiki.apache.org/cordova/](http://wiki.apache.org/cordova/)
-* [http://github.com/apache/incubator-cordova-ios/](http://github.com/apache/incubator-cordova-ios/)
-* [http://groups.google.com/group/phonegap](http://groups.google.com/group/phonegap)
-* \#phonegap or \#phonegap-dev channel on [Freenode IRC](http://freenode.net/)
-* [File issues and feature requests](https://issues.apache.org/jira/browse/CB)
+* [http://incubator.apache.org/cordova/](http://incubator.apache.org/cordova/)
+
 
 <br />

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/CordovaLib/Classes/CDV.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDV.h b/CordovaLib/Classes/CDV.h
index 7798f40..414ac59 100644
--- a/CordovaLib/Classes/CDV.h
+++ b/CordovaLib/Classes/CDV.h
@@ -17,6 +17,8 @@
  under the License.
  */
 
+#import "CDVAvailability.h"
+
 #import "CDVPlugin.h"
 #import "CDVViewController.h"
 #import "CDVCommandDelegate.h"

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/CordovaLib/Classes/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAvailability.h b/CordovaLib/Classes/CDVAvailability.h
new file mode 100644
index 0000000..363d175
--- /dev/null
+++ b/CordovaLib/Classes/CDVAvailability.h
@@ -0,0 +1,40 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#define __CORDOVA_0_9_6  00906
+#define __CORDOVA_1_0_0  10000
+#define __CORDOVA_1_1_0  10100
+#define __CORDOVA_1_2_0  10200
+#define __CORDOVA_1_3_0  10300
+#define __CORDOVA_1_4_0  10400
+#define __CORDOVA_1_4_1  10401
+#define __CORDOVA_1_5_0  10500
+#define __CORDOVA_NA     99999  /* not available */
+
+
+/*
+ #if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_1_5_0
+    // do something when its at least 1.5.0
+ #else
+    // do something else (non 1.5.0)
+ #endif
+ */
+#ifndef CORDOVA_VERSION_MIN_REQUIRED
+    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_1_5_0
+#endif

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 7413827..9be7be1 100644
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -71,6 +71,8 @@
 		30325A0C136B343700982B63 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 30325A0B136B343700982B63
/* VERSION */; };
 		3035621714104C34006C2D43 /* CDVWhitelistTests.m in Sources */ = {isa = PBXBuildFile; fileRef
= 30356213141049E1006C2D43 /* CDVWhitelistTests.m */; };
 		30383DE01385F65600E37E22 /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef
= 307A8F9D1385A2EC00E43782 /* CDVConnection.m */; };
+		30392E4E14F4FCAB00B9E0B8 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef
= 30392E4D14F4FCAB00B9E0B8 /* CDVAvailability.h */; };
+		30392E5014F502C200B9E0B8 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef
= 30392E4D14F4FCAB00B9E0B8 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); };
};
 		307A8F9E1385A2EC00E43782 /* CDVConnection.h in Headers */ = {isa = PBXBuildFile; fileRef
= 307A8F9C1385A2EC00E43782 /* CDVConnection.h */; };
 		307A8F9F1385A2EC00E43782 /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef
= 307A8F9D1385A2EC00E43782 /* CDVConnection.m */; };
 		30956FD2138F1F5600FC3563 /* CDVMotion.h in Headers */ = {isa = PBXBuildFile; fileRef =
30956FD0138F1F5600FC3563 /* CDVMotion.h */; };
@@ -180,6 +182,7 @@
 		30325A0B136B343700982B63 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType
= text; path = VERSION; sourceTree = "<group>"; };
 		30356212141049E1006C2D43 /* CDVWhitelistTests.h */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.h; path = CDVWhitelistTests.h; sourceTree = "<group>";
};
 		30356213141049E1006C2D43 /* CDVWhitelistTests.m */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.objc; path = CDVWhitelistTests.m; sourceTree = "<group>";
};
+		30392E4D14F4FCAB00B9E0B8 /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.h; name = CDVAvailability.h; path = Classes/CDVAvailability.h;
sourceTree = "<group>"; };
 		307A8F9C1385A2EC00E43782 /* CDVConnection.h */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.h; name = CDVConnection.h; path = Classes/CDVConnection.h;
sourceTree = "<group>"; };
 		307A8F9D1385A2EC00E43782 /* CDVConnection.m */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.objc; name = CDVConnection.m; path = Classes/CDVConnection.m;
sourceTree = "<group>"; };
 		30956FD0138F1F5600FC3563 /* CDVMotion.h */ = {isa = PBXFileReference; fileEncoding = 4;
lastKnownFileType = sourcecode.c.h; name = CDVMotion.h; path = Classes/CDVMotion.h; sourceTree
= "<group>"; };
@@ -379,6 +382,7 @@
 		888700D710922F56009987E8 /* Commands */ = {
 			isa = PBXGroup;
 			children = (
+				30392E4D14F4FCAB00B9E0B8 /* CDVAvailability.h */,
 				30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */,
 				30C684921407044A004C1A8E /* CDVURLProtocol.h */,
 				30C684931407044A004C1A8E /* CDVURLProtocol.m */,
@@ -497,6 +501,7 @@
 				8852C43B14B65FD800F0E735 /* CDVViewController.h in Headers */,
 				8852C44014B65FD800F0E735 /* CDVCordovaView.h in Headers */,
 				30F5EBAC14CA26E700987760 /* CDVCommandDelegate.h in Headers */,
+				30392E5014F502C200B9E0B8 /* CDVAvailability.h in Headers */,
 				301F2F2B14F3C9CA003FE9FC /* CDV.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -535,6 +540,7 @@
 				8852C43F14B65FD800F0E735 /* CDVCordovaView.h in Headers */,
 				30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */,
 				301F2F2A14F3C9CA003FE9FC /* CDV.h in Headers */,
+				30392E4E14F4FCAB00B9E0B8 /* CDVAvailability.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 1a70a67..6864154 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Make sure you have installed the latest iOS SDK. Download it at [http://develope
 
 Build and install the Installer Package
 -------------------------------------------------------------
-You don't need to do this if you downloaded the installer from [http://incubator.apache.org/callback/](http://incubator.apache.org/callback/),
this is only for developers that need to compile the source.
+You don't need to do this if you downloaded the installer from [http://incubator.apache.org/cordova/](http://incubator.apache.org/cordova/),
this is only for developers that need to compile the source.
 
 1. Launch "Terminal.app"
 2. Navigate to the folder where the Makefile is
@@ -190,11 +190,6 @@ File them at the [Cordova Issue Tracker](https://issues.apache.org/jira/browse/C
 
 MORE INFO
 ----------
-* [http://docs.phonegap.com](http://docs.phonegap.com)
-* [http://wiki.apache.org/cordova/](http://wiki.apache.org/cordova/)
-* [http://github.com/apache/incubator-cordova-ios/](http://github.com/apache/incubator-cordova-ios/)
-* [http://groups.google.com/group/phonegap](http://groups.google.com/group/phonegap)
-* \#phonegap or \#phonegap-dev channel on [Freenode IRC](http://freenode.net/)
-* [File issues and feature requests](https://issues.apache.org/jira/browse/CB)
+* [http://incubator.apache.org/cordova/](http://incubator.apache.org/cordova/)
 
 <br />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/guides/Cordova
Plugin Upgrade Guide.md
----------------------------------------------------------------------
diff --git a/guides/Cordova Plugin Upgrade Guide.md b/guides/Cordova Plugin Upgrade Guide.md
index 61e749c..d979dc2 100644
--- a/guides/Cordova Plugin Upgrade Guide.md	
+++ b/guides/Cordova Plugin Upgrade Guide.md	
@@ -1,7 +1,20 @@
 # Cordova Plugin Upgrade Guide #
 
-This document is for developers who need to upgrade their Cordova  plugins to a newer Cordova
version. Starting with Cordova 1.5.0, some classes have been renamed, which will require the
plugin to be upgraded.
+This document is for developers who need to upgrade their Cordova  plugins to a newer Cordova
version. Starting with Cordova 1.5.0, some classes have been renamed, which will require the
plugin to be upgraded. Make sure your project itself has been upgraded using the "Cordova
Upgrade Guide" document.
+
+## Upgrading older Cordova plugins to 1.5.0 ##
+
+1. **Install** Cordova 1.5.0
+2. Replace macro occurrences of **"PHONEGAP\_FRAMEWORK"** with **"CORDOVA\_FRAMEWORK"**
+3. Replace import occurrences of **"&lt;PhoneGap/"** with **"&lt;Cordova/"**
+4. Replace class prefixes of **PG** with **CDV** (for example **PG**Plugin becomes **CDV**Plugin)
+5. Replace occurrences of **[self appViewController]** with **self.viewController**. 
+
+## 1.5.0 Plugin Notes ##
+
+1. The UIViewController returned from the **viewController property** will be a CDVViewController
subclass.
+2. The **appDelegate method** basically returns an (id) now, and is the same as calling **[[UIApplication
sharedApplication] delegate]**. In the past it returned a PhoneGapDelegate class.
+3. There is a new **commandDelegate property** now, which gives access to the [CDVCommandDelegate
protocol](https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVCommandDelegate.h)
used by the app
+4. There is a new header file **CDVAvailability.h** that defines Cordova versions during
compile time - to check for the current version during run-time, call **[CDVViewController
cordovaVersion]**
 
-## Upgrading Cordova 1.3.x plugins to 1.5.0 ##
 
-1. TODO:

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/guides/Cordova
Upgrade Guide.md
----------------------------------------------------------------------
diff --git a/guides/Cordova Upgrade Guide.md b/guides/Cordova Upgrade Guide.md
index 0ea5e83..189b52c 100644
--- a/guides/Cordova Upgrade Guide.md	
+++ b/guides/Cordova Upgrade Guide.md	
@@ -7,13 +7,40 @@ For your existing 1.4.0 based projects that use the deprecated classes above,
yo
 ## Upgrading Cordova 1.4.x projects to 1.5.0 ##
 
 1. **Install** Cordova 1.5.0
-2. **Create a new project** - you will have to grab assets from this new project
-3. **Copy** these files from the **new** project into your 1.4.x based project folder on
disk, **replacing** any old files 
+2. **Create a new project** and run it once - you will have to grab assets from this new
project
+3. **Copy** the **www/cordova-1.5.0.js** file from the new project into your **www** folder,
and delete your **www/phonegap-1.4.x.js** file
+4. **Update** the Cordova script reference in your **www/index.html** file (and any other
files that contain the script reference) to point to the new Cordova **cordova-1.5.0.js**
file
+5. Find **"PhoneGap.framework"** in your Project Navigator, select it
+6. Press the **Delete** key and delete the **"PhoneGap.framework"** reference in the Project
Navigator
+7. Press the key combination **Option-Command-A**, which should drop down a sheet to add
files to your project (the **"Add Files..." sheet**). Make sure the **"Created groups for
any added folders"** radio-button is selected
+8. Press the key combination **Shift-Command-G**, which should drop down another sheet for
you to go to a folder (the **"Go to the folder:" sheet**)
+9. Enter **"/Users/Shared/Cordova/Frameworks/Cordova.framework"** in the **"Go to the folder:"
sheet** and then press the **"Go"** button
+10. Press the **"Add"** button in the **"Add Files..." sheet**
+11. **Select "Cordova.framework"** in the Project Navigator
+12. Press the key combination **Option-Command-1** to show the **File Inspector**
+13. Choose **"Absolute Path"** in the **File Inspector** for the drop-down menu for **Location**
+14. Press the key combination **Option-Command-A**, which should drop down a sheet to add
files to your project (the **"Add Files..." sheet**). Make sure the **"Created groups for
any added folders"** radio-button is selected
+15. Press the key combination **Shift-Command-G**, which should drop down another sheet for
you to go to a folder (the **"Go to the folder:" sheet**)
+16. Enter **"~/Documents/CordovaLib/Classes/deprecated"** in the **"Go to the folder:" sheet**
and then press the **"Go"** button
+17. Press the **"Add"** button in the **"Add Files..." sheet**
+18. In your **AppDelegate.h, AppDelegate.m, and MainViewController.h** files - replace the
whole **#ifdef PHONEGAP_FRAMEWORK** block with:
 
-        Cordova.plist
-4. **Copy** the **www/cordova-1.5.0.js** file from the new project into your **www** folder,
and delete your **www/phonegap-1.4.x.js** file
-5. **Update** the Cordova script reference in your **www/index.html** file (and any other
files that contain the script reference) to point to the new Cordova **cordova-1.5.0.js**
file
-6. **TODO: PhoneGap.plist to Cordova.plist changes, especially core plugins**
+        #import "CDVDeprecated.h"
+19. Click on the **project icon** in the Project Navigator, select your **Target**, then
select the **"Build Settings"** tab
+20. Search for **"Framework Search Paths"**
+21. Replace the existing value with **"/Users/Shared/Cordova/Frameworks"** 
+22. Search for **"Preprocessor Macros"**
+23. For the first (combined) value, replace the value with **"CORDOVA_FRAMEWORK=YES"**
+24. Select the **"Build Phases"** tab
+25. Expand **"Run Script"**
+26. Replace any occurrences of **PhoneGap** with **Cordova**
+27. Find your **"PhoneGap.plist"** file in the Project Navigator, and click on the filename
once to enter name edit mode
+28. Rename **"PhoneGap.plist"** to **"Cordova.plist"**
+29. Right-click on **"Cordova.plist"** and choose **"Open As" --> "Source Code"**
+30. Press **Option-Command-F**, choose **"Replace"** from the drop-down on the top left of
the Source window
+31. Enter **com.phonegap** for the Find string, and **org.apache.cordova** for the Replace
string - then press the **"Replace All"** button
+32. Enter **PG** for the Find string, and **CDV** for the Replace string - then press the
**"Replace All"** button
+33. Press **Command-B** to build, you will still have deprecations that you can get rid of
in the future (see **CDVDeprecated.h** - replace classes in your code that use PG* to CDV*,
for example)
 
 ## Upgrading Cordova 1.4.0 projects to 1.4.1 ##
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/514d7bd6/guides/How to Use
Cordova as a Component.md
----------------------------------------------------------------------
diff --git a/guides/How to Use Cordova as a Component.md b/guides/How to Use Cordova as a
Component.md
index 44b7f1d..c18d4b4 100644
--- a/guides/How to Use Cordova as a Component.md	
+++ b/guides/How to Use Cordova as a Component.md	
@@ -127,6 +127,6 @@ It is recommended that you follow the Cordova.framework instructions below,
the
 
 This file controls various settings of Cordova. This is application wide, and not set per
CDVViewController instance. 
 
-1. A list of **Plugins** allowed to be used in a CDVViewController (set in the Plugins dictionary
- key is the servicename used in JavaScript, and the value is the Objective-C class for the
plugin that is a PGPlugin sub-class)
+1. A list of **Plugins** allowed to be used in a CDVViewController (set in the Plugins dictionary
- key is the servicename used in JavaScript, and the value is the Objective-C class for the
plugin that is a CDVPlugin sub-class)
 2. A **white-list** of hosts (with no scheme) that Cordova is allowed to connect to (set
in the ExternalHosts array - wildcards allowed)
 3. Various **other** settings (TODO:)


Mime
View raw message