Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
76766a7
Setup fresh project
jakubvano Jul 10, 2019
30d0a15
Implement module builder
jakubvano Jul 13, 2019
7e4592f
Implement binding request definition
jakubvano Jul 13, 2019
5f3064e
Implement binding creation
jakubvano Jul 13, 2019
9f084ee
Implement binding operator
jakubvano Jul 13, 2019
1928d82
Implement property injector
jakubvano Jul 13, 2019
4baeb38
Draft API for injecting instances
jakubvano Jul 13, 2019
2ebeb76
Implement factory & value type provider
jakubvano Jul 13, 2019
e4c804e
Describe API for instance provision
jakubvano Jul 13, 2019
242d18d
Define behavior for tagging & multiple manipulators
jakubvano Jul 13, 2019
593fced
Use bound injectors when providing instance
jakubvano Jul 13, 2019
c370d1e
Enable reuse of instance provider for multiple descriptors
jakubvano Jul 13, 2019
8d7df31
Implement support for explicit provision dependency
jakubvano Jul 13, 2019
b51af8b
Rename Container to Swinject
jakubvano Jul 14, 2019
65b1041
Scrap injector functionality
jakubvano Jul 14, 2019
1e72c7a
Rename binding request to type binder
jakubvano Jul 14, 2019
bc7f26e
Rename module builder to tree builder
jakubvano Jul 14, 2019
a8f55ef
Rename stuff
jakubvano Jul 14, 2019
e04a997
Implement InstanceBinding
jakubvano Jul 14, 2019
69736d8
Refactor tree builder spec
jakubvano Jul 14, 2019
574561e
Reimplement Swinject injection [WIP]
jakubvano Jul 14, 2019
f45cb91
Integrate swift format
jakubvano Jul 14, 2019
9fb96eb
Integrate sourcery
jakubvano Jul 14, 2019
cbf63c2
Use sourcery generated mocks
jakubvano Jul 14, 2019
db70b96
Extend Swinject spec
jakubvano Jul 15, 2019
6f3c2a2
Restructure tests
jakubvano Jul 15, 2019
02a05f9
Define Injection API
jakubvano Jul 15, 2019
1609ce7
Implement provider injection
jakubvano Jul 15, 2019
760272f
Wrap type descriptor into binding key
jakubvano Jul 15, 2019
ecc423f
Add argument type to the binding
jakubvano Jul 15, 2019
72cdc67
Add argument type to the binding key
jakubvano Jul 15, 2019
6b170d5
Extend injector interface
jakubvano Jul 15, 2019
3e4e9a7
Implement binding key matching
jakubvano Jul 15, 2019
f33e474
Update swinject to match keys instead of descriptors
jakubvano Jul 15, 2019
8795946
Extend binding interface
jakubvano Jul 15, 2019
e286fc3
Implement factory binding
jakubvano Jul 15, 2019
f3834cc
Refactor provider injection
jakubvano Jul 16, 2019
96b6186
Implement factory injection
jakubvano Jul 16, 2019
1665be0
Make factory injection work properly with tags
jakubvano Jul 16, 2019
28b4370
Implement factory currying
jakubvano Jul 16, 2019
5cd4314
Cleanup API
jakubvano Jul 16, 2019
57e3c8f
Add context to binding invocation
jakubvano Jul 16, 2019
8a4d28f
Refactor bindings to single internal representation
jakubvano Jul 16, 2019
609821f
Implement contexted binding builder
jakubvano Jul 16, 2019
295c951
Add key matching test
jakubvano Jul 16, 2019
cd50265
Add context to binding request
jakubvano Jul 16, 2019
32a05a7
Add context to the binding key
jakubvano Jul 16, 2019
3a13529
Fix default context type
jakubvano Jul 16, 2019
e523670
Implement contexted resolver
jakubvano Jul 17, 2019
c953501
Extend Swinject specification
jakubvano Jul 17, 2019
efd8265
Enable code coverage gathering
jakubvano Jul 17, 2019
27c81d0
Extend API spec [WIP]
jakubvano Jul 17, 2019
ee1aa7b
Update injection api spec
jakubvano Jul 17, 2019
cb5bb67
Rename binding to instance maker
jakubvano Jul 17, 2019
6dc7638
Rename MakerEntry to Binding
jakubvano Jul 17, 2019
04d7735
Refactor Swinject to use binding as proxy for matching / creation
jakubvano Jul 17, 2019
08b2ce4
Move InstanceMaker extensions to tests
jakubvano Jul 17, 2019
7142487
Rename MakerRequest to InstanceRequest
jakubvano Jul 17, 2019
d8c94bf
Update api spec
jakubvano Jul 17, 2019
ce22adf
Define scope concept
jakubvano Jul 17, 2019
ed10c5c
Use BinderEnvironment to produce an instance maker
jakubvano Jul 17, 2019
decb745
Implement scoped instance maker with explicit scope
jakubvano Jul 17, 2019
6a85c41
Implement scoped instance maker on implicit scope
jakubvano Jul 17, 2019
1859dbf
Reorganize code
jakubvano Jul 17, 2019
8a57926
Restructure code
jakubvano Jul 17, 2019
97bead8
Implement binding builders
jakubvano Jul 17, 2019
2126ed0
Update type binder implementation
jakubvano Jul 17, 2019
e18bd87
Implement scoped binding matching
jakubvano Jul 17, 2019
804c02b
Implement scoped binding's instance retrieval
jakubvano Jul 17, 2019
8aad2b5
Cleanup
jakubvano Jul 17, 2019
f1f9155
Implement registry key matching
jakubvano Jul 18, 2019
be0e47d
Implement matchable conformance for Tagged
jakubvano Jul 18, 2019
550484c
Implement standard scoped registry
jakubvano Jul 18, 2019
648f3ee
Close closable instances wher registry is released
jakubvano Jul 18, 2019
cdcf69c
Reimplement scoped binding
jakubvano Jul 18, 2019
4a384c9
Reimplement standard scope registry
jakubvano Jul 18, 2019
743c799
Implement unbounded scope
jakubvano Jul 18, 2019
291b4ae
Describe singleton API
jakubvano Jul 18, 2019
e229622
Restructure codebase to core & 3.0 API
jakubvano Jul 18, 2019
d04091e
Implement optional injecting
jakubvano Jul 18, 2019
a0f8ce9
Merge branch '3.0' into swift5
jakubvano Jul 21, 2019
947a0d5
Update filestructure
jakubvano Jul 21, 2019
e839b6c
Reconcile 2.0 & 3.0 conflicts
jakubvano Jul 21, 2019
3b1c8f3
Fix codestyle violations
jakubvano Jul 21, 2019
4651464
Resolve confilcts in tests
jakubvano Jul 21, 2019
35924f3
Add sourcery as prebuild step
jakubvano Jul 21, 2019
f7fc672
Remove redundant files
jakubvano Jul 21, 2019
fbb6a2f
Enable instance finalization within scope registry
jakubvano Jul 21, 2019
0608220
Remove Implementations of 2.0 API
jakubvano Jul 21, 2019
1ee3468
Remove specs testing implementation details of 2.0 API
jakubvano Jul 21, 2019
52b89d0
Draft service entry
jakubvano Jul 21, 2019
33069f3
Use sourcery for code generation
jakubvano Jul 21, 2019
85580ae
Implement ServiceEntry entry conformance to Binding
jakubvano Jul 21, 2019
c34dcca
Implement container registration
jakubvano Jul 21, 2019
ba5c8e8
Implement resolver legacy api
jakubvano Jul 21, 2019
255dff0
Support parent container
jakubvano Jul 21, 2019
8d2aac6
Implement behaviors
jakubvano Jul 21, 2019
8079f9d
Disable type forwarding test
jakubvano Jul 21, 2019
01c9b25
Implement graph resolution [wip]
jakubvano Jul 21, 2019
681b69f
Refactor context handling
jakubvano Jul 22, 2019
439c5e9
Make cyclic depdenencies work
jakubvano Jul 22, 2019
99ffb8f
Disable tests for instance wrappers
jakubvano Jul 22, 2019
cad3999
Disable description tests
jakubvano Jul 22, 2019
9254949
Implement partial support for object scopes
jakubvano Jul 22, 2019
7670e35
Disable failing tests
jakubvano Jul 22, 2019
fd5291b
Use context translators during request resolution
jakubvano Jul 22, 2019
ac72198
Describe context translator in api spec
jakubvano Jul 22, 2019
078acd3
Fix resolution when single binding matches multiple contexts
jakubvano Jul 22, 2019
089e74e
Fix ServiceEntry's binding key
jakubvano Jul 22, 2019
b056ed8
Implement container object scope
jakubvano Jul 22, 2019
3241356
FIx codestyle violations
jakubvano Jul 22, 2019
efbd5d2
Implement type forwarding
jakubvano Jul 23, 2019
ff5d99d
Support double optional injection
jakubvano Jul 23, 2019
cb9cbb4
Implement optional resolution
jakubvano Jul 23, 2019
e1185ce
Invoke behaviors for forwarded types
jakubvano Jul 23, 2019
6279795
Enable definition of custom default scope for container / assembler
jakubvano Jul 24, 2019
d1ee8bf
Implement strong reference
jakubvano Jul 24, 2019
ae06c8d
Integrate autocorrect & swiftformat as build phase
jakubvano Jul 24, 2019
275d07d
Implement weak reference maker
jakubvano Jul 24, 2019
0fc10de
Refactor reference type
jakubvano Jul 24, 2019
011b9e9
Use reference in scope registry interface
jakubvano Jul 24, 2019
9c36e4e
Update standard registry to properly handle references
jakubvano Jul 24, 2019
1a3a730
Add reference maker to scoped binding
jakubvano Jul 24, 2019
ed9fd07
Allow reference maker definition during scoped binder declaration
jakubvano Jul 24, 2019
7abecd7
Add reference maker to service entry
jakubvano Jul 24, 2019
e19fa1d
Make weak reference work with type erasure
jakubvano Jul 24, 2019
39b07ea
Update container specs
jakubvano Jul 25, 2019
cd9a140
Generate provider & instance injection api
jakubvano Jul 25, 2019
4eae5b0
Describe weakly referenced singleton API
jakubvano Jul 26, 2019
e8c4436
Fix type inference when binding protocol to implementation
jakubvano Jul 26, 2019
faecc58
Merge branch 'master' into 3.0
jakubvano Jul 26, 2019
201b02f
Bump xcode version in travis.yml
jakubvano Jul 26, 2019
f22165a
Use hash(into) instead of legacy hashValue in Matchable protocol
jakubvano Jul 26, 2019
605ffa7
Fix warnings in generated mocks
jakubvano Jul 26, 2019
b421d33
Enable code coverage gathering
jakubvano Jul 26, 2019
9e7ae69
Reset root scope before each api test
jakubvano Jul 26, 2019
17030ba
Tie lifetime of the service-entry instances to the container
jakubvano Jul 26, 2019
00a37ea
Describe multiton binding
jakubvano Jul 18, 2019
7272fab
Add templates to project.yml
jakubvano Jul 26, 2019
5f2ab4b
Define argument box
jakubvano Jul 26, 2019
61ab565
Make multitons work for single argument
jakubvano Jul 26, 2019
dfe9756
Implement argument boxing for injection methods
jakubvano Jul 26, 2019
3f3161a
Refactor injection api
jakubvano Jul 27, 2019
e847237
Create separate target for templates
jakubvano Jul 27, 2019
87a13d1
Implement code generation for injection & binder API
jakubvano Jul 27, 2019
363cf46
Remove api for creating multitons with non-matchable arguments
jakubvano Jul 27, 2019
4188287
Hide Tagged type descriptor
jakubvano Jul 27, 2019
3c851e2
Loosen type restrictions on BindingMaker
jakubvano Jul 27, 2019
2e70d92
Remove actual bindings from the public api
jakubvano Jul 27, 2019
6a619cc
Fix access modifiers on injection API
jakubvano Jul 27, 2019
f45c73c
Improve autocompletion on scoped / contexted environments
jakubvano Jul 27, 2019
3f606db
Make code compatible with Swift < 5.1
jakubvano Jul 27, 2019
a059cf9
Fix tests on linux SPM
jakubvano Jul 27, 2019
931a59d
Cleanup api spec
jakubvano Jul 27, 2019
f1c2f94
Implement debug description
jakubvano Jul 27, 2019
71769b2
Describe modules API
jakubvano Jul 27, 2019
1d15960
Separate module spec
jakubvano Jul 27, 2019
8d3da90
Separate scopes spec
jakubvano Jul 27, 2019
b18716a
Separate binding & optional tests
jakubvano Jul 27, 2019
353ad19
Fix assertion tests
jakubvano Jul 28, 2019
733b300
Replace injection unit tests with api spec
jakubvano Jul 28, 2019
b52d9f1
Extend binding spec
jakubvano Jul 28, 2019
e49dfe6
Move context test to separate spec
jakubvano Jul 28, 2019
31cb40a
Describe singleton & multiton bindings
jakubvano Jul 28, 2019
94a47d0
Extend scope spec
jakubvano Jul 28, 2019
b30fe1a
Remove mocks
jakubvano Jul 28, 2019
4427580
Rename Maker to Builder
jakubvano Jul 28, 2019
66f2ce9
Remove AnyBindingKey
jakubvano Jul 28, 2019
22e1029
Define instance retrieval API
jakubvano Jul 28, 2019
af9ab32
Define basic rules for duplicit bindings
jakubvano Jul 29, 2019
79cfc0a
Describe basic rules for binding overrides
jakubvano Jul 29, 2019
a5d9e9b
Define rules for overriding in modules
jakubvano Jul 29, 2019
9c50ce5
Add test for legacy behavior on duplicit registrations
jakubvano Jul 29, 2019
c101b40
Refactor swinject container builder
jakubvano Jul 30, 2019
c098328
Release instances in container scope as soon as it is cleared
jakubvano Jul 30, 2019
bce648c
Enable custom default scopes for container & assembler
jakubvano Jul 30, 2019
64aa82c
Fix override rules
jakubvano Jul 30, 2019
63d2700
Store bindings in a dictionary
jakubvano Aug 1, 2019
5a045b8
Make type forwarding work again
jakubvano Aug 1, 2019
2808eba
Improve hash computation performance
jakubvano Aug 2, 2019
bafe98c
Speed up binding key equality computation
jakubvano Aug 2, 2019
d1e2118
Fix scope registry key matching
jakubvano Aug 3, 2019
b635ebf
Remove redundant code
jakubvano Aug 3, 2019
4cf35f2
Implement lazy provider
jakubvano Aug 3, 2019
ac2292a
Refactor to enable injection of any property wrapper
jakubvano Aug 3, 2019
d515ca1
Enable nested property wrappers
jakubvano Aug 3, 2019
bde873b
Implement provider property wrapper
jakubvano Aug 3, 2019
5ecfcf9
Cleanup property wrapers resolution
jakubvano Aug 3, 2019
01bd01e
Refactor request resolution
jakubvano Aug 3, 2019
671f17f
Refactor type descriptor
jakubvano Aug 3, 2019
699282a
Make property wrappers compile on swift 5
jakubvano Aug 4, 2019
7ea1be7
Revert Provider behavior on graph scope
jakubvano Aug 4, 2019
e6cc08f
Do not release instance in .weak scope during graph resolution
jakubvano Aug 4, 2019
02fcc1b
Enable injection on optional contexts
jakubvano Aug 4, 2019
e3e2939
Implement function parameters injection
jakubvano Aug 4, 2019
87f1626
Allow only String as tag
jakubvano Aug 4, 2019
9e8542f
Illustrate property wrapper usage
jakubvano Aug 4, 2019
86557e9
Implement circular dependency detection
jakubvano Aug 4, 2019
9d005ba
Draft usage of Lazy & Weak wrappers to break circular dependencies
jakubvano Aug 4, 2019
5319ee0
Cleanup
jakubvano Aug 4, 2019
41e36d6
Cleanup context spec
jakubvano Aug 4, 2019
67fd9f3
Refactor swinject construction
jakubvano Aug 4, 2019
5596295
Update API / core separation
jakubvano Aug 4, 2019
2fdac3c
Pass binding builder to the tree builder
jakubvano Aug 8, 2019
a68e55d
Mark segfault
jakubvano Aug 24, 2019
9aba6bb
Rename binding builder
jakubvano Aug 24, 2019
5f704a5
Add type parametner to the instance request
jakubvano Aug 24, 2019
cc82f5d
Do not use builders during tree construction
jakubvano Aug 24, 2019
f73b1eb
Define 3.1 binding
jakubvano Aug 24, 2019
e66cee6
Rename BindingProperties
jakubvano Aug 24, 2019
ff9c7c7
Make context to be a property of the resolver
jakubvano Aug 24, 2019
79a9aeb
Draft new version of API
jakubvano Aug 24, 2019
1250d06
Update property wrappers
jakubvano Aug 24, 2019
7177068
Rewrite BindingSpec
jakubvano Aug 24, 2019
63032cc
Rewrite singleton spec
jakubvano Aug 24, 2019
b1d0d1b
Rewrite scopes spec
jakubvano Aug 24, 2019
e85efc6
Rewrite retrieval spec
jakubvano Aug 24, 2019
eb80388
Rewrite property wrappers spec
jakubvano Aug 24, 2019
326d271
Rewrite override spec
jakubvano Aug 24, 2019
4d64da9
Rewrite optionals spec
jakubvano Aug 24, 2019
3231435
Rewrite modules spec
jakubvano Aug 24, 2019
c7d0af4
Rewrite injection spec
jakubvano Aug 24, 2019
950b84f
Rewrite context spec
jakubvano Aug 24, 2019
732f658
Rewrite circularity spec
jakubvano Aug 24, 2019
1c708f7
Ditch bind Api
jakubvano Aug 24, 2019
a5e5660
Make matchboxes internal
jakubvano Aug 24, 2019
f204288
Implement multiple type binding
jakubvano Aug 24, 2019
c903b4b
Redesign injection API
jakubvano Aug 24, 2019
11b56a6
Draft support for instance retrieval
jakubvano Aug 24, 2019
1367dce
Fix compilation on < 5.1
jakubvano Aug 24, 2019
2a9edde
Describe behavior for throwing initializers
jakubvano Aug 24, 2019
00a196c
Refactor argument handling
jakubvano Aug 25, 2019
1050c78
Define partial requests
jakubvano Aug 25, 2019
2104220
Implement declarative function call binding api
jakubvano Aug 25, 2019
b97b7c9
Describe function call usage
jakubvano Aug 25, 2019
a8f309a
Check binding dependencies when constructing container
jakubvano Aug 25, 2019
13f2c64
Implement support for declarative property injection
jakubvano Aug 25, 2019
67a7ae8
Merge branch 'checked_binding' into 3.0
jakubvano Aug 25, 2019
78f6292
Add basic support for using modules in assembler
jakubvano Aug 25, 2019
25f9073
Remove matchable overloads from binding factory api
jakubvano Aug 25, 2019
42c57d6
Refine dependency checking
jakubvano Aug 29, 2019
4c5fda4
Reset request tracking only for delayed custom resolutions
jakubvano Aug 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .Package.Test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ let package = Package(
"Quick",
"Nimble",
"Swinject",
]
],
path: "Tests"
),
]
)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@ fastlane/screenshots
## Mac
.DS_Store

