You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/04/22 23:45:02 UTC
[08/14] Update to modern layout
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..49624d6
--- /dev/null
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -0,0 +1,604 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 70BD673E18FF9DAE00A1EFCF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BD673D18FF9DAE00A1EFCF /* Cocoa.framework */; };
+ 70BD674F18FF9DAE00A1EFCF /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BD674E18FF9DAE00A1EFCF /* XCTest.framework */; };
+ 70BD675018FF9DAE00A1EFCF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BD673D18FF9DAE00A1EFCF /* Cocoa.framework */; };
+ 70BD675318FF9DAE00A1EFCF /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BD673A18FF9DAE00A1EFCF /* libCordova.a */; };
+ 70BD675918FF9DAE00A1EFCF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 70BD675718FF9DAE00A1EFCF /* InfoPlist.strings */; };
+ 70BD675B18FF9DAE00A1EFCF /* CordovaLibTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD675A18FF9DAE00A1EFCF /* CordovaLibTests.m */; };
+ 70BD679718FFA12D00A1EFCF /* CDVBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD676F18FFA12D00A1EFCF /* CDVBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD679818FFA12D00A1EFCF /* CDVBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD677018FFA12D00A1EFCF /* CDVBridge.m */; };
+ 70BD679918FFA12D00A1EFCF /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677118FFA12D00A1EFCF /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD679A18FFA12D00A1EFCF /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD677218FFA12D00A1EFCF /* CDVViewController.m */; };
+ 70BD679B18FFA12D00A1EFCF /* CDVWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677318FFA12D00A1EFCF /* CDVWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD679C18FFA12D00A1EFCF /* CDVWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD677418FFA12D00A1EFCF /* CDVWebViewDelegate.m */; };
+ 70BD679D18FFA12D00A1EFCF /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677618FFA12D00A1EFCF /* CDV.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 70BD679E18FFA12D00A1EFCF /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677718FFA12D00A1EFCF /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD679F18FFA12D00A1EFCF /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677818FFA12D00A1EFCF /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67A018FFA12D00A1EFCF /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677918FFA12D00A1EFCF /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67A118FFA12D00A1EFCF /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD677A18FFA12D00A1EFCF /* CDVCommandDelegateImpl.m */; };
+ 70BD67A218FFA12D00A1EFCF /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677B18FFA12D00A1EFCF /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67A318FFA12D00A1EFCF /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD677C18FFA12D00A1EFCF /* CDVCommandQueue.m */; };
+ 70BD67A418FFA12D00A1EFCF /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677D18FFA12D00A1EFCF /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67A518FFA12D00A1EFCF /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD677E18FFA12D00A1EFCF /* CDVConfigParser.m */; };
+ 70BD67A618FFA12D00A1EFCF /* CDVConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD677F18FFA12D00A1EFCF /* CDVConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67A718FFA12D00A1EFCF /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678018FFA12D00A1EFCF /* CDVConnection.m */; };
+ 70BD67A818FFA12D00A1EFCF /* CDVConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678118FFA12D00A1EFCF /* CDVConsole.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67A918FFA12D00A1EFCF /* CDVConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678218FFA12D00A1EFCF /* CDVConsole.m */; };
+ 70BD67AA18FFA12D00A1EFCF /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678318FFA12D00A1EFCF /* CDVDebug.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67AB18FFA12D00A1EFCF /* CDVDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678418FFA12D00A1EFCF /* CDVDevice.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67AC18FFA12D00A1EFCF /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678518FFA12D00A1EFCF /* CDVDevice.m */; };
+ 70BD67AD18FFA12D00A1EFCF /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678618FFA12D00A1EFCF /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67AE18FFA12D00A1EFCF /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678718FFA12D00A1EFCF /* CDVInvokedUrlCommand.m */; };
+ 70BD67AF18FFA12D00A1EFCF /* CDVJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678818FFA12D00A1EFCF /* CDVJSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67B018FFA12D00A1EFCF /* CDVJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678918FFA12D00A1EFCF /* CDVJSON.m */; };
+ 70BD67B118FFA12D00A1EFCF /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678A18FFA12D00A1EFCF /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67B218FFA12D00A1EFCF /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678B18FFA12D00A1EFCF /* CDVPlugin.m */; };
+ 70BD67B318FFA12D00A1EFCF /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678C18FFA12D00A1EFCF /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67B418FFA12D00A1EFCF /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678D18FFA12D00A1EFCF /* CDVPluginResult.m */; };
+ 70BD67B518FFA12D00A1EFCF /* CDVReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD678E18FFA12D00A1EFCF /* CDVReachability.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 70BD67B618FFA12D00A1EFCF /* CDVReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD678F18FFA12D00A1EFCF /* CDVReachability.m */; };
+ 70BD67B718FFA12D00A1EFCF /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD679118FFA12D00A1EFCF /* NSData+Base64.h */; };
+ 70BD67B818FFA12D00A1EFCF /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD679218FFA12D00A1EFCF /* NSData+Base64.m */; };
+ 70BD67B918FFA12D00A1EFCF /* NSWindow+Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD679318FFA12D00A1EFCF /* NSWindow+Utils.h */; };
+ 70BD67BA18FFA12D00A1EFCF /* NSWindow+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD679418FFA12D00A1EFCF /* NSWindow+Utils.m */; };
+ 70BD67BB18FFA12D00A1EFCF /* ShellUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 70BD679518FFA12D00A1EFCF /* ShellUtils.h */; };
+ 70BD67BC18FFA12D00A1EFCF /* ShellUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BD679618FFA12D00A1EFCF /* ShellUtils.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 70BD675118FF9DAE00A1EFCF /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 70BD673218FF9DAE00A1EFCF /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 70BD673918FF9DAE00A1EFCF;
+ remoteInfo = CordovaLib;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 70BD673A18FF9DAE00A1EFCF /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 70BD673D18FF9DAE00A1EFCF /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 70BD674018FF9DAE00A1EFCF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 70BD674118FF9DAE00A1EFCF /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ 70BD674218FF9DAE00A1EFCF /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 70BD674518FF9DAE00A1EFCF /* CordovaLib-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CordovaLib-Prefix.pch"; sourceTree = "<group>"; };
+ 70BD674D18FF9DAE00A1EFCF /* CordovaLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CordovaLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 70BD674E18FF9DAE00A1EFCF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+ 70BD675618FF9DAE00A1EFCF /* CordovaLibTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CordovaLibTests-Info.plist"; sourceTree = "<group>"; };
+ 70BD675818FF9DAE00A1EFCF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 70BD675A18FF9DAE00A1EFCF /* CordovaLibTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CordovaLibTests.m; sourceTree = "<group>"; };
+ 70BD676F18FFA12D00A1EFCF /* CDVBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVBridge.h; sourceTree = "<group>"; };
+ 70BD677018FFA12D00A1EFCF /* CDVBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVBridge.m; sourceTree = "<group>"; };
+ 70BD677118FFA12D00A1EFCF /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = "<group>"; };
+ 70BD677218FFA12D00A1EFCF /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = "<group>"; };
+ 70BD677318FFA12D00A1EFCF /* CDVWebViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewDelegate.h; sourceTree = "<group>"; };
+ 70BD677418FFA12D00A1EFCF /* CDVWebViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewDelegate.m; sourceTree = "<group>"; };
+ 70BD677618FFA12D00A1EFCF /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
+ 70BD677718FFA12D00A1EFCF /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailability.h; sourceTree = "<group>"; };
+ 70BD677818FFA12D00A1EFCF /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegate.h; sourceTree = "<group>"; };
+ 70BD677918FFA12D00A1EFCF /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegateImpl.h; sourceTree = "<group>"; };
+ 70BD677A18FFA12D00A1EFCF /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateImpl.m; sourceTree = "<group>"; };
+ 70BD677B18FFA12D00A1EFCF /* CDVCommandQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandQueue.h; sourceTree = "<group>"; };
+ 70BD677C18FFA12D00A1EFCF /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandQueue.m; sourceTree = "<group>"; };
+ 70BD677D18FFA12D00A1EFCF /* CDVConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConfigParser.h; sourceTree = "<group>"; };
+ 70BD677E18FFA12D00A1EFCF /* CDVConfigParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConfigParser.m; sourceTree = "<group>"; };
+ 70BD677F18FFA12D00A1EFCF /* CDVConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConnection.h; sourceTree = "<group>"; };
+ 70BD678018FFA12D00A1EFCF /* CDVConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConnection.m; sourceTree = "<group>"; };
+ 70BD678118FFA12D00A1EFCF /* CDVConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConsole.h; sourceTree = "<group>"; };
+ 70BD678218FFA12D00A1EFCF /* CDVConsole.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConsole.m; sourceTree = "<group>"; };
+ 70BD678318FFA12D00A1EFCF /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
+ 70BD678418FFA12D00A1EFCF /* CDVDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDevice.h; sourceTree = "<group>"; };
+ 70BD678518FFA12D00A1EFCF /* CDVDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVDevice.m; sourceTree = "<group>"; };
+ 70BD678618FFA12D00A1EFCF /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVInvokedUrlCommand.h; sourceTree = "<group>"; };
+ 70BD678718FFA12D00A1EFCF /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommand.m; sourceTree = "<group>"; };
+ 70BD678818FFA12D00A1EFCF /* CDVJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON.h; sourceTree = "<group>"; };
+ 70BD678918FFA12D00A1EFCF /* CDVJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJSON.m; sourceTree = "<group>"; };
+ 70BD678A18FFA12D00A1EFCF /* CDVPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPlugin.h; sourceTree = "<group>"; };
+ 70BD678B18FFA12D00A1EFCF /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPlugin.m; sourceTree = "<group>"; };
+ 70BD678C18FFA12D00A1EFCF /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPluginResult.h; sourceTree = "<group>"; };
+ 70BD678D18FFA12D00A1EFCF /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResult.m; sourceTree = "<group>"; };
+ 70BD678E18FFA12D00A1EFCF /* CDVReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVReachability.h; sourceTree = "<group>"; };
+ 70BD678F18FFA12D00A1EFCF /* CDVReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVReachability.m; sourceTree = "<group>"; };
+ 70BD679118FFA12D00A1EFCF /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = "<group>"; };
+ 70BD679218FFA12D00A1EFCF /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = "<group>"; };
+ 70BD679318FFA12D00A1EFCF /* NSWindow+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSWindow+Utils.h"; sourceTree = "<group>"; };
+ 70BD679418FFA12D00A1EFCF /* NSWindow+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSWindow+Utils.m"; sourceTree = "<group>"; };
+ 70BD679518FFA12D00A1EFCF /* ShellUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShellUtils.h; sourceTree = "<group>"; };
+ 70BD679618FFA12D00A1EFCF /* ShellUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShellUtils.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 70BD673718FF9DAE00A1EFCF /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 70BD673E18FF9DAE00A1EFCF /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 70BD674A18FF9DAE00A1EFCF /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 70BD675318FF9DAE00A1EFCF /* libCordova.a in Frameworks */,
+ 70BD675018FF9DAE00A1EFCF /* Cocoa.framework in Frameworks */,
+ 70BD674F18FF9DAE00A1EFCF /* XCTest.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 70BD673118FF9DAE00A1EFCF = {
+ isa = PBXGroup;
+ children = (
+ 70BD674318FF9DAE00A1EFCF /* CordovaLib */,
+ 70BD675418FF9DAE00A1EFCF /* CordovaLibTests */,
+ 70BD673C18FF9DAE00A1EFCF /* Frameworks */,
+ 70BD673B18FF9DAE00A1EFCF /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 70BD673B18FF9DAE00A1EFCF /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD673A18FF9DAE00A1EFCF /* libCordova.a */,
+ 70BD674D18FF9DAE00A1EFCF /* CordovaLibTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 70BD673C18FF9DAE00A1EFCF /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD673D18FF9DAE00A1EFCF /* Cocoa.framework */,
+ 70BD674E18FF9DAE00A1EFCF /* XCTest.framework */,
+ 70BD673F18FF9DAE00A1EFCF /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 70BD673F18FF9DAE00A1EFCF /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD674018FF9DAE00A1EFCF /* Foundation.framework */,
+ 70BD674118FF9DAE00A1EFCF /* CoreData.framework */,
+ 70BD674218FF9DAE00A1EFCF /* AppKit.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 70BD674318FF9DAE00A1EFCF /* CordovaLib */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD676E18FFA12D00A1EFCF /* Classes */,
+ 70BD674418FF9DAE00A1EFCF /* Supporting Files */,
+ );
+ path = CordovaLib;
+ sourceTree = "<group>";
+ };
+ 70BD674418FF9DAE00A1EFCF /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD674518FF9DAE00A1EFCF /* CordovaLib-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 70BD675418FF9DAE00A1EFCF /* CordovaLibTests */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD675A18FF9DAE00A1EFCF /* CordovaLibTests.m */,
+ 70BD675518FF9DAE00A1EFCF /* Supporting Files */,
+ );
+ path = CordovaLibTests;
+ sourceTree = "<group>";
+ };
+ 70BD675518FF9DAE00A1EFCF /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD675618FF9DAE00A1EFCF /* CordovaLibTests-Info.plist */,
+ 70BD675718FF9DAE00A1EFCF /* InfoPlist.strings */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 70BD676E18FFA12D00A1EFCF /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD676F18FFA12D00A1EFCF /* CDVBridge.h */,
+ 70BD677018FFA12D00A1EFCF /* CDVBridge.m */,
+ 70BD677118FFA12D00A1EFCF /* CDVViewController.h */,
+ 70BD677218FFA12D00A1EFCF /* CDVViewController.m */,
+ 70BD677318FFA12D00A1EFCF /* CDVWebViewDelegate.h */,
+ 70BD677418FFA12D00A1EFCF /* CDVWebViewDelegate.m */,
+ 70BD677518FFA12D00A1EFCF /* Commands */,
+ 70BD679018FFA12D00A1EFCF /* Utils */,
+ );
+ path = Classes;
+ sourceTree = "<group>";
+ };
+ 70BD677518FFA12D00A1EFCF /* Commands */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD677618FFA12D00A1EFCF /* CDV.h */,
+ 70BD677718FFA12D00A1EFCF /* CDVAvailability.h */,
+ 70BD677818FFA12D00A1EFCF /* CDVCommandDelegate.h */,
+ 70BD677918FFA12D00A1EFCF /* CDVCommandDelegateImpl.h */,
+ 70BD677A18FFA12D00A1EFCF /* CDVCommandDelegateImpl.m */,
+ 70BD677B18FFA12D00A1EFCF /* CDVCommandQueue.h */,
+ 70BD677C18FFA12D00A1EFCF /* CDVCommandQueue.m */,
+ 70BD677D18FFA12D00A1EFCF /* CDVConfigParser.h */,
+ 70BD677E18FFA12D00A1EFCF /* CDVConfigParser.m */,
+ 70BD677F18FFA12D00A1EFCF /* CDVConnection.h */,
+ 70BD678018FFA12D00A1EFCF /* CDVConnection.m */,
+ 70BD678118FFA12D00A1EFCF /* CDVConsole.h */,
+ 70BD678218FFA12D00A1EFCF /* CDVConsole.m */,
+ 70BD678318FFA12D00A1EFCF /* CDVDebug.h */,
+ 70BD678418FFA12D00A1EFCF /* CDVDevice.h */,
+ 70BD678518FFA12D00A1EFCF /* CDVDevice.m */,
+ 70BD678618FFA12D00A1EFCF /* CDVInvokedUrlCommand.h */,
+ 70BD678718FFA12D00A1EFCF /* CDVInvokedUrlCommand.m */,
+ 70BD678818FFA12D00A1EFCF /* CDVJSON.h */,
+ 70BD678918FFA12D00A1EFCF /* CDVJSON.m */,
+ 70BD678A18FFA12D00A1EFCF /* CDVPlugin.h */,
+ 70BD678B18FFA12D00A1EFCF /* CDVPlugin.m */,
+ 70BD678C18FFA12D00A1EFCF /* CDVPluginResult.h */,
+ 70BD678D18FFA12D00A1EFCF /* CDVPluginResult.m */,
+ 70BD678E18FFA12D00A1EFCF /* CDVReachability.h */,
+ 70BD678F18FFA12D00A1EFCF /* CDVReachability.m */,
+ );
+ path = Commands;
+ sourceTree = "<group>";
+ };
+ 70BD679018FFA12D00A1EFCF /* Utils */ = {
+ isa = PBXGroup;
+ children = (
+ 70BD679118FFA12D00A1EFCF /* NSData+Base64.h */,
+ 70BD679218FFA12D00A1EFCF /* NSData+Base64.m */,
+ 70BD679318FFA12D00A1EFCF /* NSWindow+Utils.h */,
+ 70BD679418FFA12D00A1EFCF /* NSWindow+Utils.m */,
+ 70BD679518FFA12D00A1EFCF /* ShellUtils.h */,
+ 70BD679618FFA12D00A1EFCF /* ShellUtils.m */,
+ );
+ path = Utils;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 70BD673818FF9DAE00A1EFCF /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 70BD67A218FFA12D00A1EFCF /* CDVCommandQueue.h in Headers */,
+ 70BD67A418FFA12D00A1EFCF /* CDVConfigParser.h in Headers */,
+ 70BD679D18FFA12D00A1EFCF /* CDV.h in Headers */,
+ 70BD67B518FFA12D00A1EFCF /* CDVReachability.h in Headers */,
+ 70BD67AD18FFA12D00A1EFCF /* CDVInvokedUrlCommand.h in Headers */,
+ 70BD679718FFA12D00A1EFCF /* CDVBridge.h in Headers */,
+ 70BD67AB18FFA12D00A1EFCF /* CDVDevice.h in Headers */,
+ 70BD67AF18FFA12D00A1EFCF /* CDVJSON.h in Headers */,
+ 70BD67AA18FFA12D00A1EFCF /* CDVDebug.h in Headers */,
+ 70BD679B18FFA12D00A1EFCF /* CDVWebViewDelegate.h in Headers */,
+ 70BD67A818FFA12D00A1EFCF /* CDVConsole.h in Headers */,
+ 70BD67B718FFA12D00A1EFCF /* NSData+Base64.h in Headers */,
+ 70BD679F18FFA12D00A1EFCF /* CDVCommandDelegate.h in Headers */,
+ 70BD679E18FFA12D00A1EFCF /* CDVAvailability.h in Headers */,
+ 70BD679918FFA12D00A1EFCF /* CDVViewController.h in Headers */,
+ 70BD67BB18FFA12D00A1EFCF /* ShellUtils.h in Headers */,
+ 70BD67B118FFA12D00A1EFCF /* CDVPlugin.h in Headers */,
+ 70BD67B318FFA12D00A1EFCF /* CDVPluginResult.h in Headers */,
+ 70BD67A618FFA12D00A1EFCF /* CDVConnection.h in Headers */,
+ 70BD67A018FFA12D00A1EFCF /* CDVCommandDelegateImpl.h in Headers */,
+ 70BD67B918FFA12D00A1EFCF /* NSWindow+Utils.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 70BD673918FF9DAE00A1EFCF /* Cordova */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 70BD675E18FF9DAE00A1EFCF /* Build configuration list for PBXNativeTarget "Cordova" */;
+ buildPhases = (
+ 70BD673618FF9DAE00A1EFCF /* Sources */,
+ 70BD673718FF9DAE00A1EFCF /* Frameworks */,
+ 70BD673818FF9DAE00A1EFCF /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Cordova;
+ productName = CordovaLib;
+ productReference = 70BD673A18FF9DAE00A1EFCF /* libCordova.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 70BD674C18FF9DAE00A1EFCF /* CordovaLibTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 70BD676118FF9DAE00A1EFCF /* Build configuration list for PBXNativeTarget "CordovaLibTests" */;
+ buildPhases = (
+ 70BD674918FF9DAE00A1EFCF /* Sources */,
+ 70BD674A18FF9DAE00A1EFCF /* Frameworks */,
+ 70BD674B18FF9DAE00A1EFCF /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 70BD675218FF9DAE00A1EFCF /* PBXTargetDependency */,
+ );
+ name = CordovaLibTests;
+ productName = CordovaLibTests;
+ productReference = 70BD674D18FF9DAE00A1EFCF /* CordovaLibTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 70BD673218FF9DAE00A1EFCF /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0510;
+ ORGANIZATIONNAME = "Apache Software Foundation";
+ };
+ buildConfigurationList = 70BD673518FF9DAE00A1EFCF /* Build configuration list for PBXProject "CordovaLib" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 70BD673118FF9DAE00A1EFCF;
+ productRefGroup = 70BD673B18FF9DAE00A1EFCF /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 70BD673918FF9DAE00A1EFCF /* Cordova */,
+ 70BD674C18FF9DAE00A1EFCF /* CordovaLibTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 70BD674B18FF9DAE00A1EFCF /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 70BD675918FF9DAE00A1EFCF /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 70BD673618FF9DAE00A1EFCF /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 70BD67A918FFA12D00A1EFCF /* CDVConsole.m in Sources */,
+ 70BD67A118FFA12D00A1EFCF /* CDVCommandDelegateImpl.m in Sources */,
+ 70BD67AE18FFA12D00A1EFCF /* CDVInvokedUrlCommand.m in Sources */,
+ 70BD67B018FFA12D00A1EFCF /* CDVJSON.m in Sources */,
+ 70BD67A318FFA12D00A1EFCF /* CDVCommandQueue.m in Sources */,
+ 70BD67B818FFA12D00A1EFCF /* NSData+Base64.m in Sources */,
+ 70BD67AC18FFA12D00A1EFCF /* CDVDevice.m in Sources */,
+ 70BD67B618FFA12D00A1EFCF /* CDVReachability.m in Sources */,
+ 70BD679C18FFA12D00A1EFCF /* CDVWebViewDelegate.m in Sources */,
+ 70BD679818FFA12D00A1EFCF /* CDVBridge.m in Sources */,
+ 70BD67BC18FFA12D00A1EFCF /* ShellUtils.m in Sources */,
+ 70BD67A518FFA12D00A1EFCF /* CDVConfigParser.m in Sources */,
+ 70BD679A18FFA12D00A1EFCF /* CDVViewController.m in Sources */,
+ 70BD67B218FFA12D00A1EFCF /* CDVPlugin.m in Sources */,
+ 70BD67BA18FFA12D00A1EFCF /* NSWindow+Utils.m in Sources */,
+ 70BD67B418FFA12D00A1EFCF /* CDVPluginResult.m in Sources */,
+ 70BD67A718FFA12D00A1EFCF /* CDVConnection.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 70BD674918FF9DAE00A1EFCF /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 70BD675B18FF9DAE00A1EFCF /* CordovaLibTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 70BD675218FF9DAE00A1EFCF /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 70BD673918FF9DAE00A1EFCF /* Cordova */;
+ targetProxy = 70BD675118FF9DAE00A1EFCF /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 70BD675718FF9DAE00A1EFCF /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 70BD675818FF9DAE00A1EFCF /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 70BD675C18FF9DAE00A1EFCF /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ ONLY_ACTIVE_ARCH = YES;
+ PRODUCT_NAME = Cordova;
+ PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 70BD675D18FF9DAE00A1EFCF /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ PRODUCT_NAME = Cordova;
+ PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 70BD675F18FF9DAE00A1EFCF /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaLib/CordovaLib-Prefix.pch";
+ PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PUBLIC_HEADERS_FOLDER_PATH = "include/$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 70BD676018FF9DAE00A1EFCF /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaLib/CordovaLib-Prefix.pch";
+ PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PUBLIC_HEADERS_FOLDER_PATH = "include/$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ 70BD676218FF9DAE00A1EFCF /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaLib/CordovaLib-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "CordovaLibTests/CordovaLibTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Debug;
+ };
+ 70BD676318FF9DAE00A1EFCF /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaLib/CordovaLib-Prefix.pch";
+ INFOPLIST_FILE = "CordovaLibTests/CordovaLibTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 70BD673518FF9DAE00A1EFCF /* Build configuration list for PBXProject "CordovaLib" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 70BD675C18FF9DAE00A1EFCF /* Debug */,
+ 70BD675D18FF9DAE00A1EFCF /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 70BD675E18FF9DAE00A1EFCF /* Build configuration list for PBXNativeTarget "Cordova" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 70BD675F18FF9DAE00A1EFCF /* Debug */,
+ 70BD676018FF9DAE00A1EFCF /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 70BD676118FF9DAE00A1EFCF /* Build configuration list for PBXNativeTarget "CordovaLibTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 70BD676218FF9DAE00A1EFCF /* Debug */,
+ 70BD676318FF9DAE00A1EFCF /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 70BD673218FF9DAE00A1EFCF /* Project object */;
+}
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/CDVBridge.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVBridge.h b/CordovaLib/CordovaLib/Classes/CDVBridge.h
new file mode 100644
index 0000000..5d15064
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/CDVBridge.h
@@ -0,0 +1,42 @@
+/*
+ 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.
+ */
+
+#import <Cocoa/Cocoa.h>
+@class WebView;
+@class CDVViewController;
+
+@interface CDVBridge : NSObject {
+
+}
+
+@property (nonatomic, weak) WebView* webView;
+@property (nonatomic,
+#ifdef __MAC_10_8
+ weak
+#else
+ assign
+#endif
+ ) CDVViewController* viewController;
+
+
+- (id) initWithWebView:(WebView*)webView andViewController:(CDVViewController*)viewController;
+- (void) exec:(NSString*)callbackId withService:(NSString*)service andAction:(NSString*)action andArguments:(NSArray*)arguments;
+
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/CDVBridge.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVBridge.m b/CordovaLib/CordovaLib/Classes/CDVBridge.m
new file mode 100644
index 0000000..e34f8ed
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/CDVBridge.m
@@ -0,0 +1,206 @@
+/*
+ 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.
+ */
+
+#import <WebKit/WebKit.h>
+#import <AppKit/AppKit.h>
+#import <Foundation/NSJSONSerialization.h>
+#include <objc/message.h>
+
+#import "CDVBridge.h"
+#import "CDVViewController.h"
+
+@implementation CDVBridge
+
+- (BOOL) isArray:(id)item
+{
+ id win = [self.webView windowScriptObject];
+ WebScriptObject* bridgeUtil = [win evaluateWebScript:@"CordovaBridgeUtil"];
+ NSNumber* result = [bridgeUtil callWebScriptMethod:@"isArray" withArguments:[NSArray arrayWithObject:item]];
+
+ return [result boolValue];
+}
+
+- (BOOL) isDictionary:(id)item
+{
+ id win = [self.webView windowScriptObject];
+ WebScriptObject* bridgeUtil = [win evaluateWebScript:@"CordovaBridgeUtil"];
+ NSNumber* result = [bridgeUtil callWebScriptMethod:@"isObject" withArguments:[NSArray arrayWithObject:item]];
+ return [result boolValue];
+}
+
+- (NSDictionary*) convertWebScriptObjectToNSDictionary:(WebScriptObject*)webScriptObject
+{
+ // Assumption: webScriptObject has already been tested using isDictionary:
+
+ id win = [self.webView windowScriptObject];
+
+ WebScriptObject* keysObject = [win callWebScriptMethod:@"CordovaBridgeUtil.getDictionaryKeys" withArguments:[NSArray arrayWithObject:webScriptObject]];
+ NSArray* keys = [self convertWebScriptObjectToNSArray:keysObject];
+ NSMutableDictionary* dict = [NSMutableDictionary dictionaryWithCapacity:[keys count]];
+
+ NSEnumerator* enumerator = [keys objectEnumerator];
+ id key;
+ while (key = [enumerator nextObject]) {
+ [dict setObject:[webScriptObject valueForKey:key] forKey:key];
+ }
+
+ return dict;
+}
+
+- (NSArray*) convertWebScriptObjectToNSArray:(WebScriptObject*)webScriptObject
+{
+ // Assumption: webScriptObject has already been tested using isArray:
+
+ NSUInteger count = [[webScriptObject valueForKey:@"length"] integerValue];
+ NSMutableArray *a = [NSMutableArray array];
+ for (unsigned i = 0; i < count; i++) {
+ id item = [webScriptObject webScriptValueAtIndex:i];
+ if ([item isKindOfClass:[WebScriptObject class]]) {
+ if ([self isArray:item]) {
+ [a addObject:[self convertWebScriptObjectToNSArray:item]];
+ } else if ([self isDictionary:item]) {
+ [a addObject:[self convertWebScriptObjectToNSDictionary:item]];
+ };
+ } else {
+ [a addObject:item];
+ }
+ }
+
+ return a;
+}
+
+- (void) registerJavaScriptHelpers
+{
+ NSString* cordovaBridgeUtil = @"CordovaBridgeUtil = {};";
+ NSString* isArray = [NSString stringWithFormat:@"CordovaBridgeUtil.isArray = function(obj) { return obj.constructor == Array; };"];
+ NSString* isObject = [NSString stringWithFormat:@"CordovaBridgeUtil.isObject = function(obj) { return obj.constructor == Object; };"];
+ NSString* dictionaryKeys = [NSString stringWithFormat:
+ @" \
+ CordovaBridgeUtil.getDictionaryKeys = function(obj) { \
+ var a = []; \
+ for (var key in obj) { \
+ if (!obj.hasOwnProperty(key)) { \
+ continue; \
+ } \
+ a.push(key); \
+ } \
+ return a; \
+ }"
+ ];
+
+ id win = [self.webView windowScriptObject];
+ [win evaluateWebScript:cordovaBridgeUtil];
+ [win evaluateWebScript:isArray];
+ [win evaluateWebScript:isObject];
+ [win evaluateWebScript:dictionaryKeys];
+}
+
+- (id) initWithWebView:(WebView *)webView andViewController:(CDVViewController*)viewController
+{
+ if ((self = [super init]) != nil) {
+ self.webView = webView;
+ self.viewController = viewController;
+ [self registerJavaScriptHelpers];
+ }
+
+ return self;
+}
+
+- (void) exec:(NSString*)callbackId withService:(NSString*)service andAction:(NSString*)action andArguments:(WebScriptObject*)webScriptObject
+{
+ // We are going with the iOS method of passing in a callbackId.
+ // Note that we can use the JavaScriptCore C API to pass in the JavaScript function references
+ // and context and call them directly, but this is done this way for possible plugin sharing
+ // between iOS and OS X. Also we are going async as well.
+
+ // we're just going to assume the webScriptObject passed in is an NSArray
+ NSArray* arguments = [self convertWebScriptObjectToNSArray:webScriptObject];
+
+ CDVInvokedUrlCommand* command = [[CDVInvokedUrlCommand alloc] initWithArguments:arguments callbackId:callbackId className:service methodName:action];
+
+ if ((command.className == nil) || (command.methodName == nil)) {
+ NSLog(@"ERROR: Classname and/or methodName not found for command.");
+ return;
+ }
+
+ // Fetch an instance of this class
+ CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.className];
+
+ if (!([obj isKindOfClass:[CDVPlugin class]])) {
+ NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.className);
+ return;
+ }
+
+ // Find the proper selector to call.
+ NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName];
+ SEL normalSelector = NSSelectorFromString(methodName);
+ if ([obj respondsToSelector:normalSelector]) {
+ // [obj performSelector:normalSelector withObject:command];
+ objc_msgSend(obj, normalSelector, command);
+ } else {
+ // There's no method to call, so throw an error.
+ NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className);
+ }
+}
+
+#pragma mark WebScripting Protocol
+
+/* checks whether a selector is acceptable to be called from JavaScript */
++ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
+{
+ BOOL result = YES;
+
+ int i = 0;
+ static SEL * acceptableList = NULL;
+ SEL currentSelector;
+
+ if (acceptableList == NULL && (acceptableList = calloc(256, sizeof(SEL)))) // up to 256 selectors
+ {
+ acceptableList[i++] = @selector(exec:withService:andAction:andArguments:);
+ }
+
+ i = 0;
+ while (result == YES && (currentSelector = acceptableList[i++]))
+ {
+ //checking for exclusions
+ result = !(selector == currentSelector);
+ }
+
+ return result;
+}
+
+/* helper function so we don't have to have underscores and stuff in js to refer to the right method */
++ (NSString*) webScriptNameForSelector:(SEL)aSelector
+{
+ id result = nil;
+
+ if (aSelector == @selector(exec:withService:andAction:andArguments:)) {
+ result = @"exec";
+ }
+
+ return result;
+}
+
+// right now exclude all properties (eg keys)
++ (BOOL) isKeyExcludedFromWebScript:(const char*)name
+{
+ return YES;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVViewController.h b/CordovaLib/CordovaLib/Classes/CDVViewController.h
new file mode 100644
index 0000000..cdd3bfd
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/CDVViewController.h
@@ -0,0 +1,58 @@
+/*
+ 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.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <WebKit/WebKit.h>
+#import <Foundation/NSJSONSerialization.h>
+#import "CDVAvailability.h"
+#import "CDVInvokedUrlCommand.h"
+#import "CDVCommandDelegate.h"
+#import "CDVCommandQueue.h"
+#import "CDVPlugin.h"
+#import "CDVWebViewDelegate.h"
+
+@interface CDVViewController : NSWindowController
+{
+ @protected
+ id <CDVCommandDelegate> _commandDelegate;
+ @protected
+ CDVCommandQueue* _commandQueue;
+ NSString* _userAgent;
+}
+
+@property (nonatomic, strong) IBOutlet NSView* contentView;
+@property (nonatomic, strong) IBOutlet WebView* webView;
+@property (nonatomic, strong) IBOutlet CDVWebViewDelegate* webViewDelegate;
+
+@property (nonatomic, readonly, strong) NSMutableDictionary* pluginObjects;
+@property (nonatomic, readonly, strong) NSDictionary* pluginsMap;
+@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
+@property (nonatomic, readonly, strong) NSXMLParser* configParser;
+@property (nonatomic, readonly, assign) BOOL loadFromString;
+
+@property (nonatomic, readwrite, copy) NSString* wwwFolderName;
+@property (nonatomic, readwrite, copy) NSString* startPage;
+@property (nonatomic, readonly, strong) CDVCommandQueue* commandQueue;
+@property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
+
+- (id)getCommandInstance:(NSString*)pluginName;
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className;
+- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVViewController.m b/CordovaLib/CordovaLib/Classes/CDVViewController.m
new file mode 100644
index 0000000..f9fdaa7
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/CDVViewController.m
@@ -0,0 +1,222 @@
+/*
+ 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.
+ */
+
+#import "CDVViewController.h"
+#import "CDVConfigParser.h"
+#import "CDVCommandDelegateImpl.h"
+
+@interface CDVViewController ()
+
+@property (nonatomic, readwrite, strong) NSXMLParser* configParser;
+@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
+@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginObjects;
+@property (nonatomic, readwrite, strong) NSArray* startupPluginNames;
+@property (nonatomic, readwrite, strong) NSDictionary* pluginsMap;
+@property (nonatomic, readwrite, assign) BOOL loadFromString;
+
+@end
+
+@implementation CDVViewController
+
+@synthesize webView;
+@synthesize pluginObjects, pluginsMap, startupPluginNames;
+@synthesize configParser, settings, loadFromString;
+@synthesize wwwFolderName, startPage;
+@synthesize commandDelegate = _commandDelegate;
+@synthesize commandQueue = _commandQueue;
+
+- (void) awakeFromNib
+{
+ _commandDelegate = [[CDVCommandDelegateImpl alloc] initWithViewController:self];
+
+ // make the linker happy since CDVWebViewDelegate is not referenced anywhere and would be stripped out
+ // see http://stackoverflow.com/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime
+ [CDVWebViewDelegate class];
+ //self.webViewDelegate.viewController = self;
+
+ NSURL* appURL = nil;
+ NSString* loadErr = nil;
+
+ if ([self.startPage rangeOfString:@"://"].location != NSNotFound) {
+ appURL = [NSURL URLWithString:self.startPage];
+ } else if ([self.wwwFolderName rangeOfString:@"://"].location != NSNotFound) {
+ appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.wwwFolderName, self.startPage]];
+ } else {
+ NSString* startFilePath = [self.commandDelegate pathForResource:self.startPage];
+ if (startFilePath == nil) {
+ loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
+ NSLog(@"%@", loadErr);
+ self.loadFromString = YES;
+ appURL = nil;
+ } else {
+ appURL = [NSURL fileURLWithPath:startFilePath];
+ }
+ }
+
+ if (!loadErr) {
+ NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
+ [[self.webView mainFrame] loadRequest:appReq];
+
+ } else {
+ NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
+ [[self.webView mainFrame] loadHTMLString:html baseURL:nil];
+ }
+
+ for (NSString* pluginName in self.startupPluginNames) {
+ [self getCommandInstance:pluginName];
+ }
+
+ // initialize items based on settings
+
+ BOOL enableWebGL = [[self.settings objectForKey:@"EnableWebGL"] boolValue];
+ WebPreferences* prefs = [self.webView preferences];
+
+ // Note that this preference may not be Mac App Store safe
+ if (enableWebGL && [prefs respondsToSelector:@selector(setWebGLEnabled:)]) {
+ [prefs performSelector:@selector(setWebGLEnabled:) withObject:[NSNumber numberWithBool:enableWebGL]];
+ }
+}
+
+- (void) __init
+{
+ [self loadSettings];
+}
+
+- (id) init
+{
+ self = [super init];
+ if (self) {
+ // Initialization code here.
+ [self __init];
+ }
+ return self;
+}
+
+- (id)initWithWindowNibName:(NSString*)nibNameOrNil
+{
+ self = [super initWithWindowNibName:nibNameOrNil];
+ if (self) {
+ // Initialization code here.
+ [self __init];
+ }
+ return self;
+}
+
+- (void)loadSettings
+{
+ CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
+
+ // read from config.xml in the app bundle
+ NSString* path = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"xml"];
+
+ if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
+ NSAssert(NO, @"ERROR: config.xml does not exist.");
+ return;
+ }
+
+ NSURL* url = [NSURL fileURLWithPath:path];
+
+ configParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
+ if (configParser == nil) {
+ NSLog(@"Failed to initialize XML parser.");
+ return;
+ }
+ [configParser setDelegate:((id < NSXMLParserDelegate >)delegate)];
+ [configParser parse];
+
+ // Get the plugin dictionary, whitelist and settings from the delegate.
+ self.pluginsMap = delegate.pluginsDict;
+ self.startupPluginNames = delegate.startupPluginNames;
+ self.settings = delegate.settings;
+
+ // And the start folder/page.
+ self.wwwFolderName = @"www";
+ self.startPage = delegate.startPage;
+ if (self.startPage == nil) {
+ self.startPage = @"index.html";
+ }
+
+ // Initialize the plugin objects dict.
+ self.pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20];
+}
+
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
+{
+ if ([plugin respondsToSelector:@selector(setViewController:)]) {
+ [plugin setViewController:self];
+ }
+
+ if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) {
+ [plugin setCommandDelegate:_commandDelegate];
+ }
+
+ [self.pluginObjects setObject:plugin forKey:className];
+ [plugin pluginInitialize];
+}
+
+- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName
+{
+ if ([plugin respondsToSelector:@selector(setViewController:)]) {
+ [plugin setViewController:self];
+ }
+
+ if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) {
+ [plugin setCommandDelegate:_commandDelegate];
+ }
+
+ NSString* className = NSStringFromClass([plugin class]);
+ [self.pluginObjects setObject:plugin forKey:className];
+ [self.pluginsMap setValue:className forKey:[pluginName lowercaseString]];
+ [plugin pluginInitialize];
+}
+
+/**
+ Returns an instance of a CordovaCommand object, based on its name. If one exists already, it is returned.
+ */
+- (id)getCommandInstance:(NSString*)pluginName
+{
+ // first, we try to find the pluginName in the pluginsMap
+ // (acts as a whitelist as well) if it does not exist, we return nil
+ // NOTE: plugin names are matched as lowercase to avoid problems - however, a
+ // possible issue is there can be duplicates possible if you had:
+ // "org.apache.cordova.Foo" and "org.apache.cordova.foo" - only the lower-cased entry will match
+ NSString* className = [self.pluginsMap objectForKey:[pluginName lowercaseString]];
+
+ if (className == nil) {
+ return nil;
+ }
+
+ id obj = [self.pluginObjects objectForKey:className];
+ if (!obj) {
+ obj = [[NSClassFromString (className)alloc] initWithWebView:webView];
+
+ if (obj != nil) {
+ [self registerPlugin:obj withClassName:className];
+ } else {
+ NSLog(@"CDVPlugin class %@ (pluginName: %@) does not exist.", className, pluginName);
+ }
+ }
+ return obj;
+}
+
+- (void) windowResized:(NSNotification*)notification;
+{
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.h b/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.h
new file mode 100644
index 0000000..348ad54
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.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.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <WebKit/WebKit.h>
+
+@class CDVConsole;
+@class CDVBridge;
+@class CDVViewController;
+
+@interface CDVWebViewDelegate : NSObject {
+}
+
+@property (nonatomic, strong) CDVConsole* console;
+@property (nonatomic, strong) CDVBridge* bridge;
+@property (nonatomic,
+#ifdef __MAC_10_8
+ weak
+#else
+ strong
+#endif
+ ) IBOutlet CDVViewController* viewController;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m b/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
new file mode 100644
index 0000000..04fbd86
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
@@ -0,0 +1,151 @@
+/*
+ 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.
+ */
+
+
+#import "CDVWebViewDelegate.h"
+#import "CDVConsole.h"
+#import "CDVBridge.h"
+
+@implementation CDVWebViewDelegate
+
+@synthesize console;
+
+- (void)webView:(WebView*)webView didClearWindowObject:(WebScriptObject*)windowScriptObject forFrame:(WebFrame*)frame
+{
+ if (self.console == nil) {
+ self.console = [CDVConsole new];
+ }
+ [windowScriptObject setValue:self.console forKey:@"console"];
+
+ if (self.bridge == nil) {
+ self.bridge = [[CDVBridge alloc] initWithWebView:webView andViewController:self.viewController];
+ }
+ [windowScriptObject setValue:self.bridge forKey:@"cordovabridge"];
+}
+
+- (void)webView:(WebView*)sender didFinishLoadForFrame:(WebFrame*)frame
+{
+ id win = [sender windowScriptObject];
+ NSString* nativeReady = @"try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}";
+ [win evaluateWebScript:nativeReady];
+}
+
+- (void) webView:(WebView*)webView addMessageToConsole:(NSDictionary*)message
+{
+ if (![message isKindOfClass:[NSDictionary class]]) {
+ return;
+ }
+
+ NSLog(@"JavaScript error: %@:%@: %@",
+ [[message objectForKey:@"sourceURL"] lastPathComponent], // could be nil
+ [message objectForKey:@"lineNumber"],
+ [message objectForKey:@"message"]);
+}
+
+#pragma mark WebScripting protocol
+
+/* checks whether a selector is acceptable to be called from JavaScript */
++ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
+{
+ return YES;
+}
+
+// right now exclude all properties (eg keys)
++ (BOOL) isKeyExcludedFromWebScript:(const char*)name
+{
+ return YES;
+}
+
+#pragma mark WebPolicyDelegate
+
+- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
+{
+ NSString* url = [[request URL] description];
+ NSLog(@"navigating to %@", url);
+
+ [listener use];
+}
+
+
+#pragma mark WebUIDelegate
+
+- (BOOL)webView:(WebView*)sender runBeforeUnloadConfirmPanelWithMessage:(NSString*)message initiatedByFrame:(WebFrame*)frame
+{
+ return [self webView:sender runJavaScriptConfirmPanelWithMessage:message initiatedByFrame:frame];
+}
+
+- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id < WebOpenPanelResultListener >)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles
+{
+ NSOpenPanel* dialog = [NSOpenPanel openPanel];
+
+ [dialog setCanChooseFiles:YES];
+ [dialog setAllowsMultipleSelection:allowMultipleFiles];
+ [dialog setCanChooseDirectories:YES];
+
+ if ([dialog runModal] == NSOKButton) {
+ [resultListener chooseFilenames:[[dialog URLs] valueForKey:@"relativePath"]];
+ }
+}
+
+- (void)webView:(WebView*)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener
+{
+ [self webView:sender runOpenPanelForFileButtonWithResultListener:resultListener allowMultipleFiles:NO];
+}
+
+- (void)webView:(WebView*)sender runJavaScriptAlertPanelWithMessage:(NSString*)message initiatedByFrame:(WebFrame*)frame
+{
+ NSAlert* alert = [[NSAlert alloc] init];
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"")];
+ [alert setMessageText:message];
+
+ [alert runModal];
+}
+
+- (BOOL)webView:(WebView*)sender runJavaScriptConfirmPanelWithMessage:(NSString*)message initiatedByFrame:(WebFrame*)frame
+{
+ NSAlert* alert = [[NSAlert alloc] init];
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"")];
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"")];
+ [alert setMessageText:message];
+
+ return ([alert runModal] == NSAlertFirstButtonReturn);
+}
+
+- (NSString*)webView:(WebView*)sender runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt defaultText:(NSString*)defaultText initiatedByFrame:(WebFrame*)frame
+{
+ NSAlert* alert = [NSAlert alertWithMessageText:prompt
+ defaultButton:NSLocalizedString(@"OK", @"")
+ alternateButton:NSLocalizedString(@"Cancel", @"")
+ otherButton:nil
+ informativeTextWithFormat:@""];
+
+ NSTextField* input = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 24)];
+ [input setStringValue:defaultText];
+ [alert setAccessoryView:input];
+
+ NSInteger button = [alert runModal];
+ if (button == NSAlertDefaultReturn) {
+ [input validateEditing];
+ return [input stringValue];
+ }
+
+ return nil;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDV.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDV.h b/CordovaLib/CordovaLib/Classes/Commands/CDV.h
new file mode 100644
index 0000000..2442121
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDV.h
@@ -0,0 +1,29 @@
+/*
+ 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.
+ */
+
+#import "CDVAvailability.h"
+
+#import "CDVJSON.h"
+#import "CDVDebug.h"
+#import "CDVPluginResult.h"
+#import "CDVInvokedUrlCommand.h"
+#import "CDVPlugin.h"
+#import "CDVDevice.h"
+
+#import "ShellUtils.h"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVAvailability.h b/CordovaLib/CordovaLib/Classes/Commands/CDVAvailability.h
new file mode 100644
index 0000000..fb16806
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVAvailability.h
@@ -0,0 +1,59 @@
+/*
+ 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_OSX__
+
+#define __CORDOVA_2_6_0 20600
+#define __CORDOVA_2_7_0 20700
+#define __CORDOVA_2_8_0 20800
+#define __CORDOVA_2_9_0 20900
+#define __CORDOVA_3_0_0 30000
+#define __CORDOVA_NA 99999 /* not available */
+
+/*
+ #if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_1_7_0
+ // do something when its at least 1.7.0
+ #else
+ // do something else (non 1.7.0)
+ #endif
+ */
+#ifndef CORDOVA_VERSION_MIN_REQUIRED
+ #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_0_0
+#endif
+
+
+/* Return the string version of the decimal version */
+#define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \
+ (CORDOVA_VERSION_MIN_REQUIRED / 10000), \
+ (CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \
+ (CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100]
+
+#ifdef __clang__
+ #define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg)))
+#else
+ #define CDV_DEPRECATED(version, msg) __attribute__((deprecated()))
+#endif
+
+// Enable this to log all exec() calls.
+#define CDV_ENABLE_EXEC_LOGGING 0
+#if CDV_ENABLE_EXEC_LOGGING
+ #define CDV_EXEC_LOG NSLog
+#else
+ #define CDV_EXEC_LOG(...) do {} while (NO)
+#endif
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegate.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegate.h b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegate.h
new file mode 100644
index 0000000..e177c63
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegate.h
@@ -0,0 +1,55 @@
+/*
+ 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.
+ */
+
+#import "CDVAvailability.h"
+#import "CDVInvokedUrlCommand.h"
+
+@class CDVPlugin;
+@class CDVPluginResult;
+@class CDVWhitelist;
+
+@protocol CDVCommandDelegate <NSObject>
+
+@property (nonatomic, readonly) NSDictionary* settings;
+
+- (NSString*)pathForResource:(NSString*)resourcepath;
+- (id)getCommandInstance:(NSString*)pluginName;
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className CDV_DEPRECATED(2.2, "Use CDVViewController to register plugins, or use config.xml.");
+
+// Plugins should not be using this interface to call other plugins since it
+// will result in bogus callbacks being made.
+- (BOOL)execute:(CDVInvokedUrlCommand*)command CDV_DEPRECATED(2.2, "Use direct method calls instead.");
+
+// Sends a plugin result to the JS. This is thread-safe.
+- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId;
+// Evaluates the given JS. This is thread-safe.
+- (void)evalJs:(NSString*)js;
+// Can be used to evaluate JS right away instead of scheduling it on the run-loop.
+// This is required for dispatch resign and pause events, but should not be used
+// without reason. Without the run-loop delay, alerts used in JS callbacks may result
+// in dead-lock. This method must be called from the UI thread.
+- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
+// Runs the given block on a background thread using a shared thread-pool.
+- (void)runInBackground:(void (^)())block;
+// Returns the User-Agent of the associated UIWebView.
+- (NSString*)userAgent;
+// Returns whether the given URL passes the white-list.
+- (BOOL)URLIsWhitelisted:(NSURL*)url;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.h b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.h
new file mode 100644
index 0000000..acbb236
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.h
@@ -0,0 +1,35 @@
+/*
+ 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.
+ */
+
+#import "CDVCommandDelegate.h"
+
+@class CDVViewController;
+@class CDVCommandQueue;
+
+@interface CDVCommandDelegateImpl : NSObject <CDVCommandDelegate>{
+// @private
+#ifdef __MAC_10_8
+ __weak
+#endif
+ CDVViewController* _viewController;
+ @protected
+ __weak CDVCommandQueue* _commandQueue;
+}
+- (id)initWithViewController:(CDVViewController*)viewController;
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.m b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.m
new file mode 100644
index 0000000..ed082aa
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandDelegateImpl.m
@@ -0,0 +1,156 @@
+/*
+ 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.
+ */
+
+#import "CDVCommandDelegateImpl.h"
+#import "CDVJSON.h"
+#import "CDVCommandQueue.h"
+#import "CDVPluginResult.h"
+#import "CDVViewController.h"
+
+@implementation CDVCommandDelegateImpl
+
+- (id)initWithViewController:(CDVViewController*)viewController
+{
+ self = [super init];
+ if (self != nil) {
+ _viewController = viewController;
+ // TODO:
+ //_commandQueue = _viewController.commandQueue;
+ }
+ return self;
+}
+
+- (NSString*)pathForResource:(NSString*)resourcepath
+{
+ NSBundle* mainBundle = [NSBundle mainBundle];
+ NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
+ NSString* filename = [directoryParts lastObject];
+
+ [directoryParts removeLastObject];
+
+ NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
+ NSString* directoryStr = _viewController.wwwFolderName;
+
+ if ([directoryPartsJoined length] > 0) {
+ directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.wwwFolderName, [directoryParts componentsJoinedByString:@"/"]];
+ }
+
+ return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
+}
+
+- (void)evalJsHelper2:(NSString*)js
+{
+ CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]);
+ NSString* commandsJSON = [_viewController.webView stringByEvaluatingJavaScriptFromString:js];
+ if ([commandsJSON length] > 0) {
+ CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining.");
+ }
+
+ // TODO:
+// [_commandQueue enqueCommandBatch:commandsJSON];
+}
+
+- (void)evalJsHelper:(NSString*)js
+{
+ // Cycle the run-loop before executing the JS.
+ // This works around a bug where sometimes alerts() within callbacks can cause
+ // dead-lock.
+ // If the commandQueue is currently executing, then we know that it is safe to
+ // execute the callback immediately.
+ // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reaon,
+ // but performSelectorOnMainThread: does.
+
+ if (![NSThread isMainThread] || !_commandQueue.currentlyExecuting) {
+ [self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO];
+ } else {
+ [self evalJsHelper2:js];
+ }
+}
+
+- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
+{
+ CDV_EXEC_LOG(@"Exec(%@): Sending result. Status=%@", callbackId, result.status);
+ // This occurs when there is are no win/fail callbacks for the call.
+ if ([@"INVALID" isEqualToString:callbackId]) {
+ return;
+ }
+ int status = [result.status intValue];
+ BOOL keepCallback = [result.keepCallback boolValue];
+ NSString* argumentsAsJSON = [result argumentsAsJSON];
+
+ NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d)", callbackId, status, argumentsAsJSON, keepCallback];
+
+ [self evalJsHelper:js];
+}
+
+- (void)evalJs:(NSString*)js
+{
+ [self evalJs:js scheduledOnRunLoop:YES];
+}
+
+- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop
+{
+ js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})", js];
+ if (scheduledOnRunLoop) {
+ [self evalJsHelper:js];
+ } else {
+ [self evalJsHelper2:js];
+ }
+}
+
+- (BOOL)execute:(CDVInvokedUrlCommand*)command
+{
+ return [_commandQueue execute:command];
+}
+
+- (id)getCommandInstance:(NSString*)pluginName
+{
+ return [_viewController getCommandInstance:pluginName];
+}
+
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
+{
+ [_viewController registerPlugin:plugin withClassName:className];
+}
+
+- (void)runInBackground:(void (^)())block
+{
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
+}
+
+- (NSString*)userAgent
+{
+ //return [_viewController userAgent];
+ return nil;
+}
+
+- (BOOL)URLIsWhitelisted:(NSURL*)url
+{
+// TODO:
+// return ![_viewController.whitelist schemeIsAllowed:[url scheme]] ||
+// [_viewController.whitelist URLIsAllowed:url];
+ return NO;
+}
+
+- (NSDictionary*)settings
+{
+ return _viewController.settings;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.h b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.h
new file mode 100644
index 0000000..27c47b5
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.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.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class CDVInvokedUrlCommand;
+@class CDVViewController;
+
+@interface CDVCommandQueue : NSObject
+
+@property (nonatomic, readonly) BOOL currentlyExecuting;
+
+- (id)initWithViewController:(CDVViewController*)viewController;
+- (void)dispose;
+
+- (void)resetRequestId;
+- (void)enqueCommandBatch:(NSString*)batchJSON;
+
+- (void)maybeFetchCommandsFromJs:(NSNumber*)requestId;
+- (void)fetchCommandsFromJs;
+- (void)executePending;
+- (BOOL)execute:(CDVInvokedUrlCommand*)command;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
new file mode 100644
index 0000000..2ff947b
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
@@ -0,0 +1,167 @@
+/*
+ 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.
+ */
+
+#include <objc/message.h>
+#import "CDV.h"
+#import "CDVCommandQueue.h"
+#import "CDVCommandDelegateImpl.h"
+
+@interface CDVCommandQueue () {
+ NSInteger _lastCommandQueueFlushRequestId;
+#ifdef __MAC_10_8
+ __weak
+#endif
+ NSViewController* _viewController;
+ NSMutableArray* _queue;
+ BOOL _currentlyExecuting;
+}
+@end
+
+@implementation CDVCommandQueue
+
+@synthesize currentlyExecuting = _currentlyExecuting;
+
+- (id)initWithViewController:(NSViewController*)viewController
+{
+ self = [super init];
+ if (self != nil) {
+ _viewController = viewController;
+ _queue = [[NSMutableArray alloc] init];
+ }
+ return self;
+}
+
+- (void)dispose
+{
+ // TODO(agrieve): Make this a zeroing weak ref once we drop support for 4.3.
+ _viewController = nil;
+}
+
+- (void)resetRequestId
+{
+ _lastCommandQueueFlushRequestId = 0;
+}
+
+- (void)enqueCommandBatch:(NSString*)batchJSON
+{
+ if ([batchJSON length] > 0) {
+ [_queue addObject:batchJSON];
+ [self executePending];
+ }
+}
+
+- (void)maybeFetchCommandsFromJs:(NSNumber*)requestId
+{
+ // Use the request ID to determine if we've already flushed for this request.
+ // This is required only because the NSURLProtocol enqueues the same request
+ // multiple times.
+ if ([requestId integerValue] > _lastCommandQueueFlushRequestId) {
+ _lastCommandQueueFlushRequestId = [requestId integerValue];
+ [self fetchCommandsFromJs];
+ }
+}
+
+- (void)fetchCommandsFromJs
+{
+ // TODO:
+// // Grab all the queued commands from the JS side.
+// NSString* queuedCommandsJSON = [_viewController.webView stringByEvaluatingJavaScriptFromString:
+// @"cordova.require('cordova/exec').nativeFetchMessages()"];
+//
+// [self enqueCommandBatch:queuedCommandsJSON];
+// if ([queuedCommandsJSON length] > 0) {
+// CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by request.");
+// }
+}
+
+- (void)executePending
+{
+ // Make us re-entrant-safe.
+ if (_currentlyExecuting) {
+ return;
+ }
+ @try {
+ _currentlyExecuting = YES;
+
+ for (NSUInteger i = 0; i < [_queue count]; ++i) {
+ // Parse the returned JSON array.
+ NSArray* commandBatch = [[_queue objectAtIndex:i] JSONObject];
+
+ // Iterate over and execute all of the commands.
+ for (NSArray* jsonEntry in commandBatch) {
+ CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
+ CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
+
+ if (![self execute:command]) {
+#ifdef DEBUG
+ NSString* commandJson = [jsonEntry JSONString];
+ static NSUInteger maxLogLength = 1024;
+ NSString* commandString = ([commandJson length] > maxLogLength) ?
+ [NSString stringWithFormat:@"%@[...]", [commandJson substringToIndex:maxLogLength]] :
+ commandJson;
+
+ DLog(@"FAILED pluginJSON = %@", commandString);
+#endif
+ }
+ }
+ }
+
+ [_queue removeAllObjects];
+ } @finally
+ {
+ _currentlyExecuting = NO;
+ }
+}
+
+- (BOOL)execute:(CDVInvokedUrlCommand*)command
+{
+ if ((command.className == nil) || (command.methodName == nil)) {
+ NSLog(@"ERROR: Classname and/or methodName not found for command.");
+ return NO;
+ }
+
+ // Fetch an instance of this class
+ //TODO:
+// CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.className];
+//
+ CDVPlugin* obj = nil;
+
+ if (!([obj isKindOfClass:[CDVPlugin class]])) {
+ NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.className);
+ return NO;
+ }
+ BOOL retVal = YES;
+
+ // Find the proper selector to call.
+ NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName];
+ SEL normalSelector = NSSelectorFromString(methodName);
+ // Test for the legacy selector first in case they both exist.
+ if ([obj respondsToSelector:normalSelector]) {
+ // [obj performSelector:normalSelector withObject:command];
+ objc_msgSend(obj, normalSelector, command);
+ } else {
+ // There's no method to call, so throw an error.
+ NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className);
+ retVal = NO;
+ }
+
+ return retVal;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/18ecff57/CordovaLib/CordovaLib/Classes/Commands/CDVConfigParser.h
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVConfigParser.h b/CordovaLib/CordovaLib/Classes/Commands/CDVConfigParser.h
new file mode 100644
index 0000000..2e06c88
--- /dev/null
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVConfigParser.h
@@ -0,0 +1,31 @@
+/*
+ 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.
+ */
+
+@interface CDVConfigParser : NSObject <NSXMLParserDelegate>
+{
+ NSString* featureName;
+}
+
+@property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict;
+@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
+@property (nonatomic, readonly, strong) NSMutableArray* whitelistHosts;
+@property (nonatomic, readonly, strong) NSMutableArray* startupPluginNames;
+@property (nonatomic, readonly, strong) NSString* startPage;
+
+@end