csantanapr closed pull request #48: Fixes issue #47, updates code to latest syntax, build for iOS 11 URL: https://github.com/apache/incubator-openwhisk-client-swift/pull/48
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/OpenWhisk.podspec b/OpenWhisk.podspec index 2facc9c..b22dc63 100644 --- a/OpenWhisk.podspec +++ b/OpenWhisk.podspec @@ -1,21 +1,21 @@ Pod::Spec.new do |s| s.name = 'OpenWhisk' - s.version = '0.2.2' - s.summary = 'Mobile SDK to use OpenWhisk server-less environment' - s.homepage = 'http://www.ibm.com/mobilefirst/us/en/' + s.version = '0.3.0' + s.summary = 'Apache OpenWhisk Client SDK' + s.homepage = 'https://apache.openwhisk.org' s.license = { :type => 'Apache License, Version 2.0' } - s.authors = 'IBM' + s.authors = 'Apache OpenWhisk' s.description = <<-DESC OpenWhisk is a cloud-first distributed event-based programming service. OpenWhisk provides a programming model to upload event handlers to a cloud service, and register the handlers to respond to various events. DESC - s.ios.deployment_target = '9.0' - s.watchos.deployment_target = '3.0' + s.ios.deployment_target = '11.0' + s.watchos.deployment_target = '4.0' - s.source = { :git => 'https://github.com/openwhisk/openwhisk-client-swift.git', :tag => "#{s.version}" } + s.source = { :git => 'https://github.com/apache/incubator-openwhisk-client-swift.git', :tag => "#{s.version}" } s.source_files = 'OpenWhisk/*.{swift,h}' diff --git a/OpenWhisk.xcodeproj/project.pbxproj b/OpenWhisk.xcodeproj/project.pbxproj index f7747aa..e956ac2 100644 --- a/OpenWhisk.xcodeproj/project.pbxproj +++ b/OpenWhisk.xcodeproj/project.pbxproj @@ -205,16 +205,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = IBM; TargetAttributes = { D6E3E6351C72592300843E16 = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0930; }; D6E3E63F1C72592300843E16 = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0930; }; D6F56ADE1C76471B00F047B6 = { CreatedOnToolsVersion = 7.2.1; @@ -317,14 +317,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -348,7 +356,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -367,14 +375,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -392,7 +408,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -414,13 +430,14 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = OpenWhisk/Info_iOS.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = org.openwhisk.OpenWhisk; PRODUCT_NAME = OpenWhisk; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -435,12 +452,13 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = OpenWhisk/Info_iOS.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = org.openwhisk.OpenWhisk; PRODUCT_NAME = OpenWhisk; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -451,7 +469,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ibm.mobile.openwhisk.OpenWhiskTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -462,7 +481,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ibm.mobile.openwhisk.OpenWhiskTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -484,7 +504,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 3.0; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -506,7 +526,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 3.0; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; diff --git a/OpenWhisk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OpenWhisk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/OpenWhisk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk Tests.xcscheme b/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk Tests.xcscheme index 8d780eb..f88496c 100644 --- a/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk Tests.xcscheme +++ b/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk Tests.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0800" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" diff --git a/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk iOS.xcscheme b/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk iOS.xcscheme index a032da2..ed082fb 100644 --- a/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk iOS.xcscheme +++ b/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk iOS.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0800" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" diff --git a/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk watchOS.xcscheme b/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk watchOS.xcscheme index a75294a..391f125 100644 --- a/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk watchOS.xcscheme +++ b/OpenWhisk.xcodeproj/xcshareddata/xcschemes/OpenWhisk watchOS.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0800" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" diff --git a/OpenWhisk/OpenWhiskButton.swift b/OpenWhisk/OpenWhiskButton.swift index 8de1778..98436e5 100644 --- a/OpenWhisk/OpenWhiskButton.swift +++ b/OpenWhisk/OpenWhiskButton.swift @@ -60,7 +60,7 @@ import UIKit public var actionButtonCallback: ((Dictionary<String,AnyObject>?, WhiskError?) -> Void)? - func buttonPressed() { + @objc func buttonPressed() { invokeAction(parameters: nil, actionCallback: actionButtonCallback) } diff --git a/OpenWhisk/OpenWhiskSDK.swift b/OpenWhisk/OpenWhiskSDK.swift index 4ce7e4b..58741b1 100644 --- a/OpenWhisk/OpenWhiskSDK.swift +++ b/OpenWhisk/OpenWhiskSDK.swift @@ -88,7 +88,7 @@ public class Whisk { set { if let url = newValue { - let c = url.characters.last + let c = url.last let separater = c == "/" ? "" : "/" @@ -214,12 +214,12 @@ public class Whisk { var namespaceStr = namespace - if namespace.characters.count == 0 { + if namespace.count == 0 { namespaceStr = "_" } if let package = package { - if package.characters.count == 0 { + if package.count == 0 { syncName = syncName + namespaceStr+"/"+typeStr+"/"+name } else { syncName = syncName + namespaceStr+"/"+typeStr+"/"+package+"/"+name @@ -430,11 +430,11 @@ public class Whisk { var name = "" var doesSpecifyNamespace = false - if qName.characters.first == "/" { + if qName.first == "/" { doesSpecifyNamespace = true } - let pathParts = qName.characters.split { $0 == "/" }.map(String.init) + let pathParts = qName.split { $0 == "/" }.map(String.init) if doesSpecifyNamespace == true { if pathParts.count == 2 { diff --git a/README.md b/README.md index 2437264..d04925c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Build Status](https://api.travis-ci.org/apache/incubator-openwhisk-client-swift.svg?branch=master)](https://api.travis-ci.org/apache/incubator-openwhisk-client-swift) -This is a Swift-based client SDK for OpenWhisk. You can use it to connect to the [IBM Bluemix OpenWhisk service](http://www.ibm.com/cloud-computing/bluemix/openwhisk/), or you own installation of [OpenWhisk](https://github.com/openwhisk/openwhisk). It partially implements the OpenWhisk [REST API](https://github.com/openwhisk/openwhisk/blob/master/docs/reference.md#rest-api) and allows you to invoke actions and fire triggers. The client SDK is compatible with Swift 3.x and runs on iOS 9 & 10, WatchOS 3, and Darwin. Since this code uses classes like URLSession, Linux support is linked to the current status of [Foundation on Linux](https://github.com/apple/swift-corelibs-foundation). +This is a Swift-based client SDK for OpenWhisk. You can use it to connect to the [IBM Cloud Functions service](https://www.ibm.com/cloud/functions), or you own installation of [Apache OpenWhisk](https://github.com/apache/incubator-openwhisk). It partially implements the OpenWhisk [REST API](https://github.com/apache/incubator-openwhisk/blob/master/docs/reference.md#rest-api) and allows you to invoke actions and fire triggers. The client SDK is compatible with Swift 4.x and runs on iOS 11, WatchOS 4, and Darwin. Since this code uses classes like URLSession, Linux support is linked to the current status of [Foundation on Linux](https://github.com/apple/swift-corelibs-foundation). ## Installation You can install the SDK using the source code in this repo, as a Cocoapod for iOS and WatchOS apps, Carthage, and as a package using the Swift Package Manager for Darwin CLI apps. @@ -11,7 +11,7 @@ You can install the SDK using the source code in this repo, as a Cocoapod for iO ### Source Code Installation To build the source code: - Clone this repo. -- Open the `OpenWhisk.xcodeproj` file in Xcode 8.0 +- Open the `OpenWhisk.xcodeproj` file in Xcode 9.x - Build the OpenWhisk target for an iOS app or the OpenWhiskWatch target for a WatchOS app. - Locate the binary framework file (usually in `debug` or `release` directories at `~/Library/Developer/Xcode/DerivedData/$projectName-*`) and add it to the "Embedded Binaries" list in the General settings of your apps' target. @@ -25,11 +25,11 @@ install! 'cocoapods', :deterministic_uuids => false use_frameworks! target 'MyApp' do - pod 'OpenWhisk', :git => 'https://github.com/openwhisk/openwhisk-client-swift.git', :tag => '0.2.2' + pod 'OpenWhisk', :git => 'https://github.com/apache/incubator-openwhisk-client-swift.git', :tag => '0.3.0' end target 'MyApp WatchKit Extension' do - pod 'OpenWhisk', :git => 'https://github.com/openwhisk/openwhisk-client-swift.git', :tag => '0.2.2' + pod 'OpenWhisk', :git => 'https://github.com/apache/incubator-openwhisk-client-swift.git', :tag => '0.3.0' end ``` You may get the warning 'target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` ' when you have a watch target. You can eliminate this warning by changing this setting in "Build Settings" to the value '$(inherited)'. @@ -42,7 +42,7 @@ This is caused if Cocoapods does not update the Swift version in the Pods projec post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '3.0' + config.build_settings['SWIFT_VERSION'] = '4.0' end end end @@ -55,7 +55,7 @@ Visit the [official Carthage site on Github](https://github.com/Carthage/Carthag Here is an example Cartfile for iOS installation using Carthage: ``` -github "openwhisk/openwhisk-client-swift.git" ~> 0.2.2 # Or latest version +github "openwhisk/openwhisk-client-swift.git" ~> 0.3.0 # Or latest version ``` @@ -68,7 +68,7 @@ import PackageDescription let package = Package( name: "PackageTest", dependencies: [ - .Package(url: "https://github.com/openwhisk/openwhisk-client-swift.git", versions: Version(0,0,0)..<Version(1,0,0)), + .Package(url: "https://github.com/apache/incubator-openwhisk-client-swift.git", versions: Version(0,0,0)..<Version(1,0,0)), ] ) ``` diff --git a/mobile/iOS/starterapp/Cartfile b/mobile/iOS/starterapp/Cartfile index aefd381..88c06c3 100644 --- a/mobile/iOS/starterapp/Cartfile +++ b/mobile/iOS/starterapp/Cartfile @@ -1 +1 @@ -github "openwhisk/openwhisk-client-swift.git" ~> 0.2.1 # Or latest version \ No newline at end of file +github "apache/incubator-openwhisk-client-swift.git" ~> 0.3.0 # Or latest version \ No newline at end of file diff --git a/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/project.pbxproj b/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/project.pbxproj index e49a93c..bc595d6 100644 --- a/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/project.pbxproj +++ b/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/project.pbxproj @@ -129,7 +129,6 @@ D65844401C727BBC001581F3 /* Resources */, D648FD291C72804F0088C7C1 /* Embed Frameworks */, 17B39CA85AFF9440A7860D2E /* [CP] Embed Pods Frameworks */, - 3A2BC21CBA0FE292175B4880 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -147,13 +146,13 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = IBM; TargetAttributes = { D65844411C727BBC001581F3 = { CreatedOnToolsVersion = 7.2.1; DevelopmentTeam = 76CMF53Q35; - LastSwiftMigration = 0800; + LastSwiftMigration = 0930; }; }; }; @@ -195,13 +194,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-OpenWhiskStarterApp-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 17B39CA85AFF9440A7860D2E /* [CP] Embed Pods Frameworks */ = { @@ -210,30 +212,18 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-OpenWhiskStarterApp/Pods-OpenWhiskStarterApp-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/OpenWhisk/OpenWhisk.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenWhisk.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OpenWhiskStarterApp/Pods-OpenWhiskStarterApp-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 3A2BC21CBA0FE292175B4880 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OpenWhiskStarterApp/Pods-OpenWhiskStarterApp-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -281,14 +271,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -311,7 +309,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -328,14 +326,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -352,7 +358,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -373,10 +379,12 @@ "$(PROJECT_DIR)", ); INFOPLIST_FILE = OpenWhiskStarterApp/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ibm.mobile.openwhisk.OpenWhiskStarterApp; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -392,10 +400,12 @@ "$(PROJECT_DIR)", ); INFOPLIST_FILE = OpenWhiskStarterApp/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ibm.mobile.openwhisk.OpenWhiskStarterApp; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/xcshareddata/xcschemes/OpenWhiskStarterApp.xcscheme b/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/xcshareddata/xcschemes/OpenWhiskStarterApp.xcscheme index b5ff414..ce2a76b 100644 --- a/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/xcshareddata/xcschemes/OpenWhiskStarterApp.xcscheme +++ b/mobile/iOS/starterapp/OpenWhiskStarterApp.xcodeproj/xcshareddata/xcschemes/OpenWhiskStarterApp.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0800" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" diff --git a/mobile/iOS/starterapp/OpenWhiskStarterApp/ResultSetTableController.swift b/mobile/iOS/starterapp/OpenWhiskStarterApp/ResultSetTableController.swift index ea47f5c..fae8f53 100644 --- a/mobile/iOS/starterapp/OpenWhiskStarterApp/ResultSetTableController.swift +++ b/mobile/iOS/starterapp/OpenWhiskStarterApp/ResultSetTableController.swift @@ -66,7 +66,7 @@ class ResultSetTableController: UITableViewController { options: JSONSerialization.WritingOptions(rawValue: 0)) let theJSONText = NSString(data: theJSONData, encoding: String.Encoding.ascii.rawValue) - values.append(theJSONText as! String) + values.append(theJSONText! as String) isComplex.append(true) } catch { print("Error converting value to JSON") diff --git a/mobile/iOS/starterapp/OpenWhiskStarterApp/ViewController.swift b/mobile/iOS/starterapp/OpenWhiskStarterApp/ViewController.swift index 82205b4..bf289c2 100644 --- a/mobile/iOS/starterapp/OpenWhiskStarterApp/ViewController.swift +++ b/mobile/iOS/starterapp/OpenWhiskStarterApp/ViewController.swift @@ -84,7 +84,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate { } else if let reply = reply { let str = "\(reply)" print("reply: \(str)") - self.statusLabel.text = "Action \(self.MyNamespace)/\(self.MyWhiskAction) returned \(str.characters.count) characters" + self.statusLabel.text = "Action \(self.MyNamespace)/\(self.MyWhiskAction) returned \(str.count) characters" if let result = reply["result"] as? [String:AnyObject] { self.displayOutput(reply: result) } diff --git a/mobile/iOS/starterapp/Podfile b/mobile/iOS/starterapp/Podfile index a5aae93..46bedde 100644 --- a/mobile/iOS/starterapp/Podfile +++ b/mobile/iOS/starterapp/Podfile @@ -1,14 +1,14 @@ use_frameworks! target 'OpenWhiskStarterApp' do - platform :ios, '10.0' - pod 'OpenWhisk', :git => 'https://github.com/openwhisk/openwhisk-client-swift.git', :tag => '0.2.2' + platform :ios, '11.0' + pod 'OpenWhisk', :git => 'https://github.com/apache/incubator-openwhisk-client-swift.git', :tag => '0.3.0' end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '3.0' + config.build_settings['SWIFT_VERSION'] = '4.0' end end end \ No newline at end of file ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services