diff --git a/CHANGELOG.md b/CHANGELOG.md index 4adac94..b1d3013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 4.4.0 +* Increase minimal version iOS 11.0, tvOS 11.0, macOS 10.13, watchOS 4.0 +* Remove SpinLock + # 4.3.5 * fix makeGraph while use container hierarchy diff --git a/DITranquillity.podspec b/DITranquillity.podspec index 4959064..eb99366 100644 --- a/DITranquillity.podspec +++ b/DITranquillity.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'DITranquillity' - s.version = '4.3.5' + s.version = '4.4.0' s.summary = 'DITranquillity - Dependency injection for iOS/macOS/tvOS (Swift) ' s.description = <<-DESC @@ -18,12 +18,12 @@ Pod::Spec.new do |s| s.requires_arc = true s.swift_version = '5.1' - s.dependency 'SwiftLazy', '>= 1.1.6' + s.dependency 'SwiftLazy', '>= 1.2.0' - s.ios.deployment_target = '8.0' - s.tvos.deployment_target = '9.0' - s.osx.deployment_target = '10.10' - s.watchos.deployment_target = '2.0' + s.ios.deployment_target = '11.0' + s.tvos.deployment_target = '11.0' + s.osx.deployment_target = '10.13' + s.watchos.deployment_target = '4.0' # subspecs is very long validation - 'pod lib lint' check all combination.... core_h = 'Sources/DITranquillity.h' diff --git a/DITranquillity.xcodeproj/project.pbxproj b/DITranquillity.xcodeproj/project.pbxproj index c542ebb..2ab4787 100644 --- a/DITranquillity.xcodeproj/project.pbxproj +++ b/DITranquillity.xcodeproj/project.pbxproj @@ -60,6 +60,8 @@ ABBE383E25FDE60F00DAFB62 /* ThreadDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBE383C25FDE60F00DAFB62 /* ThreadDictionary.swift */; }; ABBE383F25FDE60F00DAFB62 /* ThreadDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBE383C25FDE60F00DAFB62 /* ThreadDictionary.swift */; }; ABBE384025FDE60F00DAFB62 /* ThreadDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBE383C25FDE60F00DAFB62 /* ThreadDictionary.swift */; }; + ABC184872A2A675000C1DEB0 /* SwiftLazy in Frameworks */ = {isa = PBXBuildFile; productRef = ABC184862A2A675000C1DEB0 /* SwiftLazy */; }; + ABC184892A2A675500C1DEB0 /* SwiftLazy in Frameworks */ = {isa = PBXBuildFile; productRef = ABC184882A2A675500C1DEB0 /* SwiftLazy */; }; ABDA289B23ABBECD00BEB63F /* DIStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE60EDC23AA75AC00DEA34A /* DIStorage.swift */; }; ABDA289C23ABBECD00BEB63F /* DIContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE60EDB23AA75AC00DEA34A /* DIContainer.swift */; }; ABDA289E23ABBECD00BEB63F /* Multithread.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE60EB923AA75AC00DEA34A /* Multithread.swift */; }; @@ -381,6 +383,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + ABC184872A2A675000C1DEB0 /* SwiftLazy in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -388,6 +391,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + ABC184892A2A675500C1DEB0 /* SwiftLazy in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -761,6 +765,7 @@ ); name = "DITranquillity-OSX"; packageProductDependencies = ( + ABC184862A2A675000C1DEB0 /* SwiftLazy */, ); productName = DITranquillity; productReference = 169C0DE51DA3501F001F0AD5 /* DITranquillity.framework */; @@ -781,6 +786,7 @@ ); name = "DITranquillity-tvOS"; packageProductDependencies = ( + ABC184882A2A675500C1DEB0 /* SwiftLazy */, ); productName = DITranquillity; productReference = 169C0E4B1DA35CBE001F0AD5 /* DITranquillity.framework */; @@ -1225,7 +1231,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 4.3.4; OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.sia.DITranquillity-OSX"; @@ -1265,7 +1271,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 4.3.4; OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.sia.DITranquillity-OSX"; @@ -1320,7 +1326,7 @@ SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 11.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; @@ -1362,7 +1368,7 @@ SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 11.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; @@ -1506,7 +1512,7 @@ GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.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", @@ -1550,7 +1556,7 @@ GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.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", @@ -1616,7 +1622,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -1661,7 +1667,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -1814,6 +1820,16 @@ package = AB393BAC28782717001DEFC7 /* XCRemoteSwiftPackageReference "SwiftLazy" */; productName = SwiftLazy; }; + ABC184862A2A675000C1DEB0 /* SwiftLazy */ = { + isa = XCSwiftPackageProductDependency; + package = AB393BAC28782717001DEFC7 /* XCRemoteSwiftPackageReference "SwiftLazy" */; + productName = SwiftLazy; + }; + ABC184882A2A675500C1DEB0 /* SwiftLazy */ = { + isa = XCSwiftPackageProductDependency; + package = AB393BAC28782717001DEFC7 /* XCRemoteSwiftPackageReference "SwiftLazy" */; + productName = SwiftLazy; + }; ABDA289823ABBECD00BEB63F /* SwiftLazy */ = { isa = XCSwiftPackageProductDependency; package = ABDA289923ABBECD00BEB63F /* XCRemoteSwiftPackageReference "SwiftLazy" */; diff --git a/Package.swift b/Package.swift index b45ebef..f222ef1 100755 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ let package = Package( .library(name: "DITranquillity", targets: ["DITranquillity"]) ], dependencies: [ - .package(url: "https://github.com/ivlevAstef/SwiftLazy.git", from: "1.1.9") + .package(url: "https://github.com/ivlevAstef/SwiftLazy.git", from: "1.2.0") ], targets: [ .target(name: "DITranquillity", dependencies: [ diff --git a/README.md b/README.md index 1d3c4f7..aeb5bb7 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,8 @@ - - +

