Showing preview only (352K chars total). Download the full file or copy to clipboard to get everything.
Repository: Swinject/SwinjectAutoregistration
Branch: master
Commit: fd9ffae5f666
Files: 62
Total size: 331.2 KB
Directory structure:
gitextract_4gzckeiu/
├── .Package.test.swift
├── .gitignore
├── .swift-version
├── .swiftpm/
│ └── xcode/
│ └── package.xcworkspace/
│ ├── contents.xcworkspacedata
│ └── xcshareddata/
│ └── IDEWorkspaceChecks.plist
├── .travis.yml
├── Cartfile
├── Cartfile.resolved
├── Configurations/
│ ├── Base/
│ │ ├── Common.xcconfig
│ │ ├── Configurations/
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Profile.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Test.xcconfig
│ │ └── Targets/
│ │ ├── Application.xcconfig
│ │ ├── Framework.xcconfig
│ │ └── StaticLibrary.xcconfig
│ ├── Mac OS X/
│ │ ├── Mac-Application.xcconfig
│ │ ├── Mac-Base.xcconfig
│ │ ├── Mac-DynamicLibrary.xcconfig
│ │ ├── Mac-Framework.xcconfig
│ │ └── Mac-StaticLibrary.xcconfig
│ ├── iOS/
│ │ ├── iOS-Application.xcconfig
│ │ ├── iOS-Base.xcconfig
│ │ ├── iOS-Framework.xcconfig
│ │ └── iOS-StaticLibrary.xcconfig
│ ├── tvOS/
│ │ ├── tvOS-Application.xcconfig
│ │ ├── tvOS-Base.xcconfig
│ │ ├── tvOS-Framework.xcconfig
│ │ └── tvOS-StaticLibrary.xcconfig
│ └── watchOS/
│ ├── watchOS-Application.xcconfig
│ ├── watchOS-Base.xcconfig
│ ├── watchOS-Framework.xcconfig
│ └── watchOS-StaticLibrary.xcconfig
├── LICENSE
├── Makefile
├── Package.swift
├── README.md
├── Sources/
│ ├── AutoRegistration.swift
│ ├── CheckResolved.swift
│ ├── Info.plist
│ ├── Operators.swift
│ ├── ResolutionError.swift
│ ├── Resolver.swift
│ ├── SwinjectAutoregistration.h
│ ├── Type.swift
│ └── TypeParser.swift
├── SwinjectAutoregistration.podspec
├── SwinjectAutoregistration.xcodeproj/
│ ├── project.pbxproj
│ ├── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata/
│ └── xcschemes/
│ ├── SwinjectAutoregistration-OSX.xcscheme
│ ├── SwinjectAutoregistration-iOS.xcscheme
│ ├── SwinjectAutoregistration-tvOS.xcscheme
│ └── SwinjectAutoregistration-watchOS.xcscheme
├── Tests/
│ ├── Info.plist
│ ├── LinuxMain.swift
│ └── SwinjectAutoregistrationTests/
│ ├── AutoregistrationTests.swift
│ ├── OperatorsTests.swift
│ ├── ResolutionErrorTests.swift
│ ├── TypeParserTests.swift
│ └── XCTestManifests.swift
└── bin/
└── generate
================================================
FILE CONTENTS
================================================
================================================
FILE: .Package.test.swift
================================================
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "SwinjectAutoregistration",
products: [
.library(
name: "SwinjectAutoregistration",
targets: ["SwinjectAutoregistration"])
],
dependencies: [
.package(url: "https://github.com/Swinject/Swinject.git", from: "2.9.1")
],
targets: [
.target(
name: "SwinjectAutoregistration",
dependencies: [
"Swinject",
],
path: "Sources"),
.testTarget(
name: "SwinjectAutoregistrationTests",
dependencies: [
"Swinject",
"SwinjectAutoregistration",
])
]
)
================================================
FILE: .gitignore
================================================
#
# https://github.com/github/gitignore/blob/master/Swift.gitignore
#
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
fastlane/report.xml
fastlane/screenshots
## Mac
.DS_Store
## SwinjectStoryboard
SwinjectStoryboard.framework.zip
Package.resolved
================================================
FILE: .swift-version
================================================
5.0
================================================
FILE: .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
================================================
FILE: .swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
<?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>
================================================
FILE: .travis.yml
================================================
language: objective-c
env:
global:
- LC_CTYPE=en_US.UTF-8
- PROJECT=SwinjectAutoregistration.xcodeproj
git:
submodules: false
matrix:
include:
- env: JOB="LINUX_SPM" SWIFT_VERSION="5.2.2"
os: linux
language: generic
sudo: required
dist: bionic
before_install:
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
script:
- mv .Package.test.swift Package.swift
- swift build
- swift test
- env: JOB="POD_LINT"
osx_image: xcode12.5
before_install:
script:
- pod lib lint
- env: JOB="XCODE" DEST="OS=14.0.1,name=iPhone 8" SCHEME="SwinjectAutoregistration-iOS" SDK="iphonesimulator" ACTION="test" PLATFORM="iOS"
osx_image: xcode12.5
- env: JOB="XCODE" DEST="arch=x86_64" SCHEME="SwinjectAutoregistration-OSX" SDK="macosx" ACTION="test" PLATFORM="OSX"
osx_image: xcode12.5
- env: JOB="XCODE" DEST="OS=14.0,name=Apple TV 4K" SCHEME="SwinjectAutoregistration-tvOS" SDK="appletvsimulator" ACTION="test" PLATFORM="tvOS"
osx_image: xcode12.5
- env: JOB="XCODE" DEST="OS=7.4,name=Apple Watch Series 6 - 44mm" SCHEME="SwinjectAutoregistration-watchOS" SDK="watchsimulator" ACTION="test" PLATFORM="watchOS"
osx_image: xcode12.5
before_install:
- curl -L -O https://github.com/Carthage/Carthage/releases/download/0.37.0/Carthage.pkg
- sudo installer -pkg Carthage.pkg -target /
- rm Carthage.pkg
- xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
- trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
- echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
- echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig
- export XCODE_XCCONFIG_FILE="$xcconfig"
- carthage bootstrap --platform $PLATFORM --new-resolver --use-xcframeworks
script:
- set -o pipefail
- xcodebuild "$ACTION" -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DEST" -configuration Release ENABLE_TESTABILITY=YES | xcpretty
notifications:
email:
on_success: never
================================================
FILE: Cartfile
================================================
github "Swinject/Swinject" ~> 2.9.1
================================================
FILE: Cartfile.resolved
================================================
github "Swinject/Swinject" "2.9.1"
================================================
FILE: Configurations/Base/Common.xcconfig
================================================
//
// This file defines common settings that should be enabled for every new
// project. Typically, you want to use Debug, Release, or a similar variant
// instead.
//
// Disable legacy-compatible header searching
ALWAYS_SEARCH_USER_PATHS = NO
// Architectures to build
ARCHS = $(ARCHS_STANDARD)
// Whether to warn when a floating-point value is used as a loop counter
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
// Whether to warn about use of rand() and random() being used instead of arc4random()
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
// Whether to warn about strcpy() and strcat()
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
// Whether to enable module imports
CLANG_ENABLE_MODULES = YES
// Enable ARC
CLANG_ENABLE_OBJC_ARC = YES
// Warn about implicit conversions to boolean values that are suspicious.
// For example, writing 'if (foo)' with 'foo' being the name a function will trigger a warning.
CLANG_WARN_BOOL_CONVERSION = YES
// Warn about implicit conversions of constant values that cause the constant value to change,
// either through a loss of precision, or entirely in its meaning.
CLANG_WARN_CONSTANT_CONVERSION = YES
// Whether to warn when overriding deprecated methods
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
// Warn about direct accesses to the Objective-C 'isa' pointer instead of using a runtime API.
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR
// Warn about declaring the same method more than once within the same @interface.
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
// Warn about loop bodies that are suspiciously empty.
CLANG_WARN_EMPTY_BODY = YES
// Warn about implicit conversions between different kinds of enum values.
// For example, this can catch issues when using the wrong enum flag as an argument to a function or method.
CLANG_WARN_ENUM_CONVERSION = YES
// Whether to warn on implicit conversions between signed/unsigned types
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO
// Warn about implicit conversions between pointers and integers.
// For example, this can catch issues when one incorrectly intermixes using NSNumbers and raw integers.
CLANG_WARN_INT_CONVERSION = YES
// Warn about implicit capture of self (e.g. direct ivar access)
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
// Don't warn about repeatedly using a weak reference without assigning the weak reference to a strong reference. Too many false positives.
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO
// Warn about classes that unintentionally do not subclass a root class (such as NSObject).
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR
// Whether to warn on suspicious implicit conversions
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
// Warn about incorrect uses of nullable values
CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES
// Warn for missing nullability attributes
CLANG_ANALYZER_NONNULL = YES
// Warn when a non-localized string is passed to a user-interface method expecting a localized string
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES
// Warn about potentially unreachable code
CLANG_WARN_UNREACHABLE_CODE = YES
// The format of debugging symbols
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
// Whether to compile assertions in
ENABLE_NS_ASSERTIONS = YES
// Whether to require objc_msgSend to be cast before invocation
ENABLE_STRICT_OBJC_MSGSEND = YES
// Which C variant to use
GCC_C_LANGUAGE_STANDARD = gnu99
// Whether to enable exceptions for Objective-C
GCC_ENABLE_OBJC_EXCEPTIONS = YES
// Whether to generate debugging symbols
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
// Whether to precompile the prefix header (if one is specified)
GCC_PRECOMPILE_PREFIX_HEADER = YES
// Whether to enable strict aliasing, meaning that two pointers of different
// types (other than void * or any id type) cannot point to the same memory
// location
GCC_STRICT_ALIASING = YES
// Whether symbols not explicitly exported are hidden by default (this primarily
// only affects C++ code)
GCC_SYMBOLS_PRIVATE_EXTERN = NO
// Whether static variables are thread-safe by default
GCC_THREADSAFE_STATICS = NO
// Which compiler to use
GCC_VERSION = com.apple.compilers.llvm.clang.1_0
// Whether warnings are treated as errors
GCC_TREAT_WARNINGS_AS_ERRORS = YES
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
// Whether to warn about 64-bit values being implicitly shortened to 32 bits
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
// Whether to warn about fields missing from structure initializers (only if
// designated initializers aren't used)
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
// Whether to warn about missing function prototypes
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO
// Whether to warn about implicit conversions in the signedness of the type
// a pointer is pointing to (e.g., 'int *' getting converted to 'unsigned int *')
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES
// Whether to warn when the value returned from a function/method/block does not
// match its return type
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR
// Whether to warn on a class not implementing all the required methods of
// a protocol it declares conformance to
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
// Whether to warn when switching on an enum value, and all possibilities are
// not accounted for
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
// Whether to warn about the use of four-character constants
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES
// Whether to warn about an aggregate data type's initializer not being fully
// bracketed (e.g., array initializer syntax)
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
// Whether to warn about missing braces or parentheses that make the meaning of
// the code ambiguous
GCC_WARN_MISSING_PARENTHESES = YES
// Whether to warn about unsafe comparisons between values of different
// signedness
GCC_WARN_SIGN_COMPARE = YES
// Whether to warn about the arguments to printf-style functions not matching
// the format specifiers
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
// Warn if a "@selector(...)" expression referring to an undeclared selector is found
GCC_WARN_UNDECLARED_SELECTOR = YES
// Warn if a variable might be clobbered by a setjmp call or if an automatic variable is used without prior initialization.
GCC_WARN_UNINITIALIZED_AUTOS = YES
// Whether to warn about static functions that are unused
GCC_WARN_UNUSED_FUNCTION = YES
// Whether to warn about labels that are unused
GCC_WARN_UNUSED_LABEL = YES
// Whether to warn about variables that are never used
GCC_WARN_UNUSED_VARIABLE = YES
// Whether to run the static analyzer with every build
RUN_CLANG_STATIC_ANALYZER = YES
// Don't treat unknown warnings as errors, and disable GCC compatibility warnings and unused static const variable warnings
WARNING_CFLAGS = -Wno-error=unknown-warning-option -Wno-gcc-compat -Wno-unused-const-variable
// This setting is on for new projects as of Xcode ~6.3, though it is still not
// the default. It warns if the same variable is declared in two binaries that
// are linked together.
GCC_NO_COMMON_BLOCKS = YES
// This warnings detects when a function will recursively call itself on every
// code path though that function. More information can be found here:
// http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131216/096004.html
CLANG_WARN_INFINITE_RECURSION = YES
// This warning detects suspicious uses of std::move.
CLANG_WARN_SUSPICIOUS_MOVE = YES
================================================
FILE: Configurations/Base/Configurations/Debug.xcconfig
================================================
//
// This file defines the base configuration for a Debug build of any project.
// This should be set at the project level for the Debug configuration.
//
#include "../Common.xcconfig"
// Whether to strip debugging symbols when copying resources (like included
// binaries)
COPY_PHASE_STRIP = NO
// The optimization level (0, 1, 2, 3, s) for the produced binary
GCC_OPTIMIZATION_LEVEL = 0
// Preproccessor definitions to apply to each file compiled
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
// Allow @testable imports
ENABLE_TESTABILITY = YES
// Whether to enable link-time optimizations (such as inlining across translation
// units)
LLVM_LTO = NO
// Whether to only build the active architecture
ONLY_ACTIVE_ARCH = YES
// Other compiler flags
//
// These settings catch some errors in integer arithmetic
OTHER_CFLAGS = -ftrapv
// Other flags to pass to the Swift compiler
//
// This enables conditional compilation with #if DEBUG
OTHER_SWIFT_FLAGS = -D DEBUG
// Xcode 8 introduced a new flag for conditional compilation
//
// This enables conditional compilation with #if DEBUG
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG
// Whether to strip debugging symbols when copying the built product to its
// final installation location
STRIP_INSTALLED_PRODUCT = NO
// The optimization level (-Onone, -O, -Ofast) for the produced Swift binary
SWIFT_OPTIMIZATION_LEVEL = -Onone
// Disable Developer ID timestamping
OTHER_CODE_SIGN_FLAGS = --timestamp=none
================================================
FILE: Configurations/Base/Configurations/Profile.xcconfig
================================================
//
// This file defines the base configuration for an optional profiling-specific
// build of any project. To use these settings, create a Profile configuration
// in your project, and use this file at the project level for the new
// configuration.
//
// based on the Release configuration, with some stuff related to debugging
// symbols re-enabled
#include "Release.xcconfig"
// Whether to strip debugging symbols when copying resources (like included
// binaries)
COPY_PHASE_STRIP = NO
// Whether to only build the active architecture
ONLY_ACTIVE_ARCH = YES
// Whether to strip debugging symbols when copying the built product to its
// final installation location
STRIP_INSTALLED_PRODUCT = NO
// Whether to perform App Store validation checks
VALIDATE_PRODUCT = NO
// Disable Developer ID timestamping
OTHER_CODE_SIGN_FLAGS = --timestamp=none
================================================
FILE: Configurations/Base/Configurations/Release.xcconfig
================================================
//
// This file defines the base configuration for a Release build of any project.
// This should be set at the project level for the Release configuration.
//
#include "../Common.xcconfig"
// Whether to strip debugging symbols when copying resources (like included
// binaries)
COPY_PHASE_STRIP = YES
// The optimization level (0, 1, 2, 3, s) for the produced binary
GCC_OPTIMIZATION_LEVEL = s
// Preproccessor definitions to apply to each file compiled
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG=1
// Whether to enable link-time optimizations (such as inlining across translation
// units)
LLVM_LTO = NO
// Whether to only build the active architecture
ONLY_ACTIVE_ARCH = NO
// Whether to strip debugging symbols when copying the built product to its
// final installation location
STRIP_INSTALLED_PRODUCT = YES
// The optimization level (-Onone, -O, -Owholemodule) for the produced Swift binary
SWIFT_OPTIMIZATION_LEVEL = -Owholemodule
// Whether to perform App Store validation checks
VALIDATE_PRODUCT = YES
================================================
FILE: Configurations/Base/Configurations/Test.xcconfig
================================================
//
// This file defines the base configuration for a Test build of any project.
// This should be set at the project level for the Test configuration.
//
#include "Debug.xcconfig"
// Sandboxed apps can't be unit tested since they can't load some random
// external bundle. So we disable sandboxing for testing.
CODE_SIGN_ENTITLEMENTS =
// Allow @testable imports
ENABLE_TESTABILITY = YES
================================================
FILE: Configurations/Base/Targets/Application.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for an application. Typically, you want to use a platform-specific variant
// instead.
//
// Whether to strip out code that isn't called from anywhere
DEAD_CODE_STRIPPING = NO
// Sets the @rpath for the application such that it can include frameworks in
// the application bundle (inside the "Frameworks" folder)
LD_RUNPATH_SEARCH_PATHS = @executable_path/../Frameworks @loader_path/../Frameworks @executable_path/Frameworks
================================================
FILE: Configurations/Base/Targets/Framework.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a framework. Typically, you want to use a platform-specific variant
// instead.
//
// Disable code signing for successful device builds with Xcode 8. Frameworks do
// need to be signed, but they don't need to be signed at compile time because
// they'll be re-signed when you include them in your app.
CODE_SIGNING_REQUIRED = NO
CODE_SIGN_IDENTITY =
// Whether to strip out code that isn't called from anywhere
DEAD_CODE_STRIPPING = NO
// Whether this framework should define an LLVM module
DEFINES_MODULE = YES
// Whether function calls should be position-dependent (should always be
// disabled for library code)
GCC_DYNAMIC_NO_PIC = NO
// Default frameworks to the name of the project, instead of any
// platform-specific target
PRODUCT_NAME = $(PROJECT_NAME)
// Enables the framework to be included from any location as long as the
// loader’s runpath search paths includes it. For example from an application
// bundle (inside the "Frameworks" folder) or shared folder
INSTALL_PATH = @rpath
LD_DYLIB_INSTALL_NAME = @rpath/$(PRODUCT_NAME).$(WRAPPER_EXTENSION)/$(PRODUCT_NAME)
SKIP_INSTALL = YES
// Disallows use of APIs that are not available
// to app extensions and linking to frameworks
// that have not been built with this setting enabled.
APPLICATION_EXTENSION_API_ONLY = YES
================================================
FILE: Configurations/Base/Targets/StaticLibrary.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a static library. Typically, you want to use a platform-specific variant
// instead.
//
// Whether to strip out code that isn't called from anywhere
DEAD_CODE_STRIPPING = NO
// Whether to strip debugging symbols when copying resources (like included
// binaries).
//
// Overrides Release.xcconfig when used at the target level.
COPY_PHASE_STRIP = NO
// Whether function calls should be position-dependent (should always be
// disabled for library code)
GCC_DYNAMIC_NO_PIC = NO
// Copy headers to "include/LibraryName" in the build folder by default. This
// lets consumers use #import <LibraryName/LibraryName.h> syntax even for static
// libraries
PUBLIC_HEADERS_FOLDER_PATH = include/$PRODUCT_NAME
// Don't include in an xcarchive
SKIP_INSTALL = YES
// Disallows use of APIs that are not available
// to app extensions and linking to frameworks
// that have not been built with this setting enabled.
APPLICATION_EXTENSION_API_ONLY = YES
================================================
FILE: Configurations/Mac OS X/Mac-Application.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for an application on Mac OS X. This should be set at the target level for
// each project configuration.
//
// Import base application settings
#include "../Base/Targets/Application.xcconfig"
// Apply common settings specific to Mac OS X
#include "Mac-Base.xcconfig"
// Whether function calls should be position-dependent (should always be
// disabled for library code)
GCC_DYNAMIC_NO_PIC = YES
================================================
FILE: Configurations/Mac OS X/Mac-Base.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for Mac OS X. This file is not standalone -- it is meant to be included into
// a configuration file for a specific type of target.
//
// Whether to combine multiple image resolutions into a multirepresentational
// TIFF
COMBINE_HIDPI_IMAGES = YES
// Where to find embedded frameworks
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks
// The base SDK to use (if no version is specified, the latest version is
// assumed)
SDKROOT = macosx
// Supported build architectures
VALID_ARCHS = $(ARCHS_STANDARD)
================================================
FILE: Configurations/Mac OS X/Mac-DynamicLibrary.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a dynamic library on Mac OS X. This should be set at the target level
// for each project configuration.
//
// Import common settings specific to Mac OS X
#include "Mac-Base.xcconfig"
// Whether to strip out code that isn't called from anywhere
DEAD_CODE_STRIPPING = NO
// Whether function calls should be position-dependent (should always be
// disabled for library code)
GCC_DYNAMIC_NO_PIC = NO
// Don't include in an xcarchive
SKIP_INSTALL = YES
================================================
FILE: Configurations/Mac OS X/Mac-Framework.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a framework on OS X. This should be set at the target level for each
// project configuration.
//
// Import base framework settings
#include "../Base/Targets/Framework.xcconfig"
// Import common settings specific to Mac OS X
#include "Mac-Base.xcconfig"
================================================
FILE: Configurations/Mac OS X/Mac-StaticLibrary.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a static library on Mac OS X. This should be set at the target level for
// each project configuration.
//
// Import base static library settings
#include "../Base/Targets/StaticLibrary.xcconfig"
// Apply common settings specific to Mac OS X
#include "Mac-Base.xcconfig"
================================================
FILE: Configurations/iOS/iOS-Application.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for an application on iOS. This should be set at the target level for each
// project configuration.
//
// Import base application settings
#include "../Base/Targets/Application.xcconfig"
// Apply common settings specific to iOS
#include "iOS-Base.xcconfig"
================================================
FILE: Configurations/iOS/iOS-Base.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for iOS. This file is not standalone -- it is meant to be included into
// a configuration file for a specific type of target.
//
// Xcode needs this to find archived headers if SKIP_INSTALL is set
HEADER_SEARCH_PATHS = $(OBJROOT)/UninstalledProducts/include
// Where to find embedded frameworks
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
// The base SDK to use (if no version is specified, the latest version is
// assumed)
SDKROOT = iphoneos
// Supported device families (1 is iPhone, 2 is iPad)
TARGETED_DEVICE_FAMILY = 1,2
================================================
FILE: Configurations/iOS/iOS-Framework.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a framework on iOS. This should be set at the target level for each
// project configuration.
//
// Import base framework settings
#include "../Base/Targets/Framework.xcconfig"
// Import common settings specific to iOS
#include "iOS-Base.xcconfig"
================================================
FILE: Configurations/iOS/iOS-StaticLibrary.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a static library on iOS. This should be set at the target level for each
// project configuration.
//
// Import base static library settings
#include "../Base/Targets/StaticLibrary.xcconfig"
// Apply common settings specific to iOS
#include "iOS-Base.xcconfig"
================================================
FILE: Configurations/tvOS/tvOS-Application.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for an application on tvOS. This should be set at the target level for
// each project configuration.
//
// Import base application settings
#include "../Base/Targets/Application.xcconfig"
// Apply common settings specific to tvOS
#include "tvOS-Base.xcconfig"
================================================
FILE: Configurations/tvOS/tvOS-Base.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for tvOS. This file is not standalone -- it is meant to be included into
// a configuration file for a specific type of target.
//
// Where to find embedded frameworks
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
// The base SDK to use (if no version is specified, the latest version is
// assumed)
SDKROOT = appletvos
// Supported device families
TARGETED_DEVICE_FAMILY = 3
================================================
FILE: Configurations/tvOS/tvOS-Framework.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a framework on tvOS. This should be set at the target level for each
// project configuration.
//
// Import base framework settings
#include "../Base/Targets/Framework.xcconfig"
// Import common settings specific to iOS
#include "tvOS-Base.xcconfig"
================================================
FILE: Configurations/tvOS/tvOS-StaticLibrary.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a static library on tvOS. This should be set at the target level for
// each project configuration.
//
// Import base static library settings
#include "../Base/Targets/StaticLibrary.xcconfig"
// Apply common settings specific to tvOS
#include "tvOS-Base.xcconfig"
================================================
FILE: Configurations/watchOS/watchOS-Application.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for an application on watchOS. This should be set at the target level for
// each project configuration.
//
// Import base application settings
#include "../Base/Targets/Application.xcconfig"
// Apply common settings specific to watchOS
#include "watchOS-Base.xcconfig"
================================================
FILE: Configurations/watchOS/watchOS-Base.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for watchOS. This file is not standalone -- it is meant to be included into
// a configuration file for a specific type of target.
//
// Where to find embedded frameworks
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
// The base SDK to use (if no version is specified, the latest version is
// assumed)
SDKROOT = watchos
// Supported device families
TARGETED_DEVICE_FAMILY = 4
================================================
FILE: Configurations/watchOS/watchOS-Framework.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a framework on watchOS. This should be set at the target level for each
// project configuration.
//
// Import base framework settings
#include "../Base/Targets/Framework.xcconfig"
// Import common settings specific to iOS
#include "watchOS-Base.xcconfig"
================================================
FILE: Configurations/watchOS/watchOS-StaticLibrary.xcconfig
================================================
//
// This file defines additional configuration options that are appropriate only
// for a static library on watchOS. This should be set at the target level for
// each project configuration.
//
// Import base static library settings
#include "../Base/Targets/StaticLibrary.xcconfig"
// Apply common settings specific to watchOS
#include "watchOS-Base.xcconfig"
================================================
FILE: LICENSE
================================================
Copyright (c) 2016 Swinject Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Makefile
================================================
#
# Run help command as the default.
#
all: help
#
# Shows help message.
#
.PHONY: help
help:
@echo 'To release a version of SwinjectAutoregistration, run the following commands in order on the branch where you make a release.'
@echo ' $$ make VERSION=<version#> set-new-version (e.g. make VERSION=1.2.3 set-new-version)'
@echo ' $$ make [UPSTREAM=<upstream>] push-to-upstream (e.g. make push-to-upstream)'
@echo ' $$ make carthage-release'
@echo ' $$ make cocoapods-release'
#
# Set a specified version in Info.plist and podspec files, and tag the version.
#
.PHONY: set-new-version
set-new-version:
ifndef VERSION
$(error Specify a new version. E.g. $$ make VERSION=1.2.3 set-new-version)
endif
ifeq ($(wildcard ./SwinjectAutoregistration.podspec),)
$(error Run the command in the directory containing SwinjectAutoregistration.podspec.)
endif
ifeq ($(shell git diff --quiet; echo $$?), 1)
$(error Your current git working tree is dirty. Stash all to run this command.)
endif
agvtool new-marketing-version $(VERSION)
sed -i '' -e 's/\(s\.version.*=\).*/\1 "$(VERSION)"/' ./SwinjectAutoregistration.podspec
git commit -a -m "Update the version to $(VERSION)"
git tag $(VERSION)
#
# Push the commit and tag for the new version to upstream.
#
VERSION_TAG=$(shell git describe --tags --abbrev=0)
ifndef UPSTREAM
UPSTREAM=upstream
endif
.PHONY: push-to-upstream
push-to-upstream:
git push $(UPSTREAM) $(shell git rev-parse --abbrev-ref HEAD)
git push $(UPSTREAM) $(VERSION_TAG)
#
# Make a release for Carthage.
#
VERSION_TAG=$(shell git describe --tags --abbrev=0)
.PHONY: carthage-release
carthage-release:
ifeq ($(shell which gh),)
$(error gh command not found. Install gh command and run `gh auth login` beforehand.)
endif
ifneq ($(VERSION_TAG),$(shell agvtool what-marketing-version -terse1))
$(error The version tag $(VERSION_TAG) does not match the version in Info.plist)
endif
gh release create $(VERSION_TAG) --draft --title v$(VERSION_TAG) --notes ""
@echo Open https://github.com/Swinject/SwinjectAutoregistration/releases/edit/$(VERSION_TAG) to describe the release and publish it.
#
# Make a release for Cocoapods.
#
.PHONY: cocoapods-release
cocoapods-release:
pod lib lint
pod trunk push SwinjectAutoregistration.podspec
================================================
FILE: Package.swift
================================================
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "SwinjectAutoregistration",
products: [
.library(
name: "SwinjectAutoregistration",
targets: ["SwinjectAutoregistration"]),
.library(
name: "SwinjectAutoregistration-Dynamic",
type: .dynamic,
targets: ["SwinjectAutoregistration"])
],
dependencies: [
.package(url: "https://github.com/Swinject/Swinject.git", from: "2.9.1")
],
targets: [
.target(
name: "SwinjectAutoregistration",
dependencies: [
"Swinject",
],
path: "Sources"),
]
)
================================================
FILE: README.md
================================================
SwinjectAutoregistration
========
[](https://travis-ci.org/Swinject/SwinjectAutoregistration)
[](https://github.com/Carthage/Carthage)
[](http://cocoapods.org/pods/SwinjectAutoregistration)
[](http://cocoapods.org/pods/SwinjectAutoregistration)
[](http://cocoapods.org/pods/SwinjectAutoregistration)
[](https://developer.apple.com/swift)
SwinjectAutoregistration is an extension of Swinject that allows to automatically register your services and greatly reduce the amount of boilerplate code.
## Requirements
- iOS 11.0+ / Mac OS X 10.13+ / tvOS 11.0+
- Xcode 14.3+
## Installation
Swinject is available through [Carthage](https://github.com/Carthage/Carthage), [CocoaPods](https://cocoapods.org) or [Swift Package Manager](https://swift.org/package-manager/).
### Carthage
To install Swinject with Carthage, add the following line to your `Cartfile`.
```
github "Swinject/Swinject" "2.9.1"
github "Swinject/SwinjectAutoregistration" "2.9.1"
```
Then run `carthage update --use-xcframeworks --no-use-binaries` command or just `carthage update --use-xcframeworks`. For details of the installation and usage of Carthage, visit [its project page](https://github.com/Carthage/Carthage).
### CocoaPods
To install Swinject with CocoaPods, add the following lines to your `Podfile`.
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0' # or platform :osx, '10.13' if your target is OS X.
use_frameworks!
pod 'Swinject', '2.9.1'
pod 'SwinjectAutoregistration', '2.9.1'
```
Then run `pod install` command. For details of the installation and usage of CocoaPods, visit [its official website](https://cocoapods.org).
### Swift Package Manager
in `Package.swift` add the following:
```swift
dependencies: [
.package(url: "https://github.com/Swinject/SwinjectAutoregistration.git", from: "2.9.1")
],
targets: [
.target(
name: "MyProject",
dependencies: [..., "SwinjectAutoregistration"]
)
...
]
```
### Registration
Here is a simple example to auto-register a pet owner
```swift
let container = Container()
container.register(Animal.self) { _ in Cat(name: "Mimi") } // Regular register method
container.autoregister(Person.self, initializer: PetOwner.init) // Autoregistration
```
where PetOwner looks like this:
```swift
class PetOwner: Person {
let pet: Animal
init(pet: Animal) {
self.pet = pet
}
}
```
The `autoregister` function is given the `PetOwner` initializer `init(pet:Animal)`. From its signature Swinject knows that it needs a dependency `Animal` and resolves it from the container. Nothing else is needed.
Autoregistration becomes especially useful when used to register services with many dependencies. Compare autoregistration code:
```swift
container.autoregister(MyService.self, initializer: MyService.init)
```
with equivalent code in pure Swinject:
```swift
container.register(MyService.self) { r in
MyService(dependencyA: r.resolve(DependencyA.self)!, dependencyB: r.resolve(DependencyB.self)!, dependencyC: r.resolve(DependencyC.self)!, dependencyD: r.resolve(DependencyD.self)!)
}
```
Another advantage is that if you add more dependencies during the development the registration code doesn't have to be rewritten.
#### Registration with name
Service can be also given name - same as with the regular register method.
```swift
container.autoregister(Person.self, name: "johnny", initializer: PetOwner.init)
```
#### Arguments
You can also use auto-registration for services with dynamic arguments. Pet owner whose name needs to be passed as argument is defined like this:
```swift
class PetOwner: Person {
let name: String
let pet: Animal
init(name: String, pet: Animal) {
self.name = name
self.pet = pet
}
}
```
And registered like this
```swift
container.autoregister(Person.self, argument: String.self, initializer: PetOwner.init)
```
Swinject will register `Person` with the argument of type `String`. When `container.resolve(Person.self, argument: "Michael")` is called Swinject won't try to resolve `String` as dependency but instead pass "Michael" as the name.
To also pass pet as argument you can call
```swift
container.autoregister(Person.self, arguments: String.self, Animal.self, initializer: PetOwner.init)
//or
container.autoregister(Person.self, arguments: Animal.self, String.self, initializer: PetOwner.init)
```
> The order of the arguments listed is interchangeable. The auto-registration can't be used with more arguments and/or dependencies of the same type.
### What kind of sorcery is this?
Wondering how does that work? Generics are heavily leveraged for the auto-registration. For registering service with two dependencies something similar to a following function is used:
```swift
public func autoregister<Service, A, B>(_ service: Service.Type, initializer: (A, B) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, factory: { r in
return initializer(r.resolve(A.self)!, r.resolve(B.self)!)
} as (ResolverType) -> Service)
}
```
The initializer is a function like any other. By passing it as a parameter its dependencies can be inferred as `(A, B)` and automatically resolved. These functions are generated for up to 20 dependencies. Checkout the [code](https://github.com/Swinject/SwinjectAutoregistration/blob/master/Sources/AutoRegistration.swift) for more info.
### Operators ###
This extension also aims to reduce the amount of boilerplate while improving readability of the registration code. For that reason the operator `~>` is introduced.
```swift
Petowner(pet: r~>)
// equivalent to
Petowner(pet: r.resolve(Animal.self)!)
```
The dependency is again inferred from the type in the initializer. To specify a concrete class you can use:
```swift
Petowner(pet: r ~> Cat.self)
```
To use a named service:
```swift
Petowner(pet: r ~> (Cat.self, name: "mimi"))
```
or to pass argument/s:
```swift
Petowner(pet: r ~> (Cat.self, argument: "Mimi"))
Petowner(pet: r ~> (Cat.self, arguments: ("Mimi", UIColor.black)))
```
### Limitations ###
When a service has multiple initializers, swift compiler can't be sure which should be used and you will get a `ambigious use of init(x: y: z:)`. This can also happen if the service is extending another class that have initializer with the same number of arguments.
The solution is to specify the initializer like this:
```
container.autoregister(Person.self, initializer: PetOwner.init(name:pet:))
```
Auto-registration **can't** be used with **named dependencies** in their initializers. There is no way to get a name of dependency from the initializer. For example, following code can't be auto-registered:
```swift
container.register(Animal.self, name: "mimi") { _ in Cat(name: "Mimi") }
container.register(Animal.self, name: "charles") { _ in Cat(name: "Charles") }
container.register(Person.self) {
PetOwner(pet: r.resolve(Animal.self, name: "mimi")
}
```
### Swift 5.3
Since Swift 5.3 the compiler behaves differently when infering initializers in structs that have variables with a default value:
```swift
struct Cat {
let height: Int = 50
}
```
Compiler will generate two init functions:
`Cat.init` and `Cat.init(height:)`
Since the Swift 5.3 the following registration
```swift
container.autoregister(Animal.self, initializer: Cat.init)
```
will try to use the `Cat.init(height:)` which will then fail with `Unresolved service: Int Initializer: (Int) -> Animal`
Solution is to make the compiler use the init without a parameter
```swift
container.autoregister(Animal.self, initializer: Cat.init as () -> Cat)
```
## For Maintainers
### Making a new release version
Our release procedure is described as [Makefile](https://github.com/Swinject/SwinjectAutoregistration/blob/master/Makefile). Run `make help` coomand for more info.
## Credits
SwinjectAutoregistration generics is inspired by:
- [Curry](https://github.com/thoughtbot/Curry) - [Thoughtbot](https://thoughtbot.com/)
## License
MIT license. See the [LICENSE file](LICENSE) for details.
================================================
FILE: Sources/AutoRegistration.swift
================================================
//
// Sources/AutoRegistration.swift
// SwinjectAutoregistration
//
// Generated by Swinject AutoRegistration generator.
// Copyright © 2017 Swinject Contributors. All rights reserved.
//
import Swinject
let maxDependencies = 20
let maxArguments = 3
public extension Container {
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service>(_ service: Service.Type, name: String? = nil, initializer: @escaping (()) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
initializer(())
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A>(_ service: Service.Type, name: String? = nil, initializer: @escaping (A) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve()
checkResolved(initializer: initializer, services: a)
return initializer(a!)
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping (Arg1) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let arg1: Arg1? = arg1
checkResolved(initializer: initializer, services: arg1)
return initializer(arg1!)
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve()
checkResolved(initializer: initializer, services: a, b)
return initializer((a!, b!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b)
return initializer((a!, b!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b)
return initializer((a!, b!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c)
return initializer((a!, b!, c!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c)
return initializer((a!, b!, c!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c)
return initializer((a!, b!, c!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c)
return initializer((a!, b!, c!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d)
return initializer((a!, b!, c!, d!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d)
return initializer((a!, b!, c!, d!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d)
return initializer((a!, b!, c!, d!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d)
return initializer((a!, b!, c!, d!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e)
return initializer((a!, b!, c!, d!, e!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e)
return initializer((a!, b!, c!, d!, e!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e)
return initializer((a!, b!, c!, d!, e!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e)
return initializer((a!, b!, c!, d!, e!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f)
return initializer((a!, b!, c!, d!, e!, f!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f)
return initializer((a!, b!, c!, d!, e!, f!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f)
return initializer((a!, b!, c!, d!, e!, f!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f)
return initializer((a!, b!, c!, d!, e!, f!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g)
return initializer((a!, b!, c!, d!, e!, f!, g!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g)
return initializer((a!, b!, c!, d!, e!, f!, g!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g)
return initializer((a!, b!, c!, d!, e!, f!, g!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g)
return initializer((a!, b!, c!, d!, e!, f!, g!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve(); let o: O? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1); let o: O? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2); let o: O? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3); let o: O? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve(); let o: O? = res.resolve(); let p: P? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1); let o: O? = res.resolve(argument: arg1); let p: P? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2); let o: O? = res.resolve(arguments: arg1, arg2); let p: P? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3); let o: O? = res.resolve(arguments: arg1, arg2, arg3); let p: P? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve(); let o: O? = res.resolve(); let p: P? = res.resolve(); let q: Q? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1); let o: O? = res.resolve(argument: arg1); let p: P? = res.resolve(argument: arg1); let q: Q? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2); let o: O? = res.resolve(arguments: arg1, arg2); let p: P? = res.resolve(arguments: arg1, arg2); let q: Q? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3); let o: O? = res.resolve(arguments: arg1, arg2, arg3); let p: P? = res.resolve(arguments: arg1, arg2, arg3); let q: Q? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve(); let o: O? = res.resolve(); let p: P? = res.resolve(); let q: Q? = res.resolve(); let r: R? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1); let o: O? = res.resolve(argument: arg1); let p: P? = res.resolve(argument: arg1); let q: Q? = res.resolve(argument: arg1); let r: R? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2); let o: O? = res.resolve(arguments: arg1, arg2); let p: P? = res.resolve(arguments: arg1, arg2); let q: Q? = res.resolve(arguments: arg1, arg2); let r: R? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3); let o: O? = res.resolve(arguments: arg1, arg2, arg3); let p: P? = res.resolve(arguments: arg1, arg2, arg3); let q: Q? = res.resolve(arguments: arg1, arg2, arg3); let r: R? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve(); let o: O? = res.resolve(); let p: P? = res.resolve(); let q: Q? = res.resolve(); let r: R? = res.resolve(); let s: S? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1); let o: O? = res.resolve(argument: arg1); let p: P? = res.resolve(argument: arg1); let q: Q? = res.resolve(argument: arg1); let r: R? = res.resolve(argument: arg1); let s: S? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2); let o: O? = res.resolve(arguments: arg1, arg2); let p: P? = res.resolve(arguments: arg1, arg2); let q: Q? = res.resolve(arguments: arg1, arg2); let r: R? = res.resolve(arguments: arg1, arg2); let s: S? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3); let o: O? = res.resolve(arguments: arg1, arg2, arg3); let p: P? = res.resolve(arguments: arg1, arg2, arg3); let q: Q? = res.resolve(arguments: arg1, arg2, arg3); let r: R? = res.resolve(arguments: arg1, arg2, arg3); let s: S? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- initializer: Initializer of the registered service
- Returns: The registered service entry
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(_ service: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res in
let a: A? = res.resolve(); let b: B? = res.resolve(); let c: C? = res.resolve(); let d: D? = res.resolve(); let e: E? = res.resolve(); let f: F? = res.resolve(); let g: G? = res.resolve(); let h: H? = res.resolve(); let i: I? = res.resolve(); let j: J? = res.resolve(); let k: K? = res.resolve(); let l: L? = res.resolve(); let m: M? = res.resolve(); let n: N? = res.resolve(); let o: O? = res.resolve(); let p: P? = res.resolve(); let q: Q? = res.resolve(); let r: R? = res.resolve(); let s: S? = res.resolve(); let t: T? = res.resolve()
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!, t!))
} as (Resolver) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, argument: Arg1.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- argument: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 1 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, Arg1>(_ service: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)) -> Service) -> ServiceEntry<Service> {
return self.register(service.self, name: name, factory: { res, arg1 in
let a: A? = res.resolve(argument: arg1); let b: B? = res.resolve(argument: arg1); let c: C? = res.resolve(argument: arg1); let d: D? = res.resolve(argument: arg1); let e: E? = res.resolve(argument: arg1); let f: F? = res.resolve(argument: arg1); let g: G? = res.resolve(argument: arg1); let h: H? = res.resolve(argument: arg1); let i: I? = res.resolve(argument: arg1); let j: J? = res.resolve(argument: arg1); let k: K? = res.resolve(argument: arg1); let l: L? = res.resolve(argument: arg1); let m: M? = res.resolve(argument: arg1); let n: N? = res.resolve(argument: arg1); let o: O? = res.resolve(argument: arg1); let p: P? = res.resolve(argument: arg1); let q: Q? = res.resolve(argument: arg1); let r: R? = res.resolve(argument: arg1); let s: S? = res.resolve(argument: arg1); let t: T? = res.resolve(argument: arg1)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!, t!))
} as (Resolver, Arg1) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 2 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, Arg1, Arg2>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2 in
let a: A? = res.resolve(arguments: arg1, arg2); let b: B? = res.resolve(arguments: arg1, arg2); let c: C? = res.resolve(arguments: arg1, arg2); let d: D? = res.resolve(arguments: arg1, arg2); let e: E? = res.resolve(arguments: arg1, arg2); let f: F? = res.resolve(arguments: arg1, arg2); let g: G? = res.resolve(arguments: arg1, arg2); let h: H? = res.resolve(arguments: arg1, arg2); let i: I? = res.resolve(arguments: arg1, arg2); let j: J? = res.resolve(arguments: arg1, arg2); let k: K? = res.resolve(arguments: arg1, arg2); let l: L? = res.resolve(arguments: arg1, arg2); let m: M? = res.resolve(arguments: arg1, arg2); let n: N? = res.resolve(arguments: arg1, arg2); let o: O? = res.resolve(arguments: arg1, arg2); let p: P? = res.resolve(arguments: arg1, arg2); let q: Q? = res.resolve(arguments: arg1, arg2); let r: R? = res.resolve(arguments: arg1, arg2); let s: S? = res.resolve(arguments: arg1, arg2); let t: T? = res.resolve(arguments: arg1, arg2)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!, t!))
} as (Resolver, Arg1, Arg2) -> Service)
}
/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.
Usage: `autoregister(MyService.self, arguments: Arg1.self, Arg2.self, Arg3.self), initializer: MyService.init`
- Parameters:
- service: Registered service type
- name: Optional name of the service
- arguments: Argument type(s) that will be resolved dynamically instead of resolving dependency
- initializer: Initializer of the registered service
- Returns: The registered service entry with 3 arguments
- Important: Might fail if one of the dependencies is unresolvable.
*/
@discardableResult
func autoregister<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, Arg1, Arg2, Arg3>(_ service: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)) -> Service) -> ServiceEntry<Service> {
precondition(hasUnique(arguments: [arg1, arg2, arg3]), "Autoregistration of service with dynamic arguments of the same type (\(arg1), \(arg2), \(arg3)) is not supported")
return self.register(service.self, name: name, factory: { res, arg1, arg2, arg3 in
let a: A? = res.resolve(arguments: arg1, arg2, arg3); let b: B? = res.resolve(arguments: arg1, arg2, arg3); let c: C? = res.resolve(arguments: arg1, arg2, arg3); let d: D? = res.resolve(arguments: arg1, arg2, arg3); let e: E? = res.resolve(arguments: arg1, arg2, arg3); let f: F? = res.resolve(arguments: arg1, arg2, arg3); let g: G? = res.resolve(arguments: arg1, arg2, arg3); let h: H? = res.resolve(arguments: arg1, arg2, arg3); let i: I? = res.resolve(arguments: arg1, arg2, arg3); let j: J? = res.resolve(arguments: arg1, arg2, arg3); let k: K? = res.resolve(arguments: arg1, arg2, arg3); let l: L? = res.resolve(arguments: arg1, arg2, arg3); let m: M? = res.resolve(arguments: arg1, arg2, arg3); let n: N? = res.resolve(arguments: arg1, arg2, arg3); let o: O? = res.resolve(arguments: arg1, arg2, arg3); let p: P? = res.resolve(arguments: arg1, arg2, arg3); let q: Q? = res.resolve(arguments: arg1, arg2, arg3); let r: R? = res.resolve(arguments: arg1, arg2, arg3); let s: S? = res.resolve(arguments: arg1, arg2, arg3); let t: T? = res.resolve(arguments: arg1, arg2, arg3)
checkResolved(initializer: initializer, services: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
return initializer((a!, b!, c!, d!, e!, f!, g!, h!, i!, j!, k!, l!, m!, n!, o!, p!, q!, r!, s!, t!))
} as (Resolver, Arg1, Arg2, Arg3) -> Service)
}
}
================================================
FILE: Sources/CheckResolved.swift
================================================
//
// Sources/CheckResolved.swift
// SwinjectAutoregistration
//
// Generated by Swinject AutoRegistration generator.
// Copyright © 2017 Swinject Contributors. All rights reserved.
//
import Swinject
func unresolvedService<A>(_ a: A?) -> String? {
return ( a == nil ? "\(A.self)" : nil )
}
func checkResolved<Service, A>(initializer: (A) -> Service, services a: A?){
let unresolved = ( [a] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a)!)\nInitializer: (\(A.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B>(_ a: A?, _ b: B?) -> String? {
return unresolvedService(a) ?? ( b == nil ? "\(B.self)" : nil )
}
func checkResolved<Service, A, B>(initializer: ((A, B)) -> Service, services a: A?, _ b: B?){
let unresolved = ( [a, b] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b)!)\nInitializer: (\(A.self), \(B.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C>(_ a: A?, _ b: B?, _ c: C?) -> String? {
return unresolvedService(a, b) ?? ( c == nil ? "\(C.self)" : nil )
}
func checkResolved<Service, A, B, C>(initializer: ((A, B, C)) -> Service, services a: A?, _ b: B?, _ c: C?){
let unresolved = ( [a, b, c] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c)!)\nInitializer: (\(A.self), \(B.self), \(C.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D>(_ a: A?, _ b: B?, _ c: C?, _ d: D?) -> String? {
return unresolvedService(a, b, c) ?? ( d == nil ? "\(D.self)" : nil )
}
func checkResolved<Service, A, B, C, D>(initializer: ((A, B, C, D)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?){
let unresolved = ( [a, b, c, d] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?) -> String? {
return unresolvedService(a, b, c, d) ?? ( e == nil ? "\(E.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E>(initializer: ((A, B, C, D, E)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?){
let unresolved = ( [a, b, c, d, e] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?) -> String? {
return unresolvedService(a, b, c, d, e) ?? ( f == nil ? "\(F.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F>(initializer: ((A, B, C, D, E, F)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?){
let unresolved = ( [a, b, c, d, e, f] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?) -> String? {
return unresolvedService(a, b, c, d, e, f) ?? ( g == nil ? "\(G.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G>(initializer: ((A, B, C, D, E, F, G)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?){
let unresolved = ( [a, b, c, d, e, f, g] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?) -> String? {
return unresolvedService(a, b, c, d, e, f, g) ?? ( h == nil ? "\(H.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H>(initializer: ((A, B, C, D, E, F, G, H)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?){
let unresolved = ( [a, b, c, d, e, f, g, h] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h) ?? ( i == nil ? "\(I.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I>(initializer: ((A, B, C, D, E, F, G, H, I)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?){
let unresolved = ( [a, b, c, d, e, f, g, h, i] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i) ?? ( j == nil ? "\(J.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J>(initializer: ((A, B, C, D, E, F, G, H, I, J)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j) ?? ( k == nil ? "\(K.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K>(initializer: ((A, B, C, D, E, F, G, H, I, J, K)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k) ?? ( l == nil ? "\(L.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l) ?? ( m == nil ? "\(M.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m) ?? ( n == nil ? "\(N.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n) ?? ( o == nil ? "\(O.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n, o] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self), \(O.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) ?? ( p == nil ? "\(P.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n, o, p] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self), \(O.self), \(P.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) ?? ( q == nil ? "\(Q.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n, o, p, q] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self), \(O.self), \(P.self), \(Q.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?, _ r: R?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) ?? ( r == nil ? "\(R.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?, _ r: R?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n, o, p, q, r] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self), \(O.self), \(P.self), \(Q.self), \(R.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?, _ r: R?, _ s: S?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) ?? ( s == nil ? "\(S.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?, _ r: R?, _ s: S?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n, o, p, q, r, s] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self), \(O.self), \(P.self), \(Q.self), \(R.self), \(S.self)) -> \(Service.self)")
}
}
func unresolvedService<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(_ a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?, _ r: R?, _ s: S?, _ t: T?) -> String? {
return unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) ?? ( t == nil ? "\(T.self)" : nil )
}
func checkResolved<Service, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(initializer: ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?, _ f: F?, _ g: G?, _ h: H?, _ i: I?, _ j: J?, _ k: K?, _ l: L?, _ m: M?, _ n: N?, _ o: O?, _ p: P?, _ q: Q?, _ r: R?, _ s: S?, _ t: T?){
let unresolved = ( [a, b, c, d, e, f, g, h, i, j] as [Any?] + [k, l, m, n, o, p, q, r, s, t] as [Any?] ).filter { $0 == nil }
if unresolved.count > 0 {
let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined()
fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self), \(E.self), \(F.self), \(G.self), \(H.self), \(I.self), \(J.self), \(K.self), \(L.self), \(M.self), \(N.self), \(O.self), \(P.self), \(Q.self), \(R.self), \(S.self), \(T.self)) -> \(Service.self)")
}
}
================================================
FILE: Sources/Info.plist
================================================
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.9.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Swinject Contributors. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
================================================
FILE: Sources/Operators.swift
================================================
//
// Swinject+Operators.swift
// Pods
//
// Created by Tomas Kohout on 8/30/16.
// Copyright © 2016 Swinject Contributors. All rights reserved.
//
import Swinject
import Foundation
//Already declared in Swift
//infix operator ~> { associativity left precedence 160 }
postfix operator ~>
/** Unary operator which automatically resolves the return type
Usage: `SomeClass(dependencyA: r~>, dependencyB: r~>)`
- Parameters:
- r: Resolver
- Returns: The resolved service type instance.
- Important: Fails on unresolvable service.
*/
public postfix func ~> <Service>(r: Resolver) -> Service {
return r.resolve(Service.self)!
}
/** Binary operator ~> equivalent to `r.resolve(Service.Type)!`
Usage: `SomeClass(dependencyA: r ~> DependencyA.self)`
- Parameters:
- r: Resolver
- service: Type of service to resolve.
- Returns: The resolved service type instance.
- Important: Fails on unresolvable service.
*/
public func ~> <Service>(r: Resolver, service: Service.Type) -> Service {
return r.resolve(service)!
}
/** Binary operator ~> equivalent to `r.resolve(Service.Type, name: "ServiceName")!`
Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, name: "ServiceName"))`
- Parameters:
- r: Resolver
- service: Type of service to resolve.
- Returns: The resolved service type instance.
- Important: Fails on unresolvable service.
*/
public func ~> <Service>(r: Resolver, o: (service: Service.Type, name: String)) -> Service {
return r.resolve(o.service, name: o.name)!
}
/** Binary operator ~> equivalent to `r.resolve(Service.Type, argument: Arg1)!`
Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, argument: arg))`
- Parameters:
- r: Resolver
- o.service: Type of service to resolve.
- o.argument: Argument to pass
- Returns: The resolved service type instance.
- Important: Fails on unresolvable service.
*/
public func ~> <Service, Arg1>(r: Resolver, o: (service: Service.Type, argument: Arg1) ) -> Service {
return r.resolve(o.service, argument: o.argument)!
}
/** Binary operator ~> equivalent to `r.resolve(Service.Type, name: String, argument: Arg1)!`
Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, name: "ServiceName", argument: arg))`
- Parameters:
- r: Resolver
- o.service: Type of service to resolve.
- o.argument: Argument to pass
- Returns: The resolved service type instance.
- Important: Fails on unresolvable service.
*/
public func ~> <Service, Arg1>(r: Resolver, o: (service: Service.Type, name: String, argument: Arg1) ) -> Service {
return r.resolve(o.service, name: o.name, argument: o.argument)!
}
//@available(*, deprecated, message: "Arguments passed in sequence have been deprecated, pass arguments in tuple instead. e.g: ~> (Service.self, arguments: (arg1, arg2))")
//public func ~> <Service, Arg1: Any, Arg2: Any>(r: Resolver, o: (Service.Type, arguments: Arg1, Arg2) ) -> Service {
// return r.resolve(o.0, arguments: o.1, o.2)!
//}
@available(*, deprecated, message: "Comma-separated arguments have been deprecated, pass arguments in tuple instead. e.g: ~> (Service.self, name: \"Service\", arguments: (arg1, arg2))")
public func ~> <Service, Arg1, Arg2>(r: Resolver, o: (Service.Type, name: String, arguments: Arg1, Arg2) ) -> Service {
return r.resolve(o.0, name: o.1, arguments: o.2, o.3)!
}
@available(*, deprecated, message: "Comma-separated arguments have been deprecated, pass arguments in tuple instead. e.g: ~> (Service.self, arguments: (arg1, arg2, arg3))")
public func ~> <Service, Arg1, Arg2, Arg3>(r: Resolver, o: (Service.Type, arguments: Arg1, Arg2, Arg3) ) -> Service {
return r.resolve(o.0, arguments: o.1, o.2, o.3)!
}
@available(*, deprecated, message: "Comma-separated arguments have been deprecated, pass arguments in tuple instead. e.g: ~> (Service.self, name: \"Service\", arguments: (arg1, arg2, arg3))")
public func ~> <Service, Arg1, Arg2, Arg3>(r: Resolver, o: (Service.Type, name: String, arguments: Arg1, Arg2, Arg3) ) -> Service {
return r.resolve(o.0, name: o.1, arguments: o.2, o.3, o.4)!
}
/** Binary operator ~> equivalent to `r.resolve(Service.Type, arguments: (Arg1, Arg2))!`
Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, arguments: (arg1, arg2)))`
- Parameters:
- r: Resolver
- o.service: Type of service to resolve.
- o.arguments: Arguments to pass
- Returns: The resolved service type instance.
- Important: Fails on unresolvable service.
*/
public func ~> <Service, Arg1, Arg2>(r: Resolver, o: (Service.Type, arguments: (Arg1, Arg2)) ) -> Service {
return r.resolve(o.0, arguments: o.arguments.0, o.arguments.1)!
}
/** Binary operator ~> equivalent to `r.resolve(Service.Type, name: "ServiceName", arguments: (Arg1, Arg
gitextract_4gzckeiu/
├── .Package.test.swift
├── .gitignore
├── .swift-version
├── .swiftpm/
│ └── xcode/
│ └── package.xcworkspace/
│ ├── contents.xcworkspacedata
│ └── xcshareddata/
│ └── IDEWorkspaceChecks.plist
├── .travis.yml
├── Cartfile
├── Cartfile.resolved
├── Configurations/
│ ├── Base/
│ │ ├── Common.xcconfig
│ │ ├── Configurations/
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Profile.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Test.xcconfig
│ │ └── Targets/
│ │ ├── Application.xcconfig
│ │ ├── Framework.xcconfig
│ │ └── StaticLibrary.xcconfig
│ ├── Mac OS X/
│ │ ├── Mac-Application.xcconfig
│ │ ├── Mac-Base.xcconfig
│ │ ├── Mac-DynamicLibrary.xcconfig
│ │ ├── Mac-Framework.xcconfig
│ │ └── Mac-StaticLibrary.xcconfig
│ ├── iOS/
│ │ ├── iOS-Application.xcconfig
│ │ ├── iOS-Base.xcconfig
│ │ ├── iOS-Framework.xcconfig
│ │ └── iOS-StaticLibrary.xcconfig
│ ├── tvOS/
│ │ ├── tvOS-Application.xcconfig
│ │ ├── tvOS-Base.xcconfig
│ │ ├── tvOS-Framework.xcconfig
│ │ └── tvOS-StaticLibrary.xcconfig
│ └── watchOS/
│ ├── watchOS-Application.xcconfig
│ ├── watchOS-Base.xcconfig
│ ├── watchOS-Framework.xcconfig
│ └── watchOS-StaticLibrary.xcconfig
├── LICENSE
├── Makefile
├── Package.swift
├── README.md
├── Sources/
│ ├── AutoRegistration.swift
│ ├── CheckResolved.swift
│ ├── Info.plist
│ ├── Operators.swift
│ ├── ResolutionError.swift
│ ├── Resolver.swift
│ ├── SwinjectAutoregistration.h
│ ├── Type.swift
│ └── TypeParser.swift
├── SwinjectAutoregistration.podspec
├── SwinjectAutoregistration.xcodeproj/
│ ├── project.pbxproj
│ ├── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata/
│ └── xcschemes/
│ ├── SwinjectAutoregistration-OSX.xcscheme
│ ├── SwinjectAutoregistration-iOS.xcscheme
│ ├── SwinjectAutoregistration-tvOS.xcscheme
│ └── SwinjectAutoregistration-watchOS.xcscheme
├── Tests/
│ ├── Info.plist
│ ├── LinuxMain.swift
│ └── SwinjectAutoregistrationTests/
│ ├── AutoregistrationTests.swift
│ ├── OperatorsTests.swift
│ ├── ResolutionErrorTests.swift
│ ├── TypeParserTests.swift
│ └── XCTestManifests.swift
└── bin/
└── generate
Condensed preview — 62 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (358K chars).
[
{
"path": ".Package.test.swift",
"chars": 736,
"preview": "// swift-tools-version:4.2\n\nimport PackageDescription\n\nlet package = Package(\n name: \"SwinjectAutoregistration\",\n "
},
{
"path": ".gitignore",
"chars": 1417,
"preview": "#\n# https://github.com/github/gitignore/blob/master/Swift.gitignore\n#\n\n## Build generated\nbuild/\nDerivedData\n\n## Various"
},
{
"path": ".swift-version",
"chars": 4,
"preview": "5.0\n"
},
{
"path": ".swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata",
"chars": 135,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:\">\n </FileRef"
},
{
"path": ".swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": ".travis.yml",
"chars": 2252,
"preview": "language: objective-c\nenv:\n global:\n - LC_CTYPE=en_US.UTF-8\n - PROJECT=SwinjectAutoregistration.xcodeproj\ngit:\n "
},
{
"path": "Cartfile",
"chars": 36,
"preview": "github \"Swinject/Swinject\" ~> 2.9.1\n"
},
{
"path": "Cartfile.resolved",
"chars": 35,
"preview": "github \"Swinject/Swinject\" \"2.9.1\"\n"
},
{
"path": "Configurations/Base/Common.xcconfig",
"chars": 7347,
"preview": "// \n// This file defines common settings that should be enabled for every new\n// project. Typically, you want to use Deb"
},
{
"path": "Configurations/Base/Configurations/Debug.xcconfig",
"chars": 1462,
"preview": "// \n// This file defines the base configuration for a Debug build of any project.\n// This should be set at the project l"
},
{
"path": "Configurations/Base/Configurations/Profile.xcconfig",
"chars": 855,
"preview": "// \n// This file defines the base configuration for an optional profiling-specific\n// build of any project. To use these"
},
{
"path": "Configurations/Base/Configurations/Release.xcconfig",
"chars": 1018,
"preview": "// \n// This file defines the base configuration for a Release build of any project.\n// This should be set at the project"
},
{
"path": "Configurations/Base/Configurations/Test.xcconfig",
"chars": 394,
"preview": "// \n// This file defines the base configuration for a Test build of any project.\n// This should be set at the project le"
},
{
"path": "Configurations/Base/Targets/Application.xcconfig",
"chars": 513,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for an application. Typically, you"
},
{
"path": "Configurations/Base/Targets/Framework.xcconfig",
"chars": 1384,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a framework. Typically, you wa"
},
{
"path": "Configurations/Base/Targets/StaticLibrary.xcconfig",
"chars": 1036,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a static library. Typically, y"
},
{
"path": "Configurations/Mac OS X/Mac-Application.xcconfig",
"chars": 485,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for an application on Mac OS X. Th"
},
{
"path": "Configurations/Mac OS X/Mac-Base.xcconfig",
"chars": 640,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for Mac OS X. This file is not sta"
},
{
"path": "Configurations/Mac OS X/Mac-DynamicLibrary.xcconfig",
"chars": 543,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a dynamic library on Mac OS X."
},
{
"path": "Configurations/Mac OS X/Mac-Framework.xcconfig",
"chars": 346,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a framework on OS X. This shou"
},
{
"path": "Configurations/Mac OS X/Mac-StaticLibrary.xcconfig",
"chars": 363,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a static library on Mac OS X. "
},
{
"path": "Configurations/iOS/iOS-Application.xcconfig",
"chars": 346,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for an application on iOS. This sh"
},
{
"path": "Configurations/iOS/iOS-Base.xcconfig",
"chars": 665,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for iOS. This file is not standalo"
},
{
"path": "Configurations/iOS/iOS-Framework.xcconfig",
"chars": 340,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a framework on iOS. This shoul"
},
{
"path": "Configurations/iOS/iOS-StaticLibrary.xcconfig",
"chars": 353,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a static library on iOS. This "
},
{
"path": "Configurations/tvOS/tvOS-Application.xcconfig",
"chars": 349,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for an application on tvOS. This s"
},
{
"path": "Configurations/tvOS/tvOS-Base.xcconfig",
"chars": 510,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for tvOS. This file is not standal"
},
{
"path": "Configurations/tvOS/tvOS-Framework.xcconfig",
"chars": 342,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a framework on tvOS. This shou"
},
{
"path": "Configurations/tvOS/tvOS-StaticLibrary.xcconfig",
"chars": 356,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a static library on tvOS. This"
},
{
"path": "Configurations/watchOS/watchOS-Application.xcconfig",
"chars": 358,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for an application on watchOS. Thi"
},
{
"path": "Configurations/watchOS/watchOS-Base.xcconfig",
"chars": 511,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for watchOS. This file is not stan"
},
{
"path": "Configurations/watchOS/watchOS-Framework.xcconfig",
"chars": 348,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a framework on watchOS. This s"
},
{
"path": "Configurations/watchOS/watchOS-StaticLibrary.xcconfig",
"chars": 365,
"preview": "//\n// This file defines additional configuration options that are appropriate only\n// for a static library on watchOS. T"
},
{
"path": "LICENSE",
"chars": 1065,
"preview": "Copyright (c) 2016 Swinject Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": "Makefile",
"chars": 2259,
"preview": "#\n# Run help command as the default.\n#\nall: help\n\n#\n# Shows help message.\n#\n.PHONY: help\nhelp:\n\t@echo 'To release a vers"
},
{
"path": "Package.swift",
"chars": 702,
"preview": "// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n name: \"SwinjectAutoregistration\",\n "
},
{
"path": "README.md",
"chars": 8605,
"preview": "SwinjectAutoregistration\n========\n\n[\ntests += SwinjectAutoregistrationTe"
},
{
"path": "Tests/SwinjectAutoregistrationTests/AutoregistrationTests.swift",
"chars": 10875,
"preview": "//\n// AutoregistrationTests.swift\n// SwinjectAutoregistration\n//\n// Created by Yoichi Tagaya on 2021/07/03.\n// Copyr"
},
{
"path": "Tests/SwinjectAutoregistrationTests/OperatorsTests.swift",
"chars": 4434,
"preview": "import XCTest\n\nimport Swinject\nimport SwinjectAutoregistration\n\n\nclass OperatorsTests: XCTestCase {\n\t\n class Dependen"
},
{
"path": "Tests/SwinjectAutoregistrationTests/ResolutionErrorTests.swift",
"chars": 4308,
"preview": "#if !SWIFT_PACKAGE\n\nimport XCTest\n@testable import SwinjectAutoregistration\n\nextension ResolutionError: Equatable {}\n\npu"
},
{
"path": "Tests/SwinjectAutoregistrationTests/TypeParserTests.swift",
"chars": 5575,
"preview": "//\n// TypeParserTests.swift\n// SwinjectAutoregistration\n//\n// Created by Yoichi Tagaya on 2021/07/03.\n// Copyright ©"
},
{
"path": "Tests/SwinjectAutoregistrationTests/XCTestManifests.swift",
"chars": 3989,
"preview": "#if !canImport(ObjectiveC)\nimport XCTest\n\nextension AutoregistrationTests {\n // DO NOT MODIFY: This is autogenerated,"
},
{
"path": "bin/generate",
"chars": 10914,
"preview": "#!/usr/bin/env xcrun swift\n\n// Generates a Swift file with registration fuctions and other helper methods\n\nimport Founda"
}
]
About this extraction
This page contains the full source code of the Swinject/SwinjectAutoregistration GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 62 files (331.2 KB), approximately 100.1k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.