[#63] CocoaPods Support (#64)

* Created `YMFF.podspec` to support YMFF installation via CocoaPods
* Updated sources to support both SPM and CocoaPods
* Added podspec linting on CI
* Updated `README` with CocoaPods installation instructions
This commit is contained in:
Yakov Manshin 2021-05-17 09:59:31 +03:00 committed by GitHub
parent d61d59abe8
commit ac99c45043
14 changed files with 93 additions and 4 deletions

View File

@ -1,9 +1,10 @@
name: SPM CI
name: Run Tests
on: [pull_request, push]
jobs:
macos-test:
spm-macos-test:
runs-on: macos-11.0
steps:
- uses: actions/checkout@v2
@ -11,10 +12,17 @@ jobs:
run: sudo xcode-select -switch /Applications/Xcode_12.5.app
- name: Run tests
run: swift test -v
linux-test:
spm-linux-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Run tests
run: swift test -v
cocoapods-podspec-lint:
runs-on: macos-11.0
steps:
- uses: actions/checkout@v2
- name: Lint Podspec
run: pod lib lint --verbose

View File

@ -9,6 +9,8 @@ YMFF is a nice little library that makes management of features with feature fla
YMFF ships completely ready for use, right out of the box: you get everything you need to start in just a few minutes. But you can also replace nearly any component of the system with your own, customized implementation. Since version 2.0, the implementation and the protocols are in two separate targets (YMFF and YMFFProtocols, respectively).
## Installation
### Swift Package Manager (SPM)
To add YMFF to your project, use Xcodes built-in support for Swift packages. Click File → Swift Packages → Add Package Dependency, and paste the following URL into the search field:
```
@ -23,6 +25,15 @@ If you need to use YMFF in another Swift package, add it as a dependency:
.package(url: "https://github.com/yakovmanshin/YMFF", .upToNextMajor(from: "2.0.0"))
```
### CocoaPods
YMFF now supports installation via [CocoaPods](https://youtu.be/iEAjvNRdZa0).
Add the following to your Podfile:
```ruby
pod 'YMFF', '~> 2.1'
```
## Setup
All you need to start managing features with YMFF is at least one feature flag *store*—an object which conforms to `FeatureFlagStoreProtocol` and provides values that correspond to feature flag keys.

View File

@ -6,7 +6,9 @@
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
//
#if !COCOAPODS
import YMFFProtocols
#endif
/// An object that facilitates access to feature flag values.
@propertyWrapper

View File

@ -6,7 +6,9 @@
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
//
#if !COCOAPODS
import YMFFProtocols
#endif
// MARK: - FeatureFlagResolverConfiguration

View File

@ -6,7 +6,9 @@
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
//
#if !COCOAPODS
import YMFFProtocols
#endif
// MARK: - FeatureFlagResolver

View File

@ -6,7 +6,9 @@
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
//
#if !COCOAPODS
import YMFFProtocols
#endif
// MARK: - RuntimeOverridesStore

View File

@ -6,7 +6,9 @@
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
//
#if !COCOAPODS
import YMFFProtocols
#endif
// MARK: - TransparentFeatureFlagStore

View File

@ -9,7 +9,9 @@
#if canImport(Foundation)
import Foundation
#if !COCOAPODS
import YMFFProtocols
#endif
// MARK: - UserDefaultsStore

View File

@ -7,7 +7,9 @@
//
import XCTest
#if !COCOAPODS
import YMFFProtocols
#endif
@testable import YMFF
// MARK: - Configuration

View File

@ -7,7 +7,9 @@
//
import XCTest
#if !COCOAPODS
import YMFFProtocols
#endif
@testable import YMFF
// MARK: - Configuration

View File

@ -7,7 +7,9 @@
//
import XCTest
#if !COCOAPODS
import YMFFProtocols
#endif
@testable import YMFF

View File

@ -7,7 +7,9 @@
//
import XCTest
#if !COCOAPODS
import YMFFProtocols
#endif
@testable import YMFF
// MARK: - Configuration

View File

@ -7,7 +7,9 @@
//
import YMFF
#if !COCOAPODS
import YMFFProtocols
#endif
// MARK: - Shared

48
YMFF.podspec Normal file
View File

@ -0,0 +1,48 @@
Pod::Spec.new do |s|
# Basic Info
s.name = "YMFF"
s.version = "2.1.0"
s.summary = "Feature management made easy."
s.description = <<-DESC
YMFF is a nice little library that makes management of features
with feature flags—and management of the feature flags themselves—a bliss.
DESC
s.homepage = "https://github.com/yakovmanshin/YMFF"
s.documentation_url = "https://opensource.ym.dev/YMFF/"
s.license = { :type => "Apache License, version 2.0", :file => "LICENSE" }
s.author = { "Yakov Manshin" => "contact@yakovmanshin.com" }
s.social_media_url = "https://github.com/yakovmanshin"
# Sources & Build Settings
s.source = { :git => "https://github.com/yakovmanshin/YMFF.git", :tag => "#{s.version}" }
s.swift_version = "5.3"
s.osx.deployment_target = "10.13"
s.ios.deployment_target = "11.0"
# Subspecs
s.default_subspec = "YMFF"
s.subspec "YMFF" do |is|
is.source_files = "Sources/YMFF/**/*.{swift}"
is.dependency "YMFF/YMFFProtocols"
end
s.subspec "YMFFProtocols" do |ps|
ps.source_files = "Sources/YMFFProtocols/**/*.{swift}"
end
s.test_spec "Tests" do |ts|
ts.source_files = "Tests/YMFFTests/**/*.{swift}"
ts.dependency "YMFF/YMFF"
end
end