@@ -67,7 +66,7 @@ https://github.com/ivlevAstef/DITranquillity Also you can edit your `Package.swift` and the following line into section `dependencies`: ```Swift -.package(url: "https://github.com/ivlevAstef/DITranquillity.git", from: "3.8.4") +.package(url: "https://github.com/ivlevAstef/DITranquillity.git", from: "4.4.0") ``` And don't forget to specify in your section `target` wrote dependency line: ```Swift @@ -205,9 +204,9 @@ Also your can read articles: * Ru! Old! [https://habr.com/ru/post/311334/](https://habr.com/ru/post/311334/) ## Requirements -iOS 9.0+,macOS 10.10+,tvOS 9.0+, watchOS, linux; ARC +iOS 11.0+,macOS 10.13+,tvOS 11.0+, watchOS 4.0+, Linux; ARC -* Swift 5.5-5.7: Xcode 13,14; version >= 3.6.3 +* Swift 5.5-5.8: Xcode 13,14; version >= 3.6.3 * Swift 5.0-5.3: Xcode 10.2-12.x; version >= 3.6.3 * Swift 4.2: Xcode 10; version >= 3.4.3 * Swift 4.1: Xcode 9.3; version >= 3.2.3 @@ -236,9 +235,5 @@ Please help library development and create [pull requests](https://github.com/iv ### Plea If you like my library, then support the library by putting star. -You can also support the author of the library with a donation: - -[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/ivlevAstef) - ### Question? You can feel free to ask the question at e-mail: ivlev.stef@gmail.com. diff --git a/README_ru.md b/README_ru.md index 848c370..e789ab7 100644 --- a/README_ru.md +++ b/README_ru.md @@ -5,9 +5,8 @@ - - +