## Sourcery
.sourcery.dump

## Swinject
Swinject.framework.zip
6 changes: 6 additions & 0 deletions .sourcery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sources:
- Sources
templates:
- Templates
output:
.sourcery.dump
1 change: 1 addition & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
--exclude .Package.Test.swift
--exclude Package.swift
--header "\n Copyright © {created.year} Swinject Contributors. All rights reserved.\n"
--exclude Tests/Support/GeneratedMocks.swift
9 changes: 5 additions & 4 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ included:
- Sources
- Tests
excluded:
- Sources/Container.Arguments.swift
- Sources/SynchronizedResolver.Arguments.swift
- Sources/Resolver.swift
- Sources/ServiceEntry.TypeForwarding.swift
- Sources/2.0 API/Container+Registration.swift
- Sources/2.0 API/SynchronizedResolver+Arguments.swift
- Sources/2.0 API/Resolver+LegacyApi.swift
- Sources/2.0 API/ServiceEntry+TypeForwarding.swift
- Tests/Support/GeneratedMocks.swift
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ env:
global:
- LC_CTYPE=en_US.UTF-8
- PROJECT=Swinject.xcodeproj
git:
submodules: false
matrix:
include:
- env: JOB="LINUX_SPM" SWIFT_VERSION="5.0"
Expand All @@ -23,13 +21,15 @@ matrix:
before_install:
script:
- pod lib lint
- env: JOB="XCODE" DEST="OS=10.0,name=iPhone 6" SCHEME="Swinject-iOS" SDK="iphonesimulator" ACTION="test" PLATFORM="iOS"
- env: JOB="XCODE" DEST="OS=10.0,name=iPhone 6" SCHEME="Swinject-iOS" SDK="iphonesimulator" ACTION="test" PLATFORM="iOS" CONFIG="Release"
osx_image: xcode10.2
- env: JOB="XCODE" DEST="arch=x86_64" SCHEME="Swinject-macOS" SDK="macosx" ACTION="test" PLATFORM="OSX"
- env: JOB="XCODE" DEST="arch=x86_64" SCHEME="Swinject-macOS" SDK="macosx" ACTION="test" PLATFORM="OSX" CONFIG="Release"
osx_image: xcode10.2
- env: JOB="XCODE" DEST="OS=10.0,name=Apple TV 1080p" SCHEME="Swinject-tvOS" SDK="appletvsimulator" ACTION="test" PLATFORM="tvOS"
- env: JOB="XCODE" DEST="arch=x86_64" SCHEME="Swinject-macOS" SDK="macosx" ACTION="test" PLATFORM="OSX" CONFIG="Release"
osx_image: xcode11
- env: JOB="XCODE" DEST="OS=10.0,name=Apple TV 1080p" SCHEME="Swinject-tvOS" SDK="appletvsimulator" ACTION="test" PLATFORM="tvOS" CONFIG="Debug"
osx_image: xcode10.2
- env: JOB="XCODE" DEST="OS=2.2,name=Apple Watch - 42mm" SCHEME="Swinject-watchOS" SDK="watchsimulator" ACTION="build" PLATFORM="watchOS"
- env: JOB="XCODE" DEST="OS=2.2,name=Apple Watch - 42mm" SCHEME="Swinject-watchOS" SDK="watchsimulator" ACTION="build" PLATFORM="watchOS" CONFIG="Release"
osx_image: xcode10.2

