diff --git a/.env b/.env index d08b999c..1e2a9e03 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -CONTENTSTACK_SDK_VERSION=1.5.1 +CONTENTSTACK_SDK_VERSION=1.6.3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60ed4786..134f7eba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,11 @@ jobs: with: xcode-version: '15.4.0' + - name: Unzip DVR for Testing + run: | + unzip -q Utility/contentstack-swift-dvr.zip -d Utility/ + echo "DVR unzipped for testing" + - name: Create config file run: | echo '{ @@ -79,6 +84,11 @@ jobs: with: xcode-version: '15.4.0' + - name: Unzip DVR for Testing + run: | + unzip -q Utility/contentstack-swift-dvr.zip -d Utility/ + echo "DVR unzipped for testing" + - name: Create config file run: | echo '{ diff --git a/.gitignore b/.gitignore index 0144b643..0a48cfb8 100644 --- a/.gitignore +++ b/.gitignore @@ -76,4 +76,8 @@ TestCase docs fastlane/ -Gemfile \ No newline at end of file +Gemfile + +# Ignore unzipped DVR folder +Utility/contentstack-swift-dvr/ +!Utility/contentstack-swift-dvr.zip \ No newline at end of file diff --git a/Cartfile b/Cartfile index f587220f..13e6a7c7 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1 @@ -github "contentstack/contentstack-swift-dvr" "master" -github "contentstack/contentstack-utils-swift" +github "contentstack/contentstack-utils-swift" ~> 1.3.4 diff --git a/Cartfile.resolved b/Cartfile.resolved index a6fdcb93..02a1d284 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1 @@ -github "contentstack/contentstack-swift-dvr" "c8040a2451e4bc2c312347531cac6c73f23ce50c" github "contentstack/contentstack-utils-swift" "v1.3.4" diff --git a/Config.xcconfig b/Config.xcconfig index b8ab6e29..773298c1 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1 +1 @@ -CONTENTSTACK_SDK_VERSION = 1.5.1 +CONTENTSTACK_SDK_VERSION = 1.6.3 diff --git a/Contentstack iOS Tests.xctestplan b/Contentstack iOS Tests.xctestplan new file mode 100644 index 00000000..182711af --- /dev/null +++ b/Contentstack iOS Tests.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "2A2297B9-D608-493E-86C3-89A25834B643", + "name" : "Test Scheme Action", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:Contentstack.xcodeproj", + "identifier" : "0F4A75D2241BAC4300E3A024", + "name" : "Contentstack iOS Tests" + } + } + ], + "version" : 1 +} diff --git a/Contentstack.xcodeproj/project.pbxproj b/Contentstack.xcodeproj/project.pbxproj index d0959aae..703b9a26 100644 --- a/Contentstack.xcodeproj/project.pbxproj +++ b/Contentstack.xcodeproj/project.pbxproj @@ -1541,7 +1541,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = SMAKUMV86W; + DEVELOPMENT_TEAM = FLVTD4X723; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1611,7 +1611,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - DEVELOPMENT_TEAM = SMAKUMV86W; + DEVELOPMENT_TEAM = FLVTD4X723; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -2588,14 +2588,6 @@ kind = branch; }; }; - 47D561532C9EFA1400DC085D /* XCRemoteSwiftPackageReference "contentstack-swift-dvr" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/contentstack/contentstack-swift-dvr.git"; - requirement = { - branch = master; - kind = branch; - }; - }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ diff --git a/Contentstack.xcodeproj/xcshareddata/xcschemes/Contentstack iOS.xcscheme b/Contentstack.xcodeproj/xcshareddata/xcschemes/Contentstack iOS.xcscheme new file mode 100644 index 00000000..8deffc22 --- /dev/null +++ b/Contentstack.xcodeproj/xcshareddata/xcschemes/Contentstack iOS.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ContentstackSwift.podspec b/ContentstackSwift.podspec index 7b45e6bf..a11c5771 100644 --- a/ContentstackSwift.podspec +++ b/ContentstackSwift.podspec @@ -31,18 +31,18 @@ Pod::Spec.new do |s| } s.source = { :git => 'https://github.com/contentstack/contentstack-swift.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/Contentstack' - s.swift_version = '5' + s.swift_version = '5.6' - s.ios.deployment_target = '11.0' - s.osx.deployment_target = '10.13' - s.watchos.deployment_target = '4.0' - s.tvos.deployment_target = '11.0' + s.ios.deployment_target = '13.0' + s.osx.deployment_target = '10.15' + s.watchos.deployment_target = '6.0' + s.tvos.deployment_target = '13.0' s.source_files = 'Sources/**/*' # s.public_header_files = 'Pod/Classes/**/*.h' # s.frameworks = 'UIKit' - s.dependency 'ContentstackUtils', '~> 1.3.0' + s.dependency 'ContentstackUtils', '~> 1.3.4' end diff --git a/Package.swift b/Package.swift index b0b90004..335dd141 100644 --- a/Package.swift +++ b/Package.swift @@ -1,40 +1,34 @@ -// swift-tools-version:5.1 -// The swift-tools-version declares the minimum version of Swift required to build this package. - +// swift-tools-version:5.6 import PackageDescription let package = Package( name: "ContentstackSwift", - platforms: [.macOS(.v10_15), - .iOS(.v13), - .tvOS(.v13), - .watchOS(.v6)], - + platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "ContentstackSwift", - targets: ["ContentstackSwift"]) + name: "ContentstackSwift", + targets: ["Contentstack"]) ], dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/contentstack/contentstack-utils-swift.git", .branch("master")), - // Dev dependencies - .package(url: "https://github.com/contentstack/contentstack-swift-dvr.git", .branch("master")) + .package(url: "https://github.com/contentstack/contentstack-utils-swift.git", from: "1.3.4"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, //and on products in packages which this package depends on. .target( - name: "ContentstackSwift", - dependencies: ["ContentstackUtils"], + name: "Contentstack", + dependencies: [.product(name: "ContentstackUtils", package: "contentstack-utils-swift")], path: "Sources"), + .target( + name: "DVR", + path: "Utility/contentstack-swift-dvr/contentstack-swift-dvr-master.zip/Sources"), .testTarget( name: "ContentstackTests", - dependencies: ["ContentstackSwift", "DVR"], + dependencies: ["Contentstack", "DVR"], path: "Tests") ] ) diff --git a/Scripts/.env b/Scripts/.env index 5f935edd..d4216baa 100644 --- a/Scripts/.env +++ b/Scripts/.env @@ -1 +1 @@ -CONTENTSTACK_SDK_VERSION=1.4.0 +CONTENTSTACK_SDK_VERSION=1.6.3 \ No newline at end of file diff --git a/Scripts/setup-test-dependencies.sh b/Scripts/setup-test-dependencies.sh new file mode 100755 index 00000000..4457ec50 --- /dev/null +++ b/Scripts/setup-test-dependencies.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Run this script before building or testing the project + +ZIP_PATH="Utility/contentstack-swift-dvr.zip" +UNZIP_DIR="Utility/contentstack-swift-dvr" + +# Only unzip if the DVR source doesn't already exist +if [ ! -d "$UNZIP_DIR/Sources" ]; then + echo "🔧 Unzipping DVR testing framework..." + unzip -q "$ZIP_PATH" -d "$UNZIP_DIR" + echo "✅ DVR testing framework ready." +else + echo "✅ DVR already unzipped." +fi diff --git a/Sources/Error.swift b/Sources/Error.swift index 317f2c36..e8d7cecb 100644 --- a/Sources/Error.swift +++ b/Sources/Error.swift @@ -7,6 +7,10 @@ import Foundation +// Add these type aliases at the top level +public typealias CSAPIError = APIError +public typealias CSSDKError = SDKError + /// Possible errors being thrown by the SDK public enum SDKError: Error, CustomDebugStringConvertible { diff --git a/Utility/contentstack-swift-dvr.zip b/Utility/contentstack-swift-dvr.zip new file mode 100644 index 00000000..8c0375f4 Binary files /dev/null and b/Utility/contentstack-swift-dvr.zip differ