Skip to content

Commit bdf4477

Browse files
authored
Merge pull request #131 from AliSoftware/release/5.0.3
Release 5.0.3
2 parents a1ece4b + 84573d9 commit bdf4477

26 files changed

+2152
-832
lines changed

.travis.yml

+19
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ matrix:
2929
- tar xzf $SWIFT_VERSION-ubuntu14.04.tar.gz
3030
- export PATH="${PWD}/${SWIFT_VERSION}-ubuntu14.04/usr/bin:${PATH}"
3131
- cd Dip
32+
- script:
33+
- swift build --clean && swift build
34+
os: linux
35+
dist: trusty
36+
sudo: required
37+
language: generic
38+
before_install:
39+
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
40+
- cd ..
41+
- export SWIFT_VERSION=swift-DEVELOPMENT-SNAPSHOT-2016-09-07-a
42+
- wget https://swift.org/builds/development/ubuntu1404/$SWIFT_VERSION/$SWIFT_VERSION-ubuntu14.04.tar.gz
43+
- tar xzf $SWIFT_VERSION-ubuntu14.04.tar.gz
44+
- export PATH="${PWD}/${SWIFT_VERSION}-ubuntu14.04/usr/bin:${PATH}"
45+
- export SWIFT_RELEASE_VERSION=2.2.1
46+
- export SWIFT_RELEASE_NAME="${SWIFT_RELEASE_VERSION}-RELEASE"
47+
- wget https://swift.org/builds/swift-$SWIFT_RELEASE_VERSION-release/ubuntu1404/swift-$SWIFT_RELEASE_NAME/swift-$SWIFT_RELEASE_NAME-ubuntu14.04.tar.gz
48+
- tar xzf swift-$SWIFT_RELEASE_NAME-ubuntu14.04.tar.gz
49+
- export SWIFT_EXEC="${PWD}/swift-${SWIFT_RELEASE_NAME}-ubuntu14.04/usr/bin/swiftc"
50+
- cd Dip
3251

3352
notifications:
3453
email: false

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## 5.0.3
4+
5+
* Added Swift 2.3 compatibility. `swift2.3` brunch is no longer maintained.
6+
[#127](https://github.com/AliSoftware/Dip/issues/127), [@ilyapuchka](https://github.com/ilyapuchka)
7+
8+
#### Fixed
9+
10+
* Fixed reusing instances registered with `WeakSingleton` scope
11+
[#129](https://github.com/AliSoftware/Dip/issues/129), [@ilyapuchka](https://github.com/ilyapuchka)
12+
313
## 5.0.2
414

515
#### Fixed

Dip.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Dip"
3-
s.version = "5.0.2"
3+
s.version = "5.0.3"
44
s.summary = "Dependency Injection for Swift made easy."
55

66
s.description = <<-DESC

Dip/Dip.xcodeproj/project.pbxproj

+50-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
0919F4D61C16417B00DC3B10 /* RuntimeArguments.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0919F4CC1C16417000DC3B10 /* RuntimeArguments.swift */; };
1515
095F829C1D043B41008CD706 /* TypeForwarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095F829B1D043B41008CD706 /* TypeForwarding.swift */; };
1616
0982AF0C1C5183A000B62463 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0982AF0B1C5183A000B62463 /* Utils.swift */; };
17+
09871B411DAA6BF300B40B91 /* Compatibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09871B401DAA6BF300B40B91 /* Compatibility.swift */; };
1718
09873F561C1E0237000C02F6 /* AutoInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09873F551C1E0237000C02F6 /* AutoInjection.swift */; };
1819
09B036001C5D2B83001EA5B7 /* AutoWiring.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09B035FF1C5D2B83001EA5B7 /* AutoWiring.swift */; };
1920
09BD350E1D84E30D00B33E53 /* AutoInjectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09BD35041D84E30D00B33E53 /* AutoInjectionTests.swift */; };
@@ -26,6 +27,17 @@
2627
09BD35151D84E30D00B33E53 /* ThreadSafetyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09BD350B1D84E30D00B33E53 /* ThreadSafetyTests.swift */; };
2728
09BD35161D84E30D00B33E53 /* TypeForwardingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09BD350C1D84E30D00B33E53 /* TypeForwardingTests.swift */; };
2829
09BD35171D84E30D00B33E53 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09BD350D1D84E30D00B33E53 /* Utils.swift */; };
30+
09FC48061DAA9AC700566AA8 /* Resolve_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC48041DAA9AC700566AA8 /* Resolve_swift2.swift */; };
31+
09FC48071DAA9AC700566AA8 /* Resolve.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC48051DAA9AC700566AA8 /* Resolve.swift */; };
32+
09FC480F1DAA9CAF00566AA8 /* Register.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC480C1DAA9CAF00566AA8 /* Register.swift */; };
33+
09FC48101DAA9CAF00566AA8 /* Register_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC480D1DAA9CAF00566AA8 /* Register_swift2.swift */; };
34+
09FC48141DAA9E0200566AA8 /* AutoInjection_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC48121DAA9E0200566AA8 /* AutoInjection_swift2.swift */; };
35+
09FC48181DAAA53100566AA8 /* DipError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC48161DAAA53100566AA8 /* DipError.swift */; };
36+
09FC48191DAAA53100566AA8 /* DipError_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC48171DAAA53100566AA8 /* DipError_swift2.swift */; };
37+
09FC481B1DAAA82800566AA8 /* RuntimeArguments_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC481A1DAAA82800566AA8 /* RuntimeArguments_swift2.swift */; };
38+
09FC481E1DAAA8F900566AA8 /* ComponentScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC481C1DAAA8F900566AA8 /* ComponentScope.swift */; };
39+
09FC481F1DAAA8F900566AA8 /* ComponentScope_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC481D1DAAA8F900566AA8 /* ComponentScope_swift2.swift */; };
40+
09FC48211DAAAC4700566AA8 /* TypeForwarding_swift2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FC48201DAAAC4700566AA8 /* TypeForwarding_swift2.swift */; };
2941
/* End PBXBuildFile section */
3042

