Skip to content

Commit

Permalink
Add Swift Package Manager support to ConfigCat SDK for the Apple plat…
Browse files Browse the repository at this point in the history
…forms (#11)

* Initial support for Swift Package Manager

* Consolidate all targets into two targets

* Restore ConfigCat Coverage scheme

* Update ConfigCat.podspec

Updated the source_files property in the podspec to match the location of the source code.

* Update Travis configuration

Updated the Travis configuration to use the shared ConfigCat scheme

* Remove processing of resources from Package.swift

* Change version to a constant

Changed the version to be a constant as infoDictionary?["CFBundleShortVersionString"] isn’t available when working with the Swift Package Manager as of Swift 5.3.  Additionally updated the deployment documentation.

* Run tests in parallel and random order

Improve the tests by running them in parallel and random order.

* Bump version

Bumped the version to 7.2.0 to match the description in the README.md.

* Update TravisCI macOS image

Updated the TravisCI macOS image to use Xcode 12.2. Updated all xcodebuild accordingly to support the change of Xcode.

* Fix cmdline compile failure

Fixed cmdline compilation due to missing dependecy from test target to framework target.
  • Loading branch information
barkoded authored Jan 5, 2021
1 parent 10b8475 commit e4233cd
Show file tree
Hide file tree
Showing 61 changed files with 385 additions and 2,053 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: objective-c

osx_image: xcode10
osx_image: xcode12.2

stages:
- test
Expand All @@ -19,20 +19,20 @@ jobs:
- stage: test
script:
- set -o pipefail
- xcodebuild build-for-testing -sdk iphonesimulator12.0 -project ConfigCat.xcodeproj -scheme "ConfigCat iOS" -destination "OS=12.0,name=iPhone 8" CODE_SIGNING_REQUIRED=NO -quiet
- travis_retry xcodebuild test-without-building -sdk iphonesimulator12.0 -project ConfigCat.xcodeproj -scheme "ConfigCat iOS" -destination "OS=12.0,name=iPhone 8" CODE_SIGNING_REQUIRED=NO -quiet
- xcodebuild build-for-testing -sdk iphonesimulator14.2 -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "OS=14.2,name=iPhone 8" CODE_SIGNING_REQUIRED=NO -quiet
- travis_retry xcodebuild test-without-building -sdk iphonesimulator14.2 -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "OS=14.2,name=iPhone 8" CODE_SIGNING_REQUIRED=NO -quiet

- xcodebuild build-for-testing -sdk appletvsimulator12.0 -project ConfigCat.xcodeproj -scheme "ConfigCat tvOS" -destination "OS=12.0,name=Apple TV 4K (at 1080p)" CODE_SIGNING_REQUIRED=NO -quiet
- travis_retry xcodebuild test-without-building -sdk appletvsimulator12.0 -project ConfigCat.xcodeproj -scheme "ConfigCat tvOS" -destination "OS=12.0,name=Apple TV 4K (at 1080p)" CODE_SIGNING_REQUIRED=NO -quiet
- xcodebuild build-for-testing -sdk appletvsimulator14.2 -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "OS=14.2,name=Apple TV 4K (at 1080p)" CODE_SIGNING_REQUIRED=NO -quiet
- travis_retry xcodebuild test-without-building -sdk appletvsimulator14.2 -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "OS=14.2,name=Apple TV 4K (at 1080p)" CODE_SIGNING_REQUIRED=NO -quiet

- xcodebuild build-for-testing -sdk macosx10.14 -project ConfigCat.xcodeproj -scheme "ConfigCat macOS" -destination "arch=x86_64" -quiet
- travis_retry xcodebuild test-without-building -sdk macosx10.14 -project ConfigCat.xcodeproj -scheme "ConfigCat macOS" -destination "arch=x86_64" -quiet
- xcodebuild build-for-testing -sdk macosx11.0 -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "arch=x86_64" -quiet
- travis_retry xcodebuild test-without-building -sdk macosx11.0 -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "arch=x86_64" -quiet

- stage: coverage
script:
- set -o pipefail
- xcodebuild build-for-testing -sdk macosx10.14 -project ConfigCat.xcodeproj -scheme "ConfigCat Coverage" -destination "arch=x86_64" -quiet
- xcodebuild test-without-building -sdk macosx10.14 -project ConfigCat.xcodeproj -scheme "ConfigCat Coverage" -destination "arch=x86_64" -quiet
- xcodebuild build-for-testing -sdk macosx11.0 -project ConfigCat.xcodeproj -scheme "ConfigCat Coverage" -destination "arch=x86_64" -quiet
- xcodebuild test-without-building -sdk macosx11.0 -project ConfigCat.xcodeproj -scheme "ConfigCat Coverage" -destination "arch=x86_64" -quiet
- slather
- bash <(curl -s https://codecov.io/bash) -f ./cobertura.xml

Expand Down
24 changes: 0 additions & 24 deletions Assets/Info-macOS.plist

This file was deleted.

24 changes: 0 additions & 24 deletions Assets/Info-tvOS.plist

This file was deleted.

24 changes: 0 additions & 24 deletions Assets/Info-watchOS.plist

This file was deleted.

4 changes: 2 additions & 2 deletions ConfigCat.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = "ConfigCat"
spec.version = "7.1.0"
spec.version = "7.2.0"
spec.summary = "ConfigCat Swift SDK"
spec.swift_version = "4.2"

Expand All @@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
spec.osx.deployment_target = '10.12'

spec.source = { :git => "https://github.com/configcat/swift-sdk.git", :tag => spec.version }
spec.source_files = "Sources/*.swift", "Version/*.swift"
spec.source_files = "Sources/ConfigCat/*.swift", "Sources/Version/*.swift"
spec.requires_arc = true
spec.module_name = "ConfigCat"
spec.documentation_url = "https://configcat.com/docs/sdk-reference/ios"
Expand Down
47 changes: 47 additions & 0 deletions ConfigCat.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Targeted Device Families
//
// The build system uses the selected device to set the correct value for the
// `UIDeviceFamily` key it adds to the target's `Info.plist` file. This also drives the
// --target-device flag to actool, which determines the idioms selected during catalog
// compilation.
TARGETED_DEVICE_FAMILY = 1,2,3,4

IPHONEOS_DEPLOYMENT_TARGET = 10.0
MACOSX_DEPLOYMENT_TARGET = 10.12
TVOS_DEPLOYMENT_TARGET = 10.0
WATCHOS_DEPLOYMENT_TARGET = 3.0

// Product Bundle Identifier
//
// A string that uniquely identifies the bundle. The string should be in reverse DNS
// format using only alphanumeric characters (`A-Z`, `a-z`, `0-9`), the dot (`.`), and
// the hyphen (`-`). This value is used as the `CFBundleIdentifier` in the `Info.plist`
// of the built bundle.
PRODUCT_BUNDLE_IDENTIFIER[sdk=appletvos*] = com.configcat.tvOS.client
PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*] = com.configcat.iOS.client
PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*] = com.configcat.macOS.client
PRODUCT_BUNDLE_IDENTIFIER[sdk=watchos*] = com.configcat.watchOS.client

// Base SDK
//
// The name or path of the base SDK being used during the build. The product will be
// built against the headers and libraries located inside the indicated SDK. This path
// will be prepended to all search paths, and will be passed through the environment to
// the compiler and linker. Additional SDKs can be specified in the `ADDITIONAL_SDKS`
// setting.
SDKROOT[sdk=macosx*] = macosx
SDKROOT[sdk=iphoneos*] = iphoneos
SDKROOT[sdk=watchos*] = watchos
SDKROOT[sdk=appletvos*] = appletvos

// Supported Platforms
//
// The list of supported platforms from which a base SDK can be used. This setting is
// used if the product can be built for multiple platforms using different SDKs.
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator

// Swift Language Version
SWIFT_VERSION = 4.2

// ConfigCat SDK version
MARKETING_VERSION = 7.2.0
Loading

0 comments on commit e4233cd

Please sign in to comment.