before_install:
Expand All @@ -39,7 +39,7 @@ before_install:
- carthage bootstrap --verbose --platform $PLATFORM
script:
- set -o pipefail
- xcodebuild "$ACTION" -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DEST" -configuration Release ENABLE_TESTABILITY=YES | xcpretty
- xcodebuild "$ACTION" -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DEST" -configuration "$CONFIG" ENABLE_TESTABILITY=YES | xcpretty
notifications:
email:
on_success: never
10 changes: 10 additions & 0 deletions LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Copyright © 2019 Swinject Contributors. All rights reserved.
//

import Quick
import XCTest

@testable import SwinjectTests

Quick.QCKMain(SwinjectTests.allSpecs)
65 changes: 28 additions & 37 deletions Sources/Assembler.swift → Sources/2.0 API/Assembler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,6 @@ public final class Assembler {
self.container = container!
}

/// Will create an empty `Assembler`
///
/// - parameter parentAssembler: the baseline assembler
/// - parameter defaultObjectScope: default object scope for container
/// - parameter behaviors: list of behaviors to be added to the container
public init(parentAssembler: Assembler?, defaultObjectScope: ObjectScope = .graph, behaviors: [Behavior] = []) {
container = Container(
parent: parentAssembler?.container,
defaultObjectScope: defaultObjectScope,
behaviors: behaviors
)
}