3143
/* Begin PBXContainerItemProxy section */
@@ -49,6 +61,7 @@
4961
0919F4D11C16417000DC3B10 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5062
095F829B1D043B41008CD706 /* TypeForwarding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TypeForwarding.swift; path = ../../Sources/TypeForwarding.swift; sourceTree = "<group>"; };
5163
0982AF0B1C5183A000B62463 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Utils.swift; path = ../../Sources/Utils.swift; sourceTree = "<group>"; };
64+
09871B401DAA6BF300B40B91 /* Compatibility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Compatibility.swift; path = ../../Sources/Compatibility.swift; sourceTree = "<group>"; };
5265
09873F551C1E0237000C02F6 /* AutoInjection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AutoInjection.swift; path = ../../Sources/AutoInjection.swift; sourceTree = "<group>"; };
5366
09B035FF1C5D2B83001EA5B7 /* AutoWiring.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AutoWiring.swift; path = ../../Sources/AutoWiring.swift; sourceTree = "<group>"; };
5467
09BD35041D84E30D00B33E53 /* AutoInjectionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AutoInjectionTests.swift; path = ../../Tests/DipTests/AutoInjectionTests.swift; sourceTree = "<group>"; };
@@ -61,6 +74,17 @@
6174
09BD350B1D84E30D00B33E53 /* ThreadSafetyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ThreadSafetyTests.swift; path = ../../Tests/DipTests/ThreadSafetyTests.swift; sourceTree = "<group>"; };
6275
09BD350C1D84E30D00B33E53 /* TypeForwardingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TypeForwardingTests.swift; path = ../../Tests/DipTests/TypeForwardingTests.swift; sourceTree = "<group>"; };
6376
09BD350D1D84E30D00B33E53 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Utils.swift; path = ../../Tests/DipTests/Utils.swift; sourceTree = "<group>"; };
77+
09FC48041DAA9AC700566AA8 /* Resolve_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Resolve_swift2.swift; path = ../../Sources/Resolve_swift2.swift; sourceTree = "<group>"; };
78+
09FC48051DAA9AC700566AA8 /* Resolve.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Resolve.swift; path = ../../Sources/Resolve.swift; sourceTree = "<group>"; };
79+
09FC480C1DAA9CAF00566AA8 /* Register.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Register.swift; path = ../../Sources/Register.swift; sourceTree = "<group>"; };
80+
09FC480D1DAA9CAF00566AA8 /* Register_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Register_swift2.swift; path = ../../Sources/Register_swift2.swift; sourceTree = "<group>"; };
81+
09FC48121DAA9E0200566AA8 /* AutoInjection_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AutoInjection_swift2.swift; path = ../../Sources/AutoInjection_swift2.swift; sourceTree = "<group>"; };
82+
09FC48161DAAA53100566AA8 /* DipError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DipError.swift; path = ../../Sources/DipError.swift; sourceTree = "<group>"; };
83+
09FC48171DAAA53100566AA8 /* DipError_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DipError_swift2.swift; path = ../../Sources/DipError_swift2.swift; sourceTree = "<group>"; };
84+
09FC481A1DAAA82800566AA8 /* RuntimeArguments_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RuntimeArguments_swift2.swift; path = ../../Sources/RuntimeArguments_swift2.swift; sourceTree = "<group>"; };
85+
09FC481C1DAAA8F900566AA8 /* ComponentScope.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ComponentScope.swift; path = ../../Sources/ComponentScope.swift; sourceTree = "<group>"; };
86+
09FC481D1DAAA8F900566AA8 /* ComponentScope_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ComponentScope_swift2.swift; path = ../../Sources/ComponentScope_swift2.swift; sourceTree = "<group>"; };
87+
09FC48201DAAAC4700566AA8 /* TypeForwarding_swift2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TypeForwarding_swift2.swift; path = ../../Sources/TypeForwarding_swift2.swift; sourceTree = "<group>"; };
6488
/* End PBXFileReference section */
6589

