Skip to content

Commit

Permalink
Merge pull request #19 from AndreyZarembo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AndreyZarembo authored Aug 17, 2018
2 parents 8d862e9 + 1de718d commit 3035cd6
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
All notable changes to this project will be documented in this file.

#### 1.x Releases
- `1.4.x` Releases - [1.4.0](#140)
- `1.4.x` Releases - [1.4.0](#140) | [1.4.1](#141)
- `1.3.x` Releases - [1.3.0](#130) | [1.3.1](#131) | [1.3.2](#132) | [1.3.3](#133)
- `1.2.x` Releases - [1.2.0](#120)
- `1.1.x` Releases - [1.1.0](#110) | [1.1.1](#111)
- `1.0.x` Releases - [1.0.0](#100)

---

## [1.4.1](https://github.com/AndreyZarembo/EasyDi/releases/tag/1.4.1)
Released on 2017-10-17

#### Updated
- @dvi fixed Obj-C objects initialization for Swift 4.2

## [1.4.0](https://github.com/AndreyZarembo/EasyDi/releases/tag/1.4.0)
Released on 2017-10-23

Expand Down
2 changes: 1 addition & 1 deletion EasyDi-SupportingFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.4.0</string>
<string>1.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion EasyDi-macOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.4.0</string>
<string>1.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
4 changes: 2 additions & 2 deletions EasyDi.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EasyDi",
"version": "1.4.0",
"version": "1.4.1",
"summary": "Effective DI library for rapid development in 200 lines of code",
"description": "Swift 3 and 4, iOS 8+\nEasyDi contains a dependency container for Swift. The syntax of this library was specially designed for rapid development and effective use. It fits in 200 lines, thus can do everything you need for grown-up DI library:\n- Objects creating with dependencies and injection of dependencies into existing ones\n- Separation into assemblies\n- Types of dependency resolution: objects graph, singleton, prototype\n- Objects substitution and dependency contexts for tests",
"homepage": "https://github.com/AndreyZarembo/EasyDi.git",
Expand All @@ -13,7 +13,7 @@
},
"source": {
"git": "https://github.com/AndreyZarembo/EasyDi.git",
"tag": "1.4.0"
"tag": "1.4.1"
},
"social_media_url": "https://twitter.com/AndreyZarembo",
"platforms": {
Expand Down
8 changes: 6 additions & 2 deletions EasyDi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
8BEE13521F9A27C800A02331 /* EasyDi.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BEE13501F9A27C800A02331 /* EasyDi.h */; settings = {ATTRIBUTES = (Public, ); }; };
8BEE13531F9A27C800A02331 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8BEE13511F9A27C800A02331 /* Info.plist */; };
8BEE13561F9A27EA00A02331 /* EasyDi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BEE13551F9A27EA00A02331 /* EasyDi.swift */; };
8BEE13571F9A27F200A02331 /* EasyDi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BEE13551F9A27EA00A02331 /* EasyDi.swift */; };
C3614B541F1C8B6800B1F4A1 /* Test_Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3614B451F1C8B5F00B1F4A1 /* Test_Context.swift */; };
Expand All @@ -28,6 +27,8 @@
C37DEA341F1E9B2100279AD3 /* Test_ProtocolBasedInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3614B491F1C8B5F00B1F4A1 /* Test_ProtocolBasedInjection.swift */; };
C37DEA351F1E9B2100279AD3 /* Test_Scope.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3614B4A1F1C8B5F00B1F4A1 /* Test_Scope.swift */; };
C37DEA361F1E9B2100279AD3 /* Test_StructsInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3614B4B1F1C8B5F00B1F4A1 /* Test_StructsInjection.swift */; };
D2B16C972123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B16C962123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift */; };
D2B16C982123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B16C962123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift */; };
E6DCF5C61F2F62A600D9F8BC /* Test_CrossAssemblyInjections_SingletonCycle.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6DCF5C41F2F62A000D9F8BC /* Test_CrossAssemblyInjections_SingletonCycle.swift */; };
E6DCF5C71F2F62A700D9F8BC /* Test_CrossAssemblyInjections_SingletonCycle.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6DCF5C41F2F62A000D9F8BC /* Test_CrossAssemblyInjections_SingletonCycle.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -68,6 +69,7 @@
C37DEA1B1F1E9AA000279AD3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C37DEA241F1E9AE500279AD3 /* EasyDi_macOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "EasyDi_macOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
C37DEA281F1E9AE500279AD3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D2B16C962123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Test_ImplicitlyUnwrappedOptional.swift; sourceTree = "<group>"; };
E6DCF5C41F2F62A000D9F8BC /* Test_CrossAssemblyInjections_SingletonCycle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Test_CrossAssemblyInjections_SingletonCycle.swift; path = Tests/Test_CrossAssemblyInjections_SingletonCycle.swift; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -132,6 +134,7 @@
C3614B471F1C8B5F00B1F4A1 /* Test_Injections.swift */,
C3614B481F1C8B5F00B1F4A1 /* Test_Patches.swift */,
C3614B491F1C8B5F00B1F4A1 /* Test_ProtocolBasedInjection.swift */,
D2B16C962123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift */,
C3614B4A1F1C8B5F00B1F4A1 /* Test_Scope.swift */,
C3614B4B1F1C8B5F00B1F4A1 /* Test_StructsInjection.swift */,
);
Expand Down Expand Up @@ -332,7 +335,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8BEE13531F9A27C800A02331 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -359,6 +361,7 @@
files = (
C3614B571F1C8B6800B1F4A1 /* Test_Patches.swift in Sources */,
C3614B551F1C8B6800B1F4A1 /* Test_CrossAssemblyInjections.swift in Sources */,
D2B16C972123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift in Sources */,
C3614B591F1C8B6800B1F4A1 /* Test_Scope.swift in Sources */,
C3614B541F1C8B6800B1F4A1 /* Test_Context.swift in Sources */,
C3614B561F1C8B6800B1F4A1 /* Test_Injections.swift in Sources */,
Expand Down Expand Up @@ -390,6 +393,7 @@
files = (
C37DEA361F1E9B2100279AD3 /* Test_StructsInjection.swift in Sources */,
C37DEA331F1E9B2100279AD3 /* Test_Patches.swift in Sources */,
D2B16C982123116500CF69E8 /* Test_ImplicitlyUnwrappedOptional.swift in Sources */,
C37DEA311F1E9B2100279AD3 /* Test_CrossAssemblyInjections.swift in Sources */,
C37DEA321F1E9B2100279AD3 /* Test_Injections.swift in Sources */,
C37DEA301F1E9B2100279AD3 /* Test_Context.swift in Sources */,
Expand Down
8 changes: 8 additions & 0 deletions EasyDi.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
6 changes: 4 additions & 2 deletions Sources/EasyDi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,11 @@ open class Assembly: AssemblyInternal {
result = singleton as! ObjectType

// And trying to return object from graph
} else if let objectFromStack = context.objectGraphStorage[key] as? ObjectType, scope != .prototype {
} else if let objectFromStack = context.objectGraphStorage[key],
scope != .prototype,
let unwrappedObject = objectFromStack as? ObjectType {

result = objectFromStack
result = unwrappedObject

} else {

Expand Down
40 changes: 40 additions & 0 deletions Tests/Test_ImplicitlyUnwrappedOptional.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Test_ImplicitlyUnwrappedOptional.swift
// EasyDi
//
// Created by a.teplyakov on 14/08/2018.
// Copyright © 2018 AndreyZarembo. All rights reserved.
//

import Foundation
import XCTest
import EasyDi
/*
As part of fully implementing (SE–0054), ImplicitlyUnwrappedOptional<T> is now an unavailable typealias of Optional<T>. Declarations annotated with ‘!’ have the type Optional<T>. If an expression involving one of these values will not compile successfully with the type Optional<T>, it is implicitly unwrapped, producing a value of type T. In some cases this will cause code that previously compiled to require updating. Please see this blog post for more information: (Reimplementation of Implicitly Unwrapped Optionals). (33272674)

https://swift.org/blog/iuo/
*/
class Test_ImplicitlyUnwrappedOptional: XCTestCase {

// Setup

class ObjectGraphAssembly: Assembly {

var testObject: TestObject {
return define(init: TestObject.object()) {
return $0
}
}
}

class TestObject {
class func object() -> TestObject! {
return TestObject()
}
}

func testClassInitializator() {
let testObject = ObjectGraphAssembly.instance().testObject
XCTAssertNotNil(testObject)
}
}

0 comments on commit 3035cd6

Please sign in to comment.