v2.1.0 (#67)
* [#63] Added support for installation via CocoaPods (#64) * [#65] Removed redundant Linux test manifest (#66) * Updated `import`s in tests * Updated docs title in Jazzy configuration
This commit is contained in:
commit
69dc33a76c
|
@ -1,9 +1,10 @@
|
||||||
name: SPM CI
|
name: Run Tests
|
||||||
|
|
||||||
on: [pull_request, push]
|
on: [pull_request, push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
macos-test:
|
|
||||||
|
spm-macos-test:
|
||||||
runs-on: macos-11.0
|
runs-on: macos-11.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -12,9 +13,16 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: swift test -v
|
run: swift test -v
|
||||||
|
|
||||||
linux-test:
|
spm-linux-test:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: swift test -v
|
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
|
11
README.md
11
README.md
|
@ -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).
|
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
|
## Installation
|
||||||
|
|
||||||
|
### Swift Package Manager (SPM)
|
||||||
To add YMFF to your project, use Xcode’s built-in support for Swift packages. Click File → Swift Packages → Add Package Dependency, and paste the following URL into the search field:
|
To add YMFF to your project, use Xcode’s 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"))
|
.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
|
## 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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
/// An object that facilitates access to feature flag values.
|
/// An object that facilitates access to feature flag values.
|
||||||
@propertyWrapper
|
@propertyWrapper
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - FeatureFlagResolverConfiguration
|
// MARK: - FeatureFlagResolverConfiguration
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - FeatureFlagResolver
|
// MARK: - FeatureFlagResolver
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - RuntimeOverridesStore
|
// MARK: - RuntimeOverridesStore
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
// Copyright © 2020 Yakov Manshin. See the LICENSE file for license info.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - TransparentFeatureFlagStore
|
// MARK: - TransparentFeatureFlagStore
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
#if canImport(Foundation)
|
#if canImport(Foundation)
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - UserDefaultsStore
|
// MARK: - UserDefaultsStore
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
import XCTest
|
|
||||||
|
|
||||||
import YMFFTests
|
|
||||||
|
|
||||||
var tests = [XCTestCaseEntry]()
|
|
||||||
tests += YMFFTests.__allTests()
|
|
||||||
|
|
||||||
XCTMain(tests)
|
|
|
@ -7,7 +7,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
@testable import YMFF
|
@testable import YMFF
|
||||||
|
|
||||||
// MARK: - Configuration
|
// MARK: - Configuration
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
@testable import YMFF
|
@testable import YMFF
|
||||||
|
|
||||||
// MARK: - Configuration
|
// MARK: - Configuration
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
@testable import YMFF
|
@testable import YMFF
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
@testable import YMFF
|
@testable import YMFF
|
||||||
|
|
||||||
// MARK: - Configuration
|
// MARK: - Configuration
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import YMFF
|
import YMFF
|
||||||
|
#if !COCOAPODS
|
||||||
import YMFFProtocols
|
import YMFFProtocols
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - Shared
|
// MARK: - Shared
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#if canImport(Foundation)
|
#if canImport(Foundation)
|
||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
|
||||||
@testable import YMFF
|
@testable import YMFF
|
||||||
|
|
||||||
final class UserDefaultsStoreTests: XCTestCase {
|
final class UserDefaultsStoreTests: XCTestCase {
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
#if !canImport(ObjectiveC)
|
|
||||||
import XCTest
|
|
||||||
|
|
||||||
extension FeatureFlagResolverTests {
|
|
||||||
// DO NOT MODIFY: This is autogenerated, use:
|
|
||||||
// `swift test --generate-linuxmain`
|
|
||||||
// to regenerate.
|
|
||||||
static let __allTests__FeatureFlagResolverTests = [
|
|
||||||
("testIfValueIsOptional", testIfValueIsOptional),
|
|
||||||
("testIntValueResolution", testIntValueResolution),
|
|
||||||
("testNonexistentValueResolution", testNonexistentValueResolution),
|
|
||||||
("testOptionalIntValueResolution", testOptionalIntValueResolution),
|
|
||||||
("testOverrideFailureNoMutableStores", testOverrideFailureNoMutableStores),
|
|
||||||
("testOverrideFailureTypeMismatch", testOverrideFailureTypeMismatch),
|
|
||||||
("testOverrideForNewKeys", testOverrideForNewKeys),
|
|
||||||
("testOverrideRemovalFailureNoMutableStoreContainsValue", testOverrideRemovalFailureNoMutableStoreContainsValue),
|
|
||||||
("testOverrideSuccess", testOverrideSuccess),
|
|
||||||
("testOverrideValueValidationFailureOptional", testOverrideValueValidationFailureOptional),
|
|
||||||
("testOverrideValueValidationFailureTypeMismatch", testOverrideValueValidationFailureTypeMismatch),
|
|
||||||
("testOverrideValueValidationSuccess", testOverrideValueValidationSuccess),
|
|
||||||
("testStringValueResolution", testStringValueResolution),
|
|
||||||
("testValueRetrieval", testValueRetrieval),
|
|
||||||
("testValueRetrievalFromEmptyStoresArray", testValueRetrievalFromEmptyStoresArray),
|
|
||||||
("testValueValidation", testValueValidation),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FeatureFlagTests {
|
|
||||||
// DO NOT MODIFY: This is autogenerated, use:
|
|
||||||
// `swift test --generate-linuxmain`
|
|
||||||
// to regenerate.
|
|
||||||
static let __allTests__FeatureFlagTests = [
|
|
||||||
("testBoolProjectedValue", testBoolProjectedValue),
|
|
||||||
("testBoolWrappedValue", testBoolWrappedValue),
|
|
||||||
("testIntProjectedValue", testIntProjectedValue),
|
|
||||||
("testIntWrappedValue", testIntWrappedValue),
|
|
||||||
("testNonexistentIntProjectedValue", testNonexistentIntProjectedValue),
|
|
||||||
("testNonexistentIntWrappedValue", testNonexistentIntWrappedValue),
|
|
||||||
("testNonexistentWrappedValueOverride", testNonexistentWrappedValueOverride),
|
|
||||||
("testOptionalIntProjectedValue", testOptionalIntProjectedValue),
|
|
||||||
("testOptionalIntValue", testOptionalIntValue),
|
|
||||||
("testStringProjectedValue", testStringProjectedValue),
|
|
||||||
("testStringWrappedValue", testStringWrappedValue),
|
|
||||||
("testWrappedValueOverride", testWrappedValueOverride),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension MutableStoreTests {
|
|
||||||
// DO NOT MODIFY: This is autogenerated, use:
|
|
||||||
// `swift test --generate-linuxmain`
|
|
||||||
// to regenerate.
|
|
||||||
static let __allTests__MutableStoreTests = [
|
|
||||||
("testChangeSaving", testChangeSaving),
|
|
||||||
("testOverride", testOverride),
|
|
||||||
("testOverrideRemoval", testOverrideRemoval),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension RuntimeOverridesStoreTests {
|
|
||||||
// DO NOT MODIFY: This is autogenerated, use:
|
|
||||||
// `swift test --generate-linuxmain`
|
|
||||||
// to regenerate.
|
|
||||||
static let __allTests__RuntimeOverridesStoreTests = [
|
|
||||||
("testRuntimeOverride", testRuntimeOverride),
|
|
||||||
("testRuntimeOverrideRemoval", testRuntimeOverrideRemoval),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension UserDefaultsStoreTests {
|
|
||||||
// DO NOT MODIFY: This is autogenerated, use:
|
|
||||||
// `swift test --generate-linuxmain`
|
|
||||||
// to regenerate.
|
|
||||||
static let __allTests__UserDefaultsStoreTests = [
|
|
||||||
("testChangeSaving", testChangeSaving),
|
|
||||||
("testReadValueWithResolver", testReadValueWithResolver),
|
|
||||||
("testRemoveValueWithResolver", testRemoveValueWithResolver),
|
|
||||||
("testWriteAndReadValueWithResolver", testWriteAndReadValueWithResolver),
|
|
||||||
("testWriteValueWithResolver", testWriteValueWithResolver),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
public func __allTests() -> [XCTestCaseEntry] {
|
|
||||||
return [
|
|
||||||
testCase(FeatureFlagResolverTests.__allTests__FeatureFlagResolverTests),
|
|
||||||
testCase(FeatureFlagTests.__allTests__FeatureFlagTests),
|
|
||||||
testCase(MutableStoreTests.__allTests__MutableStoreTests),
|
|
||||||
testCase(RuntimeOverridesStoreTests.__allTests__RuntimeOverridesStoreTests),
|
|
||||||
testCase(UserDefaultsStoreTests.__allTests__UserDefaultsStoreTests),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
#endif
|
|
|
@ -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
|
Loading…
Reference in New Issue