6690
/* Begin PBXFrameworksBuildPhase section */
@@ -87,12 +111,24 @@
87111
children = (
88112
0919F4C91C16417000DC3B10 /* Dip.h */,
89113
0919F4CA1C16417000DC3B10 /* Dip.swift */,
114+
09FC48161DAAA53100566AA8 /* DipError.swift */,
115+
09FC48171DAAA53100566AA8 /* DipError_swift2.swift */,
116+
09FC480C1DAA9CAF00566AA8 /* Register.swift */,
117+
09FC480D1DAA9CAF00566AA8 /* Register_swift2.swift */,
118+
09FC48051DAA9AC700566AA8 /* Resolve.swift */,
119+
09FC48041DAA9AC700566AA8 /* Resolve_swift2.swift */,
90120
0919F4C81C16417000DC3B10 /* Definition.swift */,
121+
09FC481C1DAAA8F900566AA8 /* ComponentScope.swift */,
122+
09FC481D1DAAA8F900566AA8 /* ComponentScope_swift2.swift */,
91123
0919F4CC1C16417000DC3B10 /* RuntimeArguments.swift */,
124+
09FC481A1DAAA82800566AA8 /* RuntimeArguments_swift2.swift */,
92125
09873F551C1E0237000C02F6 /* AutoInjection.swift */,
126+
09FC48121DAA9E0200566AA8 /* AutoInjection_swift2.swift */,
93127
09B035FF1C5D2B83001EA5B7 /* AutoWiring.swift */,
94128
095F829B1D043B41008CD706 /* TypeForwarding.swift */,
129+
09FC48201DAAAC4700566AA8 /* TypeForwarding_swift2.swift */,
95130
0982AF0B1C5183A000B62463 /* Utils.swift */,
131+
09871B401DAA6BF300B40B91 /* Compatibility.swift */,
96132
0919F4CB1C16417000DC3B10 /* Info.plist */,
97133
);
98134
path = Dip;
@@ -246,13 +282,25 @@
246282
isa = PBXSourcesBuildPhase;
247283
buildActionMask = 2147483647;
248284
files = (
285+
09871B411DAA6BF300B40B91 /* Compatibility.swift in Sources */,
249286
0982AF0C1C5183A000B62463 /* Utils.swift in Sources */,
287+
09FC481F1DAAA8F900566AA8 /* ComponentScope_swift2.swift in Sources */,
250288
0919F4D51C16417B00DC3B10 /* Definition.swift in Sources */,
289+
09FC48061DAA9AC700566AA8 /* Resolve_swift2.swift in Sources */,
290+
09FC48101DAA9CAF00566AA8 /* Register_swift2.swift in Sources */,
291+
09FC48191DAAA53100566AA8 /* DipError_swift2.swift in Sources */,
292+
09FC481E1DAAA8F900566AA8 /* ComponentScope.swift in Sources */,
293+
09FC48211DAAAC4700566AA8 /* TypeForwarding_swift2.swift in Sources */,
251294
09B036001C5D2B83001EA5B7 /* AutoWiring.swift in Sources */,
252295
0919F4D41C16417B00DC3B10 /* Dip.swift in Sources */,
296+
09FC481B1DAAA82800566AA8 /* RuntimeArguments_swift2.swift in Sources */,
297+
09FC480F1DAA9CAF00566AA8 /* Register.swift in Sources */,
298+
09FC48071DAA9AC700566AA8 /* Resolve.swift in Sources */,
253299
095F829C1D043B41008CD706 /* TypeForwarding.swift in Sources */,
254300
09873F561C1E0237000C02F6 /* AutoInjection.swift in Sources */,
301+
09FC48181DAAA53100566AA8 /* DipError.swift in Sources */,
255302
0919F4D61C16417B00DC3B10 /* RuntimeArguments.swift in Sources */,
303+
09FC48141DAA9E0200566AA8 /* AutoInjection_swift2.swift in Sources */,
256304
);
257305
runOnlyForDeploymentPostprocessing = 0;
258306
};
@@ -379,7 +427,7 @@
379427
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
380428
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
381429
COPY_PHASE_STRIP = NO;
382-
CURRENT_PROJECT_VERSION = 5.0.2;
430+
CURRENT_PROJECT_VERSION = 5.0.3;
383431
DEBUG_INFORMATION_FORMAT = dwarf;
384432
ENABLE_STRICT_OBJC_MSGSEND = YES;
385433
ENABLE_TESTABILITY = YES;
@@ -434,7 +482,7 @@
434482
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
435483
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
436484
COPY_PHASE_STRIP = NO;
437-
CURRENT_PROJECT_VERSION = 5.0.2;
485+
CURRENT_PROJECT_VERSION = 5.0.3;
438486
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
439487
ENABLE_NS_ASSERTIONS = NO;
440488
ENABLE_STRICT_OBJC_MSGSEND = YES;