/// Will create a new `Assembler` with the given `Assembly` instances to build a `Container`
///
/// - parameter assemblies: the list of assemblies to build the container from
/// - parameter container: the baseline container
///
@available(*, deprecated, message: "Use not throwing alternative: init(_:, container:)")
public convenience init(assemblies: [Assembly], container: Container? = Container()) throws {
if let container = container {
self.init(assemblies, container: container)
} else {
self.init(assemblies)
}
}

/// Will create a new `Assembler` with the given `Assembly` instances to build a `Container`
///
/// - parameter assemblies: the list of assemblies to build the container from
Expand All @@ -60,26 +33,44 @@ public final class Assembler {
/// Will create a new `Assembler` with the given `Assembly` instances to build a `Container`
///
/// - parameter assemblies: the list of assemblies to build the container from
/// - parameter parentAssembler: the baseline assembler
///
@available(*, deprecated, message: "Use not throwing alternative: init(_:, parent:)")
public convenience init(assemblies: [Assembly], parentAssembler: Assembler?) throws {
self.init(_: assemblies, parent: parentAssembler)
/// - parameter parent: the baseline assembler
/// - parameter defaultObjectScope: default object scope for container
/// - parameter behaviors: list of behaviors to be added to the container
public convenience init(
_ assemblies: [Assembly] = [],
parent: Assembler? = nil,
defaultObjectScope: ObjectScope = .graph,
behaviors: [Behavior] = []
) {
self.init(
assemblies,
parent: parent,
defaultScope: defaultObjectScope.scope,
defaultMakeRef: defaultObjectScope.makeRef,
behaviors: behaviors
)
}

/// Will create a new `Assembler` with the given `Assembly` instances to build a `Container`
///
/// - parameter assemblies: the list of assemblies to build the container from
/// - parameter parent: the baseline assembler
/// - parameter defaultObjectScope: default object scope for container
/// - parameter defaultScope: default scope for container
/// - parameter defaultMakeRef: default reference maker for container (`strongRef` by default)
/// - parameter behaviors: list of behaviors to be added to the container
public init(
_ assemblies: [Assembly],
parent: Assembler?,
defaultObjectScope: ObjectScope = .graph,
_ assemblies: [Assembly] = [],
parent: Assembler? = nil,
defaultScope: AnyScope?,
defaultMakeRef: @escaping ReferenceMaker<Any> = strongRef,
behaviors: [Behavior] = []
) {
container = Container(parent: parent?.container, defaultObjectScope: defaultObjectScope, behaviors: behaviors)
container = Container(
parent: parent?.container,
defaultScope: defaultScope,
defaultMakeRef: defaultMakeRef,
behaviors: behaviors
)
run(assemblies: assemblies)
}

Expand Down
File renamed without changes.
File renamed without changes.
Loading