@@ -65,7 +64,7 @@ https://github.com/ivlevAstef/DITranquillity ``` Или прописать в вашем `Package.swift` файле в секции `dependencies`: ```Swift -.package(url: "https://github.com/ivlevAstef/DITranquillity.git", from: "3.8.4") +.package(url: "https://github.com/ivlevAstef/DITranquillity.git", from: "4.4.0") ``` И не забудьте указать в таргете в аргументе `dependencies` зависимость на библиотеку: ```Swift @@ -203,9 +202,9 @@ class AuthInteractorImpl: AuthInteractor { * Старая [https://habr.com/ru/post/311334/](https://habr.com/ru/post/311334/) ## Требования -iOS 9.0+,macOS 10.10+,tvOS 9.0+, watchOS, linux; ARC +iOS 11.0+,macOS 10.13+,tvOS 11.0+, watchOS 4.0+, Linux; ARC -* Swift 5.5-5.7: Xcode 13,14; version >= 3.6.3 +* Swift 5.5-5.8: Xcode 13,14; version >= 3.6.3 * Swift 5.0-5.3: Xcode 10.2-12.x; version >= 3.6.3 * Swift 4.1: Xcode 9.3; version >= 3.2.3 * Swift 4.0: Xcode 9.0; version >= 3.0.5 @@ -233,9 +232,5 @@ iOS 9.0+,macOS 10.10+,tvOS 9.0+, watchOS, linux; ARC ### Просьба Если вам понравилась моя библиотека, то поддержите библиотеку поставив звёздочку. -Также вы можете поддержать развитие библиотеки небольшим денежным поощрением - ведь я пишу библиотеку длинными темными ночами. - -[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/ivlevAstef) - ### Остались вопросы? Я могу ответить на ваши вопросы по почте: ivlev.stef@gmail.com diff --git a/Sources/Core/Internal/threads/FastLock.swift b/Sources/Core/Internal/threads/FastLock.swift index c823496..7b1cf48 100644 --- a/Sources/Core/Internal/threads/FastLock.swift +++ b/Sources/Core/Internal/threads/FastLock.swift @@ -12,25 +12,11 @@ internal protocol FastLock { } internal func makeFastLock() -> FastLock { - #if os(iOS) - if #available(iOS 10.0, *) { - return UnfairLock() - } - #elseif os(OSX) - if #available(OSX 10.12, *) { - return UnfairLock() - } - #elseif os(tvOS) - if #available(tvOS 10.0, *) { - return UnfairLock() - } - #elseif os(watchOS) - if #available(watchOS 3.0, *) { - return UnfairLock() - } + #if os(Linux) + return SpinLock() + #else + return UnfairLock() #endif - - return SpinLock() } #if os(Linux) @@ -63,10 +49,6 @@ private class SpinLock: FastLock { import Darwin -@available(tvOS 10.0, *) -@available(OSX 10.12, *) -@available(iOS 10.0, *) -@available(watchOS 3.0, *) private class UnfairLock: FastLock { private let monitor: os_unfair_lock_t @@ -89,16 +71,4 @@ private class UnfairLock: FastLock { } } -private class SpinLock: FastLock { - private var monitor: OSSpinLock = OSSpinLock() - - func lock() { - OSSpinLockLock(&monitor) - } - - func unlock() { - OSSpinLockUnlock(&monitor) - } -} - #endif diff --git a/jazzy.sh b/jazzy.sh index 2d332be..da51b20 100644 --- a/jazzy.sh +++ b/jazzy.sh @@ -4,7 +4,7 @@ jazzy \ --author_url https://github.com/ivlevAstef \ --github_url https://github.com/ivlevAstef/DITranquillity \ --github-file-prefix https://github.com/ivlevAstef/DITranquillity/tree/master \ ---module-version 4.1.1 \ +--module-version 4.4.0 \ --xcodebuild-arguments -scheme,DITranquillity-iOS,-destination,generic/platform=iOS \ --module DITranquillity \ --root-url https://github.com/ivlevAstef/DITranquillity/code/ \