README.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
66
[![License](https://img.shields.io/cocoapods/l/Dip.svg?style=flat)](http://cocoapods.org/pods/Dip)
77
[![Platform](https://img.shields.io/cocoapods/p/Dip.svg?style=flat)](http://cocoapods.org/pods/Dip)
8-
[![Swift Version](https://img.shields.io/badge/Swift-2.2--3.0-F16D39.svg?style=flat)](https://developer.apple.com/swift)
8+
[![Swift Version](https://img.shields.io/badge/Swift-2.3--3.0-F16D39.svg?style=flat)](https://developer.apple.com/swift)
99
[![Swift Version](https://img.shields.io/badge/Linux-3.0--RELEASE-4BC51D.svg?style=flat)](https://developer.apple.com/swift)
1010

1111
![Animated Dipping GIF](cinnamon-pretzels-caramel-dipping.gif)
@@ -148,16 +148,25 @@ File an issue if you have any question. Pull requests are warmly welcome too.
148148

149149
## Installation
150150

151-
Since version 5.0.0 Dip is built with Swift 3.0. For Swift 2.2-2.3 compatible version use "swift2.3" branch.
152-
153-
You can install Dip using your favorite dependency manager:
151+
Since version 5.0.0 Dip is built with Swift 3.0. You can install Dip using your favorite dependency manager:
154152

155153
<details>
156154
<summary>CocoaPods</summary>
157155

156+
`pod "Dip"`
157+
158+
To build for Swift 2.3 add this code to the bottom of your Podfile
159+
158160
```ruby
159-
pod "Dip"
161+
post_install do |installer|
162+
installer.pods_project.targets.each do |target|
163+
target.build_configurations.each do |config|
164+
config.build_settings['SWIFT_VERSION'] = '2.3'
165+
end
166+
end
167+
end
160168
```
169+
161170
> You need at least 1.1.0.rc.2 version of CocoaPods.
162171
163172
</details>
@@ -169,6 +178,8 @@ pod "Dip"
169178
github "AliSoftware/Dip"
170179
```
171180

181+
To build for Swift 2.3 run Carthage with `--toolchain com.apple.dt.toolchain.Swift_2_3` option.
182+
172183
</details>
173184

174185
<details>

0 commit comments

Comments
 (0)