Skip to content

Commit

Permalink
version 4.4.0 - increase minimum OS version. remove SpinLock. Update …
Browse files Browse the repository at this point in the history
…readme.
  • Loading branch information
Alexander Ivlev committed Jun 2, 2023
1 parent 1df9731 commit f435228
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 68 deletions.
4 changes: 4 additions & 0 deletions 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

Expand Down
12 changes: 6 additions & 6 deletions 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
Expand All @@ -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'
Expand Down
32 changes: 24 additions & 8 deletions DITranquillity.xcodeproj/project.pbxproj
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -381,13 +383,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
ABC184872A2A675000C1DEB0 /* SwiftLazy in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
169C0E431DA35CBE001F0AD5 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
ABC184892A2A675500C1DEB0 /* SwiftLazy in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -761,6 +765,7 @@
);
name = "DITranquillity-OSX";
packageProductDependencies = (
ABC184862A2A675000C1DEB0 /* SwiftLazy */,
);
productName = DITranquillity;
productReference = 169C0DE51DA3501F001F0AD5 /* DITranquillity.framework */;
Expand All @@ -781,6 +786,7 @@
);
name = "DITranquillity-tvOS";
packageProductDependencies = (
ABC184882A2A675500C1DEB0 /* SwiftLazy */,
);
productName = DITranquillity;
productReference = 169C0E4B1DA35CBE001F0AD5 /* DITranquillity.framework */;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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" */;
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Expand Up @@ -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: [
Expand Down
13 changes: 4 additions & 9 deletions README.md
Expand Up @@ -5,9 +5,8 @@
<a href="http://cocoapods.org/pods/DITranquillity"><img src ="https://img.shields.io/cocoapods/v/DITranquillity.svg?style=flat"/></a>
<a href="https://github.com/Carthage/Carthage"><img src ="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat"/></a>
<a href="https://swift.org/package-manager"><img src ="https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat"/></a>
<a href="https://travis-ci.org/ivlevAstef/DITranquillity"><img src ="https://travis-ci.org/ivlevAstef/DITranquillity.svg?tag=v4.1.0"/></a>
<a href="https://github.com/ivlevAstef/DITranquillity/blob/master/LICENSE"><img src ="https://img.shields.io/github/license/ivlevAstef/DITranquillity.svg?maxAge=2592000"/></a>
<a href="https://developer.apple.com/swift"><img src ="https://img.shields.io/badge/Swift-3.0--5.3-F16D39.svg?style=flat"/></a>
<a href="https://developer.apple.com/swift"><img src ="https://img.shields.io/badge/Swift-3.0--5.8-F16D39.svg?style=flat"/></a>
<a href="http://cocoapods.org/pods/DITranquillity"><img src ="https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux-lightgrey.svg"/></a>
<a href="https://codecov.io/gh/ivlevAstef/DITranquillity"><img src ="https://codecov.io/gh/ivlevAstef/DITranquillity/branch/master/graph/badge.svg"/></a>
</p>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
13 changes: 4 additions & 9 deletions README_ru.md
Expand Up @@ -5,9 +5,8 @@
<a href="http://cocoapods.org/pods/DITranquillity"><img src ="https://img.shields.io/cocoapods/v/DITranquillity.svg?style=flat"/></a>
<a href="https://github.com/Carthage/Carthage"><img src ="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat"/></a>
<a href="https://swift.org/package-manager"><img src ="https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat"/></a>
<a href="https://travis-ci.org/ivlevAstef/DITranquillity"><img src ="https://travis-ci.org/ivlevAstef/DITranquillity.svg?tag=v4.1.0"/></a>
<a href="https://github.com/ivlevAstef/DITranquillity/blob/master/LICENSE"><img src ="https://img.shields.io/github/license/ivlevAstef/DITranquillity.svg?maxAge=2592000"/></a>
<a href="https://developer.apple.com/swift"><img src ="https://img.shields.io/badge/Swift-3.0--5.3-F16D39.svg?style=flat"/></a>
<a href="https://developer.apple.com/swift"><img src ="https://img.shields.io/badge/Swift-3.0--5.8-F16D39.svg?style=flat"/></a>
<a href="http://cocoapods.org/pods/DITranquillity"><img src ="https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux-lightgrey.svg"/></a>
<a href="https://codecov.io/gh/ivlevAstef/DITranquillity"><img src ="https://codecov.io/gh/ivlevAstef/DITranquillity/branch/master/graph/badge.svg"/></a>
</p>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
38 changes: 4 additions & 34 deletions Sources/Core/Internal/threads/FastLock.swift
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion jazzy.sh
Expand Up @@ -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/ \
Expand Down

0 comments on commit f435228

Please sign in to comment.