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 ================================================ ================================================ FILE: .swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ 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 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= set-new-version (e.g. make VERSION=1.2.3 set-new-version)' @echo ' $$ make [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 ======== [![Build Status](https://travis-ci.org/Swinject/SwinjectAutoregistration.svg?branch=master)](https://travis-ci.org/Swinject/SwinjectAutoregistration) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods Version](https://img.shields.io/cocoapods/v/SwinjectAutoregistration.svg?style=flat)](http://cocoapods.org/pods/SwinjectAutoregistration) [![License](https://img.shields.io/cocoapods/l/SwinjectAutoregistration.svg?style=flat)](http://cocoapods.org/pods/SwinjectAutoregistration) [![Platform](https://img.shields.io/cocoapods/p/SwinjectAutoregistration.svg?style=flat)](http://cocoapods.org/pods/SwinjectAutoregistration) [![Swift Version](https://img.shields.io/badge/Swift-5-F16D39.svg?style=flat)](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: Service.Type, initializer: (A, B) -> Service) -> ServiceEntry { 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.Type, name: String? = nil, initializer: @escaping (()) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, initializer: @escaping (A) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping (Arg1) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, _ arg3: Arg3.Type, initializer: @escaping ((A, B, C, D, E)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F)) -> Service) -> ServiceEntry { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G)) -> Service) -> ServiceEntry { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, arguments arg1: Arg1.Type, _ arg2: Arg2.Type, initializer: @escaping ((A, B, C, D, E, F, G, H)) -> Service) -> ServiceEntry { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K)) -> Service) -> ServiceEntry { 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: Service.Type, name: String? = nil, argument arg1: Arg1.Type, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: 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 { 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: Service.Type, name: String? = nil, initializer: @escaping ((A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -> Service) -> ServiceEntry { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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: 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 { 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?) -> String? { return ( a == nil ? "\(A.self)" : nil ) } func checkResolved(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: A?, _ b: B?) -> String? { return unresolvedService(a) ?? ( b == nil ? "\(B.self)" : nil ) } func checkResolved(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: A?, _ b: B?, _ c: C?) -> String? { return unresolvedService(a, b) ?? ( c == nil ? "\(C.self)" : nil ) } func checkResolved(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: A?, _ b: B?, _ c: C?, _ d: D?) -> String? { return unresolvedService(a, b, c) ?? ( d == nil ? "\(D.self)" : nil ) } func checkResolved(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: A?, _ b: B?, _ c: C?, _ d: D?, _ e: E?) -> String? { return unresolvedService(a, b, c, d) ?? ( e == nil ? "\(E.self)" : nil ) } func checkResolved(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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: 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(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 ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 2.9.1 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright Copyright © 2016 Swinject Contributors. All rights reserved. NSPrincipalClass ================================================ 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 ~> (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 ~> (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 ~> (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 ~> (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 ~> (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 ~> (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 ~> (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 ~> (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 ~> (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 ~> (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, Arg2))!` Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, name: "ServiceName", 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 ~> (r: Resolver, o: (Service.Type, name: String, arguments: (Arg1, Arg2)) ) -> Service { return r.resolve(o.0, name: o.1, arguments: o.arguments.0, o.arguments.1)! } /** Binary operator ~> equivalent to `r.resolve(Service.Type, arguments: (Arg1, Arg2, Arg3))!` Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, arguments: (arg1, arg2, arg3)))` - 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 ~> (r: Resolver, o: (Service.Type, arguments: (Arg1, Arg2, Arg3)) ) -> Service { return r.resolve(o.0, arguments: o.arguments.0, o.arguments.1, o.arguments.2)! } /** Binary operator ~> equivalent to `r.resolve(Service.Type, name: "ServiceName", arguments: (Arg1, Arg2, Arg3))!` Usage: `SomeClass(dependencyA: r ~> (DependencyA.self, name: "ServiceName", arguments: (arg1, arg2, arg3)))` - 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 ~> (r: Resolver, o: (Service.Type, name: String, arguments: (Arg1, Arg2, Arg3)) ) -> Service { return r.resolve(o.0, name: o.1, arguments: o.arguments.0, o.arguments.1, o.arguments.2)! } ================================================ FILE: Sources/ResolutionError.swift ================================================ // // Warnings.swift // SwinjectAutoregistration // // Created by Tomas Kohout on 18/01/2017. // Copyright © 2017 Swinject Contributors. All rights reserved. // import Foundation enum ResolutionError { case tooManyDependencies(Int) var message: String { switch self { case .tooManyDependencies(let dependencyCount): return "⚠ Autoregistration is limited to maximum of \(maxDependencies) dependencies, tried to resolve \(dependencyCount). Use regular `register` method instead. " } } } /// Shows warnings based on information parsed from initializers description func resolutionErrors(forInitializer initializer: (Parameters) -> Service) -> [ResolutionError] { #if os(Linux) || os(Android) //Warnings are not supported on Linux return [] #else let parser = TypeParser(string: String(describing: Parameters.self)) guard let type = parser.parseType() else { return [] } let dependencies: [Type] //Multiple arguments if case .tuple(let types) = type { dependencies = types //Single argument } else if case .identifier(_) = type { dependencies = [type] } else { return [] } var warnings: [ResolutionError] = [] if dependencies.count > maxDependencies { warnings.append(.tooManyDependencies(dependencies.count)) } return warnings #endif } func hasUnique(arguments: [Any.Type]) -> Bool { for (index, arg) in arguments.enumerated() { if (arguments.enumerated().filter { index != $0 && arg == $1 }).count > 0 { return false } } return true } ================================================ FILE: Sources/Resolver.swift ================================================ // // Sources/Resolver.swift // SwinjectAutoregistration // // Generated by Swinject AutoRegistration generator. // Copyright © 2017 Swinject Contributors. All rights reserved. // import Swinject extension Resolver { func resolve() -> Service? { return self.resolve(Service.self) } func resolve(argument arg1: Arg1) -> Service? { return (arg1 as? Service) ?? self.resolve(Service.self) } func resolve(arguments arg1: Arg1, _ arg2: Arg2) -> Service? { return (arg1 as? Service) ?? (arg2 as? Service) ?? self.resolve(Service.self) } func resolve(arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3) -> Service? { return (arg1 as? Service) ?? (arg2 as? Service) ?? (arg3 as? Service) ?? self.resolve(Service.self) } } ================================================ FILE: Sources/SwinjectAutoregistration.h ================================================ // // SwinjectAutoregistration-iOS.h // SwinjectAutoregistration-iOS // // Created by Jakub Vaňo on 09/09/16. // Copyright © 2016 Swinject Contributors. All rights reserved. // #import //! Project version number for SwinjectAutoregistration-iOS. FOUNDATION_EXPORT double SwinjectAutoregistration_iOSVersionNumber; //! Project version string for SwinjectAutoregistration-iOS. FOUNDATION_EXPORT const unsigned char SwinjectAutoregistration_iOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: Sources/Type.swift ================================================ // // Type.swift // SwinjectAutoregistration // // Created by Tomas Kohout on 21/01/2017. // Copyright © 2017 Swinject Contributors. All rights reserved. // import Foundation class TypeIdentifier: CustomStringConvertible { var name: String var genericTypes: [Type] var subTypeIdentifier: TypeIdentifier? init(name: String, genericTypes: [Type] = [], subTypeIdentifier: TypeIdentifier? = nil){ self.name = name self.genericTypes = genericTypes self.subTypeIdentifier = subTypeIdentifier } var description: String { let generics = genericTypes.count > 0 ? "<\(genericTypes.map { "\($0)" }.joined(separator: ", "))>" : "" let subType = subTypeIdentifier.flatMap { ".\($0)" } ?? "" return "\(name)" + generics + subType } } extension TypeIdentifier: Equatable { static func ==(lhs: TypeIdentifier, rhs: TypeIdentifier) -> Bool { return lhs.name == rhs.name && lhs.genericTypes == rhs.genericTypes && lhs.subTypeIdentifier == rhs.subTypeIdentifier } } indirect enum Type: CustomStringConvertible { case closure(parameters:[Type], returnType: Type, throws: Bool) case identifier(TypeIdentifier) case tuple([Type]) case protocolComposition([TypeIdentifier]) var description: String { switch self { case .closure(let parameters, let returnType, let `throws`): return "(\(parameters.map { "\($0)" }.joined(separator: ", "))) \(`throws` ? "throws " : "")-> \(returnType)" case .identifier(let identifier): return "\(identifier)" case .tuple(let types): return "(\(types.map { "\($0)" }.joined(separator: ", ")))" case .protocolComposition(let types): return types.map { "\($0)" }.joined(separator: " & ") } } } extension Type: Equatable { static func ==(lhs: Type, rhs: Type) -> Bool { switch (lhs, rhs) { case (.closure(let lparams, let lreturn, let lthrows), .closure(let rparams, let rreturn, let rthrows)): return lparams == rparams && lreturn == rreturn && lthrows == rthrows case (.identifier(let lidentifier), .identifier(let ridentifier)): return lidentifier == ridentifier case (.tuple(let ltuple), .tuple(let rtuple)): return ltuple == rtuple case (.protocolComposition(let lprotocols), .protocolComposition(let rprotocols)): return lprotocols == rprotocols default: return false } } } ================================================ FILE: Sources/TypeParser.swift ================================================ // // Parser.swift // SwinjectAutoregistration // // Created by Tomas Kohout on 21/01/2017. // Copyright © 2017 Swinject Contributors. All rights reserved. // import Foundation #if !os(Linux) && !os(Android) extension Scanner { func scan(string: String) -> String? { if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { return self.scanString(string) } else { var value: NSString? if self.scanString(string, into: &value), let value = value { return value as String } return nil } } func scan(charactersFromSet set: CharacterSet) -> String? { if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { return self.scanCharacters(from: set) } else { var value: NSString? if self.scanCharacters(from: set, into: &value), let value = value { return value as String } return nil } } } extension NSMutableCharacterSet { func insert(charactersIn range: Range) { let nsRange = NSRange(location: Int(range.lowerBound.value), length: Int(range.upperBound.value - range.lowerBound.value)) self.addCharacters(in: nsRange) } func insert(charactersIn string: String) { self.addCharacters(in: string) } func formUnion(_ set: CharacterSet) { self.formUnion(with: set) } } private func ..<(start: Int, end: Int) -> Range { return UnicodeScalar(start)! ..< UnicodeScalar(end)! } /// Simple top-down parser for type description based on swift grammatic: /// See https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Types.html /// /// type → /// [-] array-type­ - Printed as Array<...> /// [-] dictionary-type­ - Printed as Dictionary<...> /// [x] function-type­ `tuple-type throws? -> type` /// [x] type-identifier­ `identifier ­generic-argument-clause? .­ type-identifier?­` /// [x] tuple-type­ `type,? type ...` /// [-] optional-type­ - Printed as Optional<...> /// [-] implicitly-unwrapped-optional-type­ - Printed as ImplicitlyUnwrappedOptional<...> /// [x] protocol-composition-type­ `identifier & identifier ...` /// [-] metatype-type­ - recognized by type identifier /// [-] Any, Self - recognized by type identifier /// /// [x] identifier → identifier-head ­identifier-characters?­ /// [-] identifier → `­identifier-head­identifier-characters­?`­ - backticks are not printed /// [-] identifier → implicit-parameter-name­ - e.g. $0, $1 - not needed in type /// [x] identifier-list → identifier­ | identifier­,­identifier-list class TypeParser { let scanner: Scanner init(string: String){ scanner = Scanner(string: string) scanner.charactersToBeSkipped = CharacterSet.whitespacesAndNewlines } func parseType() -> Type? { if let function = parseFunctionType() { return Type.closure(parameters: function.parameters, returnType: function.returnType, throws: function.throws) } else if let protocolComposition = parseProtocolCompositionClause() { return Type.protocolComposition(protocolComposition) } else if let typeIdentifier = parseTypeIdentifier() { return Type.identifier(typeIdentifier) } else if let tupleType = parseTupleType() { return Type.tuple(tupleType) } return nil } func parseTypeAnnotation() -> Type? { let originalLocation = scanner.scanLocation //Scan param name _ = parseIdentifier() //Return if param name is not specified if scanner.scan(string: ":") == nil { scanner.scanLocation = originalLocation } return parseType() } func parseTypeIdentifier() -> TypeIdentifier? { guard let typeName = parseIdentifier() else { return nil } let genericTypes = parseGenericArgumentClause() ?? [] var subTypeIdentifier: TypeIdentifier? = nil if scanner.scan(string: ".") != nil, let typeIdentifier = parseTypeIdentifier() { subTypeIdentifier = typeIdentifier } return TypeIdentifier(name: typeName, genericTypes: genericTypes, subTypeIdentifier: subTypeIdentifier) } func parseGenericArgumentClause() -> [Type]? { guard scanner.scan(string: "<") != nil else { return nil } guard let type = parseType() else { return nil } var types: [Type] = [type] while scanner.scan(string: ",") != nil, let type = parseType(){ types.append(type) } guard scanner.scan(string: ">") != nil else { return nil } return types } func parseProtocolCompositionClause() -> [TypeIdentifier]? { let originalLocation = scanner.scanLocation guard let protocolType = parseTypeIdentifier() else { return nil } var protocolTypes: [TypeIdentifier] = [protocolType] while scanner.scan(string: "&") != nil, let protocolType = parseTypeIdentifier() { protocolTypes.append(protocolType) } guard protocolTypes.count > 1 else { scanner.scanLocation = originalLocation; return nil; } return protocolTypes } func parseTupleType() -> [Type]? { guard scanner.scan(string: "(") != nil else { return nil } var types: [Type] = [] if let type = parseTypeAnnotation() { types.append(type) } while scanner.scan(string: ",") != nil, let type = parseTypeAnnotation() { types.append(type) } guard scanner.scan(string: ")") != nil else { return nil } return types } func parseFunctionType() -> (parameters: [Type], returnType: Type, throws: Bool)? { let originalLocation = scanner.scanLocation guard let parameters = parseTupleType() else { return nil } let `throws` = scanner.scan(string: "throws") != nil // - rethrows is not allowed for closures guard scanner.scan(string: "->") != nil else { scanner.scanLocation = originalLocation; return nil } guard let returnType = parseType() else { scanner.scanLocation = originalLocation; return nil } return (parameters: parameters, returnType: returnType, throws: `throws`) } func parseIdentifier() -> String? { // See https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-head //Identifier head #if os(Linux) || os(Android) var head = CharacterSet() #else let head = NSMutableCharacterSet() #endif head.formUnion(CharacterSet.letters) head.insert(charactersIn: "_") let ranges = [ 0x00A8 ..< 0x00A8, 0x00AA ..< 0x00AA, 0x00AD ..< 0x00AD, 0x00AF ..< 0x00AF, 0x00B2..<0x00B5, 0x00B7..<0x00BA, 0x00BC..<0x00BE, 0x00C0..<0x00D6, 0x00D8..<0x00F6, 0x00F8..<0x00FF, 0x0100..<0x02FF, 0x0370..<0x167F, 0x1681..<0x180D, 0x180F..<0x1DBF, 0x1E00..<0x1FFF, 0x200B..<0x200D, 0x202A..<0x202E, 0x203F..<0x2040, 0x2054..<0x2054, 0x2060..<0x206F, 0x2070..<0x20CF, 0x2100..<0x218F, 0x2460..<0x24FF, 0x2776..<0x2793, 0x2C00..<0x2DFF, 0x2E80..<0x2FFF, 0x3004..<0x3007, 0x3021..<0x302F, 0x3031..<0x303F, 0x3040..<0xD7FF, 0xF900..<0xFD3D, 0xFD40..<0xFDCF, 0xFDF0..<0xFE1F, 0xFE30..<0xFE44, 0xFE47..<0xFFFD, //Emoticons 0x10000..<0x1FFFD, 0x20000..<0x2FFFD, 0x30000..<0x3FFFD, 0x40000..<0x4FFFD, 0x50000..<0x5FFFD, 0x60000..<0x6FFFD, 0x70000..<0x7FFFD, 0x80000..<0x8FFFD, 0x90000..<0x9FFFD, 0xA0000..<0xAFFFD, 0xB0000..<0xBFFFD, 0xC0000..<0xCFFFD, 0xD0000..<0xDFFFD, 0xE0000..<0xEFFFD] ranges.forEach { head.insert(charactersIn: $0) } //Identifier characters #if os(Linux) || os(Android) var characters = head #else let characters = head.copy() as! NSMutableCharacterSet #endif characters.insert(charactersIn: "0123456789") let charactersRanges = [0x0300..<0x036F, 0x1DC0..<0x1DFF, 0x20D0..<0x20FF, 0xFE20..<0xFE2F] charactersRanges.forEach { characters.insert(charactersIn: $0) } guard let headString = scanner.scan(charactersFromSet: head as CharacterSet) else { return nil } let charactersString = scanner.scan(charactersFromSet: characters as CharacterSet) return "\(headString)\(charactersString ?? "")" } } #endif ================================================ FILE: SwinjectAutoregistration.podspec ================================================ Pod::Spec.new do |s| s.name = 'SwinjectAutoregistration' s.version = "2.9.1" s.summary = 'Autoregistration for Swinject' s.description = <<-DESC SwinjectAutoregistration is an extension of Swinject that allows to automatically inject dependencies into registered services. DESC s.homepage = 'https://github.com/Swinject/SwinjectAutoregistration' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = 'Swinject Contributors' s.source = { :git => 'https://github.com/Swinject/SwinjectAutoregistration.git', :tag => s.version.to_s } s.ios.deployment_target = '11.0' s.osx.deployment_target = '10.13' s.watchos.deployment_target = '4.0' s.tvos.deployment_target = '11.0' s.requires_arc = true s.swift_version = '5.0' s.source_files = 'Sources/**/*.{swift,h}' s.dependency 'Swinject', '~> 2.9.1' end ================================================ FILE: SwinjectAutoregistration.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 52; objects = { /* Begin PBXBuildFile section */ 0A47832F25CCA1E600BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47833425CCA1F400BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47834125CCA20000BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47834625CCA20A00BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47834D25CCA21400BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47835225CCA21E00BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47835925CCA22700BE64FF /* Swinject.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; }; 0A47837625CCA28500BE64FF /* Swinject.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 0A47838125CCA33E00BE64FF /* Swinject.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 0A47838825CCA3B400BE64FF /* Swinject.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 986C0CCC26906C6F001BFBFC /* AutoregistrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCB26906C6F001BFBFC /* AutoregistrationTests.swift */; }; 986C0CCD26906C6F001BFBFC /* AutoregistrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCB26906C6F001BFBFC /* AutoregistrationTests.swift */; }; 986C0CCE26906C6F001BFBFC /* AutoregistrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCB26906C6F001BFBFC /* AutoregistrationTests.swift */; }; 986C0CD0269076F6001BFBFC /* TypeParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCF269076F6001BFBFC /* TypeParserTests.swift */; }; 986C0CD1269076F6001BFBFC /* TypeParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCF269076F6001BFBFC /* TypeParserTests.swift */; }; 986C0CD2269076F6001BFBFC /* TypeParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCF269076F6001BFBFC /* TypeParserTests.swift */; }; AC11910A1E301CD200B112D9 /* ResolutionError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191091E301CD200B112D9 /* ResolutionError.swift */; }; AC1191191E301E3A00B112D9 /* Resolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191171E301E3A00B112D9 /* Resolver.swift */; }; AC11911A1E301E3A00B112D9 /* CheckResolved.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191181E301E3A00B112D9 /* CheckResolved.swift */; }; AC11911B1E30210200B112D9 /* Resolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191171E301E3A00B112D9 /* Resolver.swift */; }; AC11911C1E30210500B112D9 /* Resolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191171E301E3A00B112D9 /* Resolver.swift */; }; AC11911D1E30210500B112D9 /* Resolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191171E301E3A00B112D9 /* Resolver.swift */; }; AC11911E1E30210A00B112D9 /* CheckResolved.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191181E301E3A00B112D9 /* CheckResolved.swift */; }; AC11911F1E30210B00B112D9 /* CheckResolved.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191181E301E3A00B112D9 /* CheckResolved.swift */; }; AC1191201E30210C00B112D9 /* CheckResolved.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191181E301E3A00B112D9 /* CheckResolved.swift */; }; AC1191211E30211300B112D9 /* ResolutionError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191091E301CD200B112D9 /* ResolutionError.swift */; }; AC1191221E30211400B112D9 /* ResolutionError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191091E301CD200B112D9 /* ResolutionError.swift */; }; AC1191231E30211500B112D9 /* ResolutionError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1191091E301CD200B112D9 /* ResolutionError.swift */; }; AC4AC9491E33C71D00E6355A /* TypeParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC9481E33C71D00E6355A /* TypeParser.swift */; }; AC4AC94B1E33C75200E6355A /* Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC94A1E33C75200E6355A /* Type.swift */; }; AC4AC94C1E33CB9100E6355A /* TypeParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC9481E33C71D00E6355A /* TypeParser.swift */; }; AC4AC94D1E33CB9100E6355A /* TypeParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC9481E33C71D00E6355A /* TypeParser.swift */; }; AC4AC94E1E33CB9200E6355A /* TypeParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC9481E33C71D00E6355A /* TypeParser.swift */; }; AC4AC94F1E33CB9600E6355A /* Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC94A1E33C75200E6355A /* Type.swift */; }; AC4AC9501E33CB9700E6355A /* Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC94A1E33C75200E6355A /* Type.swift */; }; AC4AC9511E33CB9700E6355A /* Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC4AC94A1E33C75200E6355A /* Type.swift */; }; AC5A8FAB1ED1DAA00027334A /* OperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5A8FAA1ED1DAA00027334A /* OperatorsTests.swift */; }; AC5A8FBB1ED1DC2B0027334A /* OperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5A8FAA1ED1DAA00027334A /* OperatorsTests.swift */; }; AC5A8FBC1ED1DC2B0027334A /* OperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5A8FAA1ED1DAA00027334A /* OperatorsTests.swift */; }; ACA1032F1E3E3397004B8CD4 /* ResolutionErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACA103271E3E3386004B8CD4 /* ResolutionErrorTests.swift */; }; ACA103301E3E3398004B8CD4 /* ResolutionErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACA103271E3E3386004B8CD4 /* ResolutionErrorTests.swift */; }; ACA103311E3E339A004B8CD4 /* ResolutionErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACA103271E3E3386004B8CD4 /* ResolutionErrorTests.swift */; }; ACA2557F2709E653007AA055 /* SwinjectAutoregistration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD5B9EF01D83323F007ED05F /* SwinjectAutoregistration.framework */; }; ACA255852709E679007AA055 /* AutoregistrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCB26906C6F001BFBFC /* AutoregistrationTests.swift */; }; ACA255862709E67D007AA055 /* TypeParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 986C0CCF269076F6001BFBFC /* TypeParserTests.swift */; }; ACA255872709E680007AA055 /* ResolutionErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACA103271E3E3386004B8CD4 /* ResolutionErrorTests.swift */; }; ACA255882709E683007AA055 /* OperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5A8FAA1ED1DAA00027334A /* OperatorsTests.swift */; }; CD5B9ECB1D832D5A007ED05F /* SwinjectAutoregistration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD5B9EC01D832D5A007ED05F /* SwinjectAutoregistration.framework */; }; CD5B9EDF1D832E32007ED05F /* SwinjectAutoregistration.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5B9ED91D832E18007ED05F /* SwinjectAutoregistration.h */; settings = {ATTRIBUTES = (Public, ); }; }; CD5B9EE01D833088007ED05F /* AutoRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8C1D832BF9007ED05F /* AutoRegistration.swift */; }; CD5B9EE11D833088007ED05F /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8D1D832BF9007ED05F /* Operators.swift */; }; CD5B9EF81D8333A9007ED05F /* AutoRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8C1D832BF9007ED05F /* AutoRegistration.swift */; }; CD5B9EF91D8333A9007ED05F /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8D1D832BF9007ED05F /* Operators.swift */; }; CD5B9EFA1D8333A9007ED05F /* SwinjectAutoregistration.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5B9ED91D832E18007ED05F /* SwinjectAutoregistration.h */; settings = {ATTRIBUTES = (Public, ); }; }; CD5B9F0A1D8334BA007ED05F /* SwinjectAutoregistration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD5B9F001D8334BA007ED05F /* SwinjectAutoregistration.framework */; }; CD5B9F1F1D83368E007ED05F /* SwinjectAutoregistration.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5B9ED91D832E18007ED05F /* SwinjectAutoregistration.h */; settings = {ATTRIBUTES = (Public, ); }; }; CD5B9F201D833697007ED05F /* AutoRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8C1D832BF9007ED05F /* AutoRegistration.swift */; }; CD5B9F211D833697007ED05F /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8D1D832BF9007ED05F /* Operators.swift */; }; CD5B9F701D8338FC007ED05F /* AutoRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8C1D832BF9007ED05F /* AutoRegistration.swift */; }; CD5B9F711D8338FC007ED05F /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5B9E8D1D832BF9007ED05F /* Operators.swift */; }; CD5B9F721D833900007ED05F /* SwinjectAutoregistration.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5B9ED91D832E18007ED05F /* SwinjectAutoregistration.h */; settings = {ATTRIBUTES = (Public, ); }; }; CD5B9F761D833A15007ED05F /* SwinjectAutoregistration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD5B9F281D833711007ED05F /* SwinjectAutoregistration.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ ACA255802709E653007AA055 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD5B9E161D832813007ED05F /* Project object */; proxyType = 1; remoteGlobalIDString = CD5B9EEF1D83323F007ED05F; remoteInfo = "SwinjectAutoregistration-watchOS"; }; CD5B9ECC1D832D5A007ED05F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD5B9E161D832813007ED05F /* Project object */; proxyType = 1; remoteGlobalIDString = CD5B9EBF1D832D5A007ED05F; remoteInfo = "SwinjectAutoregistration-iOS"; }; CD5B9F0B1D8334BA007ED05F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD5B9E161D832813007ED05F /* Project object */; proxyType = 1; remoteGlobalIDString = CD5B9EFF1D8334BA007ED05F; remoteInfo = "SwinjectAutoregistration-tvOS"; }; CD5B9F331D833711007ED05F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD5B9E161D832813007ED05F /* Project object */; proxyType = 1; remoteGlobalIDString = CD5B9F271D833711007ED05F; remoteInfo = "SwinjectAutoregistration-OSX"; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ C3124A1C2174D53E00AF0983 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 0A47837625CCA28500BE64FF /* Swinject.xcframework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; C3124A202174D58100AF0983 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 0A47838825CCA3B400BE64FF /* Swinject.xcframework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; C3124A242174D5B400AF0983 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 0A47838125CCA33E00BE64FF /* Swinject.xcframework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Swinject.xcframework; path = Carthage/Build/Swinject.xcframework; sourceTree = ""; }; 986C0CCB26906C6F001BFBFC /* AutoregistrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoregistrationTests.swift; sourceTree = ""; }; 986C0CCF269076F6001BFBFC /* TypeParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeParserTests.swift; sourceTree = ""; }; AC1191091E301CD200B112D9 /* ResolutionError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResolutionError.swift; sourceTree = ""; }; AC1191171E301E3A00B112D9 /* Resolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Resolver.swift; sourceTree = ""; }; AC1191181E301E3A00B112D9 /* CheckResolved.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckResolved.swift; sourceTree = ""; }; AC4AC9481E33C71D00E6355A /* TypeParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeParser.swift; sourceTree = ""; }; AC4AC94A1E33C75200E6355A /* Type.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Type.swift; sourceTree = ""; }; AC5A8FAA1ED1DAA00027334A /* OperatorsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OperatorsTests.swift; sourceTree = ""; }; ACA103271E3E3386004B8CD4 /* ResolutionErrorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResolutionErrorTests.swift; sourceTree = ""; }; ACA2557B2709E653007AA055 /* SwinjectAutoregistration-watchOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwinjectAutoregistration-watchOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9E231D832A4F007ED05F /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; CD5B9E251D832A4F007ED05F /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; CD5B9E261D832A4F007ED05F /* Profile.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Profile.xcconfig; sourceTree = ""; }; CD5B9E271D832A4F007ED05F /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; CD5B9E281D832A4F007ED05F /* Test.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Test.xcconfig; sourceTree = ""; }; CD5B9E2A1D832A4F007ED05F /* Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Application.xcconfig; sourceTree = ""; }; CD5B9E2B1D832A4F007ED05F /* Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Framework.xcconfig; sourceTree = ""; }; CD5B9E2C1D832A4F007ED05F /* StaticLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = StaticLibrary.xcconfig; sourceTree = ""; }; CD5B9E2E1D832A4F007ED05F /* iOS-Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "iOS-Application.xcconfig"; sourceTree = ""; }; CD5B9E2F1D832A4F007ED05F /* iOS-Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "iOS-Base.xcconfig"; sourceTree = ""; }; CD5B9E301D832A4F007ED05F /* iOS-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "iOS-Framework.xcconfig"; sourceTree = ""; }; CD5B9E311D832A4F007ED05F /* iOS-StaticLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "iOS-StaticLibrary.xcconfig"; sourceTree = ""; }; CD5B9E331D832A4F007ED05F /* Mac-Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Mac-Application.xcconfig"; sourceTree = ""; }; CD5B9E341D832A4F007ED05F /* Mac-Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Mac-Base.xcconfig"; sourceTree = ""; }; CD5B9E351D832A4F007ED05F /* Mac-DynamicLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Mac-DynamicLibrary.xcconfig"; sourceTree = ""; }; CD5B9E361D832A4F007ED05F /* Mac-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Mac-Framework.xcconfig"; sourceTree = ""; }; CD5B9E371D832A4F007ED05F /* Mac-StaticLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Mac-StaticLibrary.xcconfig"; sourceTree = ""; }; CD5B9E391D832A4F007ED05F /* tvOS-Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "tvOS-Application.xcconfig"; sourceTree = ""; }; CD5B9E3A1D832A4F007ED05F /* tvOS-Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "tvOS-Base.xcconfig"; sourceTree = ""; }; CD5B9E3B1D832A4F007ED05F /* tvOS-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "tvOS-Framework.xcconfig"; sourceTree = ""; }; CD5B9E3C1D832A4F007ED05F /* tvOS-StaticLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "tvOS-StaticLibrary.xcconfig"; sourceTree = ""; }; CD5B9E8C1D832BF9007ED05F /* AutoRegistration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoRegistration.swift; sourceTree = ""; }; CD5B9E8D1D832BF9007ED05F /* Operators.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = ""; }; CD5B9EB21D832C81007ED05F /* watchOS-Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "watchOS-Application.xcconfig"; sourceTree = ""; }; CD5B9EB31D832C81007ED05F /* watchOS-Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "watchOS-Base.xcconfig"; sourceTree = ""; }; CD5B9EB41D832C81007ED05F /* watchOS-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "watchOS-Framework.xcconfig"; sourceTree = ""; }; CD5B9EB51D832C81007ED05F /* watchOS-StaticLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "watchOS-StaticLibrary.xcconfig"; sourceTree = ""; }; CD5B9EC01D832D5A007ED05F /* SwinjectAutoregistration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwinjectAutoregistration.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9ECA1D832D5A007ED05F /* SwinjectAutoregistration-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwinjectAutoregistration-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9ED81D832E18007ED05F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CD5B9ED91D832E18007ED05F /* SwinjectAutoregistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwinjectAutoregistration.h; sourceTree = ""; }; CD5B9EDD1D832E2E007ED05F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CD5B9EF01D83323F007ED05F /* SwinjectAutoregistration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwinjectAutoregistration.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9F001D8334BA007ED05F /* SwinjectAutoregistration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwinjectAutoregistration.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9F091D8334BA007ED05F /* SwinjectAutoregistration-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwinjectAutoregistration-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9F281D833711007ED05F /* SwinjectAutoregistration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwinjectAutoregistration.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD5B9F311D833711007ED05F /* SwinjectAutoregistration-OSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwinjectAutoregistration-OSXTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; FF3CD0EF26DC25D3007090D2 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ ACA255782709E653007AA055 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ACA2557F2709E653007AA055 /* SwinjectAutoregistration.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EBC1D832D5A007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 0A47832F25CCA1E600BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EC71D832D5A007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CD5B9ECB1D832D5A007ED05F /* SwinjectAutoregistration.framework in Frameworks */, 0A47833425CCA1F400BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EEC1D83323F007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 0A47834125CCA20000BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EFC1D8334BA007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 0A47834625CCA20A00BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F061D8334BA007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CD5B9F0A1D8334BA007ED05F /* SwinjectAutoregistration.framework in Frameworks */, 0A47834D25CCA21400BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F241D833711007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 0A47835225CCA21E00BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F2E1D833711007ED05F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CD5B9F761D833A15007ED05F /* SwinjectAutoregistration.framework in Frameworks */, 0A47835925CCA22700BE64FF /* Swinject.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ AC4AC9471E33C70900E6355A /* Parser */ = { isa = PBXGroup; children = ( AC4AC9481E33C71D00E6355A /* TypeParser.swift */, AC4AC94A1E33C75200E6355A /* Type.swift */, ); name = Parser; sourceTree = ""; }; ACA103241E3E3386004B8CD4 /* SwinjectAutoregistrationTests */ = { isa = PBXGroup; children = ( 986C0CCB26906C6F001BFBFC /* AutoregistrationTests.swift */, 986C0CCF269076F6001BFBFC /* TypeParserTests.swift */, ACA103271E3E3386004B8CD4 /* ResolutionErrorTests.swift */, AC5A8FAA1ED1DAA00027334A /* OperatorsTests.swift */, ); path = SwinjectAutoregistrationTests; sourceTree = ""; }; C3124A002174D30200AF0983 /* Frameworks */ = { isa = PBXGroup; children = ( 0A47832E25CCA1E600BE64FF /* Swinject.xcframework */, ); name = Frameworks; sourceTree = ""; }; CD5B9E151D832813007ED05F = { isa = PBXGroup; children = ( FF3CD0EF26DC25D3007090D2 /* README.md */, CD5B9E8B1D832BF9007ED05F /* Sources */, CD5B9E8E1D832BF9007ED05F /* Tests */, CD5B9EC11D832D5A007ED05F /* Products */, CD5B9E211D832A20007ED05F /* Configurations */, C3124A002174D30200AF0983 /* Frameworks */, ); sourceTree = ""; }; CD5B9E211D832A20007ED05F /* Configurations */ = { isa = PBXGroup; children = ( CD5B9EB11D832C81007ED05F /* watchOS */, CD5B9E221D832A4F007ED05F /* Base */, CD5B9E2D1D832A4F007ED05F /* iOS */, CD5B9E321D832A4F007ED05F /* Mac OS X */, CD5B9E381D832A4F007ED05F /* tvOS */, ); path = Configurations; sourceTree = ""; }; CD5B9E221D832A4F007ED05F /* Base */ = { isa = PBXGroup; children = ( CD5B9E231D832A4F007ED05F /* Common.xcconfig */, CD5B9E241D832A4F007ED05F /* Configurations */, CD5B9E291D832A4F007ED05F /* Targets */, ); path = Base; sourceTree = ""; }; CD5B9E241D832A4F007ED05F /* Configurations */ = { isa = PBXGroup; children = ( CD5B9E251D832A4F007ED05F /* Debug.xcconfig */, CD5B9E261D832A4F007ED05F /* Profile.xcconfig */, CD5B9E271D832A4F007ED05F /* Release.xcconfig */, CD5B9E281D832A4F007ED05F /* Test.xcconfig */, ); path = Configurations; sourceTree = ""; }; CD5B9E291D832A4F007ED05F /* Targets */ = { isa = PBXGroup; children = ( CD5B9E2A1D832A4F007ED05F /* Application.xcconfig */, CD5B9E2B1D832A4F007ED05F /* Framework.xcconfig */, CD5B9E2C1D832A4F007ED05F /* StaticLibrary.xcconfig */, ); path = Targets; sourceTree = ""; }; CD5B9E2D1D832A4F007ED05F /* iOS */ = { isa = PBXGroup; children = ( CD5B9E2E1D832A4F007ED05F /* iOS-Application.xcconfig */, CD5B9E2F1D832A4F007ED05F /* iOS-Base.xcconfig */, CD5B9E301D832A4F007ED05F /* iOS-Framework.xcconfig */, CD5B9E311D832A4F007ED05F /* iOS-StaticLibrary.xcconfig */, ); path = iOS; sourceTree = ""; }; CD5B9E321D832A4F007ED05F /* Mac OS X */ = { isa = PBXGroup; children = ( CD5B9E331D832A4F007ED05F /* Mac-Application.xcconfig */, CD5B9E341D832A4F007ED05F /* Mac-Base.xcconfig */, CD5B9E351D832A4F007ED05F /* Mac-DynamicLibrary.xcconfig */, CD5B9E361D832A4F007ED05F /* Mac-Framework.xcconfig */, CD5B9E371D832A4F007ED05F /* Mac-StaticLibrary.xcconfig */, ); path = "Mac OS X"; sourceTree = ""; }; CD5B9E381D832A4F007ED05F /* tvOS */ = { isa = PBXGroup; children = ( CD5B9E391D832A4F007ED05F /* tvOS-Application.xcconfig */, CD5B9E3A1D832A4F007ED05F /* tvOS-Base.xcconfig */, CD5B9E3B1D832A4F007ED05F /* tvOS-Framework.xcconfig */, CD5B9E3C1D832A4F007ED05F /* tvOS-StaticLibrary.xcconfig */, ); path = tvOS; sourceTree = ""; }; CD5B9E8B1D832BF9007ED05F /* Sources */ = { isa = PBXGroup; children = ( AC4AC9471E33C70900E6355A /* Parser */, AC1191171E301E3A00B112D9 /* Resolver.swift */, AC1191181E301E3A00B112D9 /* CheckResolved.swift */, CD5B9E8C1D832BF9007ED05F /* AutoRegistration.swift */, CD5B9E8D1D832BF9007ED05F /* Operators.swift */, AC1191091E301CD200B112D9 /* ResolutionError.swift */, CD5B9ED81D832E18007ED05F /* Info.plist */, CD5B9ED91D832E18007ED05F /* SwinjectAutoregistration.h */, ); path = Sources; sourceTree = ""; }; CD5B9E8E1D832BF9007ED05F /* Tests */ = { isa = PBXGroup; children = ( ACA103241E3E3386004B8CD4 /* SwinjectAutoregistrationTests */, CD5B9EDD1D832E2E007ED05F /* Info.plist */, ); path = Tests; sourceTree = ""; }; CD5B9EB11D832C81007ED05F /* watchOS */ = { isa = PBXGroup; children = ( CD5B9EB21D832C81007ED05F /* watchOS-Application.xcconfig */, CD5B9EB31D832C81007ED05F /* watchOS-Base.xcconfig */, CD5B9EB41D832C81007ED05F /* watchOS-Framework.xcconfig */, CD5B9EB51D832C81007ED05F /* watchOS-StaticLibrary.xcconfig */, ); path = watchOS; sourceTree = ""; }; CD5B9EC11D832D5A007ED05F /* Products */ = { isa = PBXGroup; children = ( CD5B9EC01D832D5A007ED05F /* SwinjectAutoregistration.framework */, CD5B9ECA1D832D5A007ED05F /* SwinjectAutoregistration-iOSTests.xctest */, CD5B9EF01D83323F007ED05F /* SwinjectAutoregistration.framework */, CD5B9F001D8334BA007ED05F /* SwinjectAutoregistration.framework */, CD5B9F091D8334BA007ED05F /* SwinjectAutoregistration-tvOSTests.xctest */, CD5B9F281D833711007ED05F /* SwinjectAutoregistration.framework */, CD5B9F311D833711007ED05F /* SwinjectAutoregistration-OSXTests.xctest */, ACA2557B2709E653007AA055 /* SwinjectAutoregistration-watchOSTests.xctest */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ CD5B9EBD1D832D5A007ED05F /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CD5B9EDF1D832E32007ED05F /* SwinjectAutoregistration.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EED1D83323F007ED05F /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CD5B9EFA1D8333A9007ED05F /* SwinjectAutoregistration.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EFD1D8334BA007ED05F /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CD5B9F1F1D83368E007ED05F /* SwinjectAutoregistration.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F251D833711007ED05F /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CD5B9F721D833900007ED05F /* SwinjectAutoregistration.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ ACA2557A2709E653007AA055 /* SwinjectAutoregistration-watchOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = ACA255842709E653007AA055 /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-watchOSTests" */; buildPhases = ( ACA255772709E653007AA055 /* Sources */, ACA255782709E653007AA055 /* Frameworks */, ACA255792709E653007AA055 /* Resources */, ); buildRules = ( ); dependencies = ( ACA255812709E653007AA055 /* PBXTargetDependency */, ); name = "SwinjectAutoregistration-watchOSTests"; productName = "SwinjectAutoregistration-watchOSTests"; productReference = ACA2557B2709E653007AA055 /* SwinjectAutoregistration-watchOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; CD5B9EBF1D832D5A007ED05F /* SwinjectAutoregistration-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9ED21D832D5A007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-iOS" */; buildPhases = ( CD5B9EBB1D832D5A007ED05F /* Sources */, CD5B9EBC1D832D5A007ED05F /* Frameworks */, CD5B9EBD1D832D5A007ED05F /* Headers */, CD5B9EBE1D832D5A007ED05F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SwinjectAutoregistration-iOS"; productName = "SwinjectAutoregistration-iOS"; productReference = CD5B9EC01D832D5A007ED05F /* SwinjectAutoregistration.framework */; productType = "com.apple.product-type.framework"; }; CD5B9EC91D832D5A007ED05F /* SwinjectAutoregistration-iOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9ED51D832D5A007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-iOSTests" */; buildPhases = ( CD5B9EC61D832D5A007ED05F /* Sources */, CD5B9EC71D832D5A007ED05F /* Frameworks */, CD5B9EC81D832D5A007ED05F /* Resources */, C3124A1C2174D53E00AF0983 /* CopyFiles */, ); buildRules = ( ); dependencies = ( CD5B9ECD1D832D5A007ED05F /* PBXTargetDependency */, ); name = "SwinjectAutoregistration-iOSTests"; productName = "SwinjectAutoregistration-iOSTests"; productReference = CD5B9ECA1D832D5A007ED05F /* SwinjectAutoregistration-iOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; CD5B9EEF1D83323F007ED05F /* SwinjectAutoregistration-watchOS */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9EF51D83323F007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-watchOS" */; buildPhases = ( CD5B9EEB1D83323F007ED05F /* Sources */, CD5B9EEC1D83323F007ED05F /* Frameworks */, CD5B9EED1D83323F007ED05F /* Headers */, CD5B9EEE1D83323F007ED05F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SwinjectAutoregistration-watchOS"; productName = "SwinjectAutoregistration-watchOS"; productReference = CD5B9EF01D83323F007ED05F /* SwinjectAutoregistration.framework */; productType = "com.apple.product-type.framework"; }; CD5B9EFF1D8334BA007ED05F /* SwinjectAutoregistration-tvOS */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9F111D8334BA007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-tvOS" */; buildPhases = ( CD5B9EFB1D8334BA007ED05F /* Sources */, CD5B9EFC1D8334BA007ED05F /* Frameworks */, CD5B9EFD1D8334BA007ED05F /* Headers */, CD5B9EFE1D8334BA007ED05F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SwinjectAutoregistration-tvOS"; productName = "SwinjectAutoregistration-tvOS"; productReference = CD5B9F001D8334BA007ED05F /* SwinjectAutoregistration.framework */; productType = "com.apple.product-type.framework"; }; CD5B9F081D8334BA007ED05F /* SwinjectAutoregistration-tvOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9F141D8334BA007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-tvOSTests" */; buildPhases = ( CD5B9F051D8334BA007ED05F /* Sources */, CD5B9F061D8334BA007ED05F /* Frameworks */, CD5B9F071D8334BA007ED05F /* Resources */, C3124A202174D58100AF0983 /* CopyFiles */, ); buildRules = ( ); dependencies = ( CD5B9F0C1D8334BA007ED05F /* PBXTargetDependency */, ); name = "SwinjectAutoregistration-tvOSTests"; productName = "SwinjectAutoregistration-tvOSTests"; productReference = CD5B9F091D8334BA007ED05F /* SwinjectAutoregistration-tvOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; CD5B9F271D833711007ED05F /* SwinjectAutoregistration-OSX */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9F391D833711007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-OSX" */; buildPhases = ( CD5B9F231D833711007ED05F /* Sources */, CD5B9F241D833711007ED05F /* Frameworks */, CD5B9F251D833711007ED05F /* Headers */, CD5B9F261D833711007ED05F /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SwinjectAutoregistration-OSX"; productName = "SwinjectAutoregistration-OSX"; productReference = CD5B9F281D833711007ED05F /* SwinjectAutoregistration.framework */; productType = "com.apple.product-type.framework"; }; CD5B9F301D833711007ED05F /* SwinjectAutoregistration-OSXTests */ = { isa = PBXNativeTarget; buildConfigurationList = CD5B9F3C1D833711007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-OSXTests" */; buildPhases = ( CD5B9F2D1D833711007ED05F /* Sources */, CD5B9F2E1D833711007ED05F /* Frameworks */, CD5B9F2F1D833711007ED05F /* Resources */, C3124A242174D5B400AF0983 /* CopyFiles */, ); buildRules = ( ); dependencies = ( CD5B9F341D833711007ED05F /* PBXTargetDependency */, ); name = "SwinjectAutoregistration-OSXTests"; productName = "SwinjectAutoregistration-OSXTests"; productReference = CD5B9F311D833711007ED05F /* SwinjectAutoregistration-OSXTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ CD5B9E161D832813007ED05F /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1300; LastUpgradeCheck = 1240; ORGANIZATIONNAME = "Swinject Contributors"; TargetAttributes = { ACA2557A2709E653007AA055 = { CreatedOnToolsVersion = 13.0; }; CD5B9EBF1D832D5A007ED05F = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1020; }; CD5B9EC91D832D5A007ED05F = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1020; }; CD5B9EEF1D83323F007ED05F = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1020; }; CD5B9EFF1D8334BA007ED05F = { CreatedOnToolsVersion = 7.3.1; }; CD5B9F081D8334BA007ED05F = { CreatedOnToolsVersion = 7.3.1; }; CD5B9F271D833711007ED05F = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 0800; }; CD5B9F301D833711007ED05F = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 0800; }; }; }; buildConfigurationList = CD5B9E191D832813007ED05F /* Build configuration list for PBXProject "SwinjectAutoregistration" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = CD5B9E151D832813007ED05F; productRefGroup = CD5B9EC11D832D5A007ED05F /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( CD5B9EBF1D832D5A007ED05F /* SwinjectAutoregistration-iOS */, CD5B9EC91D832D5A007ED05F /* SwinjectAutoregistration-iOSTests */, CD5B9EEF1D83323F007ED05F /* SwinjectAutoregistration-watchOS */, ACA2557A2709E653007AA055 /* SwinjectAutoregistration-watchOSTests */, CD5B9EFF1D8334BA007ED05F /* SwinjectAutoregistration-tvOS */, CD5B9F081D8334BA007ED05F /* SwinjectAutoregistration-tvOSTests */, CD5B9F271D833711007ED05F /* SwinjectAutoregistration-OSX */, CD5B9F301D833711007ED05F /* SwinjectAutoregistration-OSXTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ ACA255792709E653007AA055 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EBE1D832D5A007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EC81D832D5A007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EEE1D83323F007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EFE1D8334BA007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F071D8334BA007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F261D833711007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F2F1D833711007ED05F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ ACA255772709E653007AA055 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( ACA255852709E679007AA055 /* AutoregistrationTests.swift in Sources */, ACA255872709E680007AA055 /* ResolutionErrorTests.swift in Sources */, ACA255882709E683007AA055 /* OperatorsTests.swift in Sources */, ACA255862709E67D007AA055 /* TypeParserTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EBB1D832D5A007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CD5B9EE01D833088007ED05F /* AutoRegistration.swift in Sources */, AC11910A1E301CD200B112D9 /* ResolutionError.swift in Sources */, AC11911A1E301E3A00B112D9 /* CheckResolved.swift in Sources */, CD5B9EE11D833088007ED05F /* Operators.swift in Sources */, AC1191191E301E3A00B112D9 /* Resolver.swift in Sources */, AC4AC9491E33C71D00E6355A /* TypeParser.swift in Sources */, AC4AC94B1E33C75200E6355A /* Type.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EC61D832D5A007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AC5A8FAB1ED1DAA00027334A /* OperatorsTests.swift in Sources */, 986C0CD0269076F6001BFBFC /* TypeParserTests.swift in Sources */, 986C0CCC26906C6F001BFBFC /* AutoregistrationTests.swift in Sources */, ACA1032F1E3E3397004B8CD4 /* ResolutionErrorTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EEB1D83323F007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AC11911E1E30210A00B112D9 /* CheckResolved.swift in Sources */, AC11911C1E30210500B112D9 /* Resolver.swift in Sources */, AC4AC94C1E33CB9100E6355A /* TypeParser.swift in Sources */, CD5B9EF81D8333A9007ED05F /* AutoRegistration.swift in Sources */, AC4AC94F1E33CB9600E6355A /* Type.swift in Sources */, AC1191211E30211300B112D9 /* ResolutionError.swift in Sources */, CD5B9EF91D8333A9007ED05F /* Operators.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9EFB1D8334BA007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AC11911F1E30210B00B112D9 /* CheckResolved.swift in Sources */, AC11911D1E30210500B112D9 /* Resolver.swift in Sources */, AC4AC94D1E33CB9100E6355A /* TypeParser.swift in Sources */, CD5B9F201D833697007ED05F /* AutoRegistration.swift in Sources */, AC4AC9501E33CB9700E6355A /* Type.swift in Sources */, AC1191221E30211400B112D9 /* ResolutionError.swift in Sources */, CD5B9F211D833697007ED05F /* Operators.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F051D8334BA007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AC5A8FBB1ED1DC2B0027334A /* OperatorsTests.swift in Sources */, 986C0CD1269076F6001BFBFC /* TypeParserTests.swift in Sources */, 986C0CCD26906C6F001BFBFC /* AutoregistrationTests.swift in Sources */, ACA103301E3E3398004B8CD4 /* ResolutionErrorTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F231D833711007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AC1191201E30210C00B112D9 /* CheckResolved.swift in Sources */, AC11911B1E30210200B112D9 /* Resolver.swift in Sources */, AC4AC94E1E33CB9200E6355A /* TypeParser.swift in Sources */, CD5B9F701D8338FC007ED05F /* AutoRegistration.swift in Sources */, AC4AC9511E33CB9700E6355A /* Type.swift in Sources */, AC1191231E30211500B112D9 /* ResolutionError.swift in Sources */, CD5B9F711D8338FC007ED05F /* Operators.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD5B9F2D1D833711007ED05F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AC5A8FBC1ED1DC2B0027334A /* OperatorsTests.swift in Sources */, 986C0CD2269076F6001BFBFC /* TypeParserTests.swift in Sources */, 986C0CCE26906C6F001BFBFC /* AutoregistrationTests.swift in Sources */, ACA103311E3E339A004B8CD4 /* ResolutionErrorTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ ACA255812709E653007AA055 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CD5B9EEF1D83323F007ED05F /* SwinjectAutoregistration-watchOS */; targetProxy = ACA255802709E653007AA055 /* PBXContainerItemProxy */; }; CD5B9ECD1D832D5A007ED05F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CD5B9EBF1D832D5A007ED05F /* SwinjectAutoregistration-iOS */; targetProxy = CD5B9ECC1D832D5A007ED05F /* PBXContainerItemProxy */; }; CD5B9F0C1D8334BA007ED05F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CD5B9EFF1D8334BA007ED05F /* SwinjectAutoregistration-tvOS */; targetProxy = CD5B9F0B1D8334BA007ED05F /* PBXContainerItemProxy */; }; CD5B9F341D833711007ED05F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CD5B9F271D833711007ED05F /* SwinjectAutoregistration-OSX */; targetProxy = CD5B9F331D833711007ED05F /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ ACA255822709E653007AA055 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9EB21D832C81007ED05F /* watchOS-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 56QMJ73J7W; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_INFOPLIST_FILE = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-watchOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; ACA255832709E653007AA055 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9EB21D832C81007ED05F /* watchOS-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 56QMJ73J7W; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_INFOPLIST_FILE = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-watchOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; CD5B9E1A1D832813007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E251D832A4F007ED05F /* Debug.xcconfig */; buildSettings = { CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CURRENT_PROJECT_VERSION = 1; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 10.10; OTHER_SWIFT_FLAGS = "-D DEBUG -Xfrontend -debug-time-function-bodies"; SWIFT_VERSION = 5.0; }; name = Debug; }; CD5B9E1B1D832813007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E271D832A4F007ED05F /* Release.xcconfig */; buildSettings = { CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CURRENT_PROJECT_VERSION = 1; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 10.10; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_VERSION = 5.0; }; name = Release; }; CD5B9ED31D832D5A007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E301D832A4F007ED05F /* iOS-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = Sources/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; PRODUCT_BUNDLE_IDENTIFIER = "com.swinject.SwinjectAutoregistration-iOS"; }; name = Debug; }; CD5B9ED41D832D5A007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E301D832A4F007ED05F /* iOS-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = Sources/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; PRODUCT_BUNDLE_IDENTIFIER = "com.swinject.SwinjectAutoregistration-iOS"; }; name = Release; }; CD5B9ED61D832D5A007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E2E1D832A4F007ED05F /* iOS-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-iOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Debug; }; CD5B9ED71D832D5A007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E2E1D832A4F007ED05F /* iOS-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-iOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; VALIDATE_PRODUCT = YES; }; name = Release; }; CD5B9EF61D83323F007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9EB41D832C81007ED05F /* watchOS-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); INFOPLIST_FILE = Sources/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-watchOS"; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; CD5B9EF71D83323F007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9EB41D832C81007ED05F /* watchOS-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); INFOPLIST_FILE = Sources/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-watchOS"; WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; CD5B9F121D8334BA007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E3B1D832A4F007ED05F /* tvOS-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); INFOPLIST_FILE = Sources/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-tvOS"; TVOS_DEPLOYMENT_TARGET = 11.0; }; name = Debug; }; CD5B9F131D8334BA007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E3B1D832A4F007ED05F /* tvOS-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); INFOPLIST_FILE = Sources/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-tvOS"; TVOS_DEPLOYMENT_TARGET = 11.0; }; name = Release; }; CD5B9F151D8334BA007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E391D832A4F007ED05F /* tvOS-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; CD5B9F161D8334BA007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E391D832A4F007ED05F /* tvOS-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; TVOS_DEPLOYMENT_TARGET = 12.0; VALIDATE_PRODUCT = YES; }; name = Release; }; CD5B9F3A1D833711007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E361D832A4F007ED05F /* Mac-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); INFOPLIST_FILE = Sources/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-OSX"; }; name = Debug; }; CD5B9F3B1D833711007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E361D832A4F007ED05F /* Mac-Framework.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build", ); INFOPLIST_FILE = Sources/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-OSX"; }; name = Release; }; CD5B9F3D1D833711007ED05F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E331D832A4F007ED05F /* Mac-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/Mac", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-OSXTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Debug; }; CD5B9F3E1D833711007ED05F /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = CD5B9E331D832A4F007ED05F /* Mac-Application.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/Mac", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "org.swinject.SwinjectAutoregistration-OSXTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ ACA255842709E653007AA055 /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-watchOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( ACA255822709E653007AA055 /* Debug */, ACA255832709E653007AA055 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9E191D832813007ED05F /* Build configuration list for PBXProject "SwinjectAutoregistration" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9E1A1D832813007ED05F /* Debug */, CD5B9E1B1D832813007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9ED21D832D5A007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9ED31D832D5A007ED05F /* Debug */, CD5B9ED41D832D5A007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9ED51D832D5A007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-iOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9ED61D832D5A007ED05F /* Debug */, CD5B9ED71D832D5A007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9EF51D83323F007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-watchOS" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9EF61D83323F007ED05F /* Debug */, CD5B9EF71D83323F007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9F111D8334BA007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9F121D8334BA007ED05F /* Debug */, CD5B9F131D8334BA007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9F141D8334BA007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-tvOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9F151D8334BA007ED05F /* Debug */, CD5B9F161D8334BA007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9F391D833711007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-OSX" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9F3A1D833711007ED05F /* Debug */, CD5B9F3B1D833711007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD5B9F3C1D833711007ED05F /* Build configuration list for PBXNativeTarget "SwinjectAutoregistration-OSXTests" */ = { isa = XCConfigurationList; buildConfigurations = ( CD5B9F3D1D833711007ED05F /* Debug */, CD5B9F3E1D833711007ED05F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = CD5B9E161D832813007ED05F /* Project object */; } ================================================ FILE: SwinjectAutoregistration.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: SwinjectAutoregistration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: SwinjectAutoregistration.xcodeproj/xcshareddata/xcschemes/SwinjectAutoregistration-OSX.xcscheme ================================================ ================================================ FILE: SwinjectAutoregistration.xcodeproj/xcshareddata/xcschemes/SwinjectAutoregistration-iOS.xcscheme ================================================ ================================================ FILE: SwinjectAutoregistration.xcodeproj/xcshareddata/xcschemes/SwinjectAutoregistration-tvOS.xcscheme ================================================ ================================================ FILE: SwinjectAutoregistration.xcodeproj/xcshareddata/xcschemes/SwinjectAutoregistration-watchOS.xcscheme ================================================ ================================================ FILE: Tests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 2.9.1 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: Tests/LinuxMain.swift ================================================ import XCTest import SwinjectAutoregistrationTests var tests = [XCTestCaseEntry]() tests += SwinjectAutoregistrationTests.__allTests() XCTMain(tests) ================================================ FILE: Tests/SwinjectAutoregistrationTests/AutoregistrationTests.swift ================================================ // // AutoregistrationTests.swift // SwinjectAutoregistration // // Created by Yoichi Tagaya on 2021/07/03. // Copyright © 2021 Swinject Contributors. All rights reserved. // import XCTest import SwinjectAutoregistration import Swinject class AutoregistrationTests: XCTestCase { class DependencyA {} class DependencyB {} class DependencyC {} class DependencyD {} class DependencyE {} class DependencyF {} class DependencyG {} class DependencyH {} class DependencyI {} class DependencyJ {} class Service0 { init(){} } class Service1 { init(a: DependencyA){} } class Service2 { init(a: DependencyA, b: DependencyB){} } class Service3 { init(a: DependencyA, b: DependencyB, c: DependencyC){} } class Service4 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD){} } class Service5 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE){} } class Service6 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF){} } class Service7 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG){} } class Service8 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH){} } class Service9 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH, i: DependencyI){} } class Service10 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH, i: DependencyI, j: DependencyJ){} } class Service20 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH, i: DependencyI, j: DependencyJ, k: DependencyA, l: DependencyB, m: DependencyC, n: DependencyD, o: DependencyE, p: DependencyF, q: DependencyG, r: DependencyH, s: DependencyI, t: DependencyJ){} } class Service21 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH, i: DependencyI, j: DependencyJ, k: DependencyA, l: DependencyB, m: DependencyC, n: DependencyD, o: DependencyE, p: DependencyF, q: DependencyG, r: DependencyH, s: DependencyI, t: DependencyJ, u: DependencyA){} } class OptionalService { init(a: DependencyA?){} } class UnwrappedService { init(a: DependencyA!){} } class SameArgumentsService { let nameA: String; let nameB: String init(a: DependencyA, nameA: String, age: Int, nameB: String){ self.nameA = nameA; self.nameB = nameB } } var container: Container! override func setUpWithError() throws { container = Container() container.autoregister(DependencyA.self, initializer: DependencyA.init) container.autoregister(DependencyB.self, initializer: DependencyB.init) container.autoregister(DependencyC.self, initializer: DependencyC.init) container.autoregister(DependencyD.self, initializer: DependencyD.init) container.autoregister(DependencyE.self, initializer: DependencyE.init) container.autoregister(DependencyF.self, initializer: DependencyF.init) container.autoregister(DependencyG.self, initializer: DependencyG.init) container.autoregister(DependencyH.self, initializer: DependencyH.init) container.autoregister(DependencyI.self, initializer: DependencyI.init) container.autoregister(DependencyJ.self, initializer: DependencyJ.init) } func testServiceIsRegisteredWithZeroDependencies() { container.autoregister(Service0.self, initializer: Service0.init) let service = container.resolve(Service0.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithOneDependency() { container.autoregister(Service1.self, initializer: Service1.init) let service = container.resolve(Service1.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithTwoDependencies() { container.autoregister(Service2.self, initializer: Service2.init) let service = container.resolve(Service2.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithThreeDependencies() { container.autoregister(Service3.self, initializer: Service3.init) let service = container.resolve(Service3.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithFourDependencies() { container.autoregister(Service4.self, initializer: Service4.init) let service = container.resolve(Service4.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithFiveDependencies() { container.autoregister(Service5.self, initializer: Service5.init) let service = container.resolve(Service5.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithSixDependencies() { container.autoregister(Service6.self, initializer: Service6.init) let service = container.resolve(Service6.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithSevenDependencies() { container.autoregister(Service7.self, initializer: Service7.init) let service = container.resolve(Service7.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithEightDependencies() { container.autoregister(Service8.self, initializer: Service8.init) let service = container.resolve(Service8.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithNineDependencies() { container.autoregister(Service9.self, initializer: Service9.init) let service = container.resolve(Service9.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithTwentyDependencies() { container.autoregister(Service20.self, initializer: Service20.init) let service = container.resolve(Service20.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithOneDynamicArgument() { container.autoregister(Service2.self, argument: DependencyB.self, initializer: Service2.init) let service = container.resolve(Service2.self, argument: DependencyB()) XCTAssertNotNil(service) } func testServiceIsRegisteredWithTwoDynamicArguments() { container.autoregister(Service3.self, arguments: DependencyB.self, DependencyC.self, initializer: Service3.init) let service = container.resolve(Service3.self, arguments: DependencyB(), DependencyC()) XCTAssertNotNil(service) } func testServiceIsRegisteredWithThreeDynamicArguments() { container.autoregister(Service4.self, arguments: DependencyB.self, DependencyC.self, DependencyD.self, initializer: Service4.init) let service = container.resolve(Service4.self, arguments: DependencyB(), DependencyC(), DependencyD()) XCTAssertNotNil(service) } func testServiceIsRegisteredWithFourDynamicArguments() { container.autoregister(Service4.self, arguments: DependencyC.self, DependencyD.self, DependencyB.self, initializer: Service4.init) let service = container.resolve(Service4.self, arguments: DependencyC(), DependencyD(), DependencyB()) XCTAssertNotNil(service) } func testServiceIsRegisteredWithOptionalDependencies() { container.autoregister(OptionalService.self, initializer: OptionalService.init) let service = container.resolve(OptionalService.self) XCTAssertNotNil(service) } func testServiceIsRegisteredWithUnwrrappedDependencies() { container.autoregister(UnwrappedService.self, initializer: UnwrappedService.init) let service = container.resolve(UnwrappedService.self) XCTAssertNotNil(service) } #if !SWIFT_PACKAGE && arch(x86_64) func testAssertionIsThrownWhenSameTypeArgumentsArePassed() { // For now we just comment out the test for `precondition()` because we cannot do it without depending on Nimble or CwlPreconditionTesting. // container.autoregister(SameArgumentsService.self, arguments: String.self, Int.self, String.self, initializer: SameArgumentsService.init) } func testAssertionIsThrownWhenTryingToResolveServiceWithTooManyDependencies() { // For now we just comment out the test for `precondition()` because we cannot do it without depending on Nimble or CwlPreconditionTesting. // container.autoregister(Service21.self, initializer: Service21.init) // _ = container.resolve(Service21.self) } #endif func testLoggingFunctionIsNotErased() { var logs: [String] = [] Container.loggingFunction = { logs.append($0) } container.autoregister(Service1.self, initializer: Service1.init) let service = container.resolve(Service1.self) XCTAssertNotNil(service) XCTAssertEqual(logs.count, 0) let unresolvableService = container.resolve(String.self) XCTAssertNil(unresolvableService) XCTAssertEqual(logs.count, 1) } #if !SWIFT_PACKAGE func testAnyLogsAreNotLostWhileMultithreading() { var logs: [String] = [] Container.loggingFunction = { logs.append($0) } container.autoregister(Service1.self, initializer: Service1.init) let resolutionsCount = 1000 let queue = DispatchQueue(label: "queue", attributes: .concurrent) let container = self.container! queue.async { (0.. Bool) { let expectation = XCTestExpectation() DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { XCTAssert(expression()) expectation.fulfill() } XCTWaiter().wait(for: [expectation], timeout: 1.0) } ================================================ FILE: Tests/SwinjectAutoregistrationTests/OperatorsTests.swift ================================================ import XCTest import Swinject import SwinjectAutoregistration class OperatorsTests: XCTestCase { class DependencyA {} class DependencyB {} class DependencyC {} class DependencyD {} class Service0 {} class Service1 { init(a: String){} } class Service2 { init(a: String, b: Int){} } class Service3 { init(a: String, b: Int, c: Double){} } var container: Container! override func setUpWithError() throws { container = Container() container.register(Service0.self) { r in Service0() } container.register(Service0.self, name: "MyService") { r in Service0() } container.register(Service1.self) { r, a in Service1(a: a) } container.register(Service1.self, name: "MyService1") { r, a in Service1(a: a) } container.register(Service2.self) { r, a, b in Service2(a: a, b: b) } container.register(Service2.self, name: "MyService2") { r, a, b in Service2(a: a, b: b) } container.register(Service3.self) { r, a, b, c in Service3(a: a, b: b, c: c) } container.register(Service3.self, name: "MyService3") { r, a, b, c in Service3(a: a, b: b, c: c) } } func testResolvingServiceUsingPostfixOperator() { let service: Service0 = container~> XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperator() { let service = container ~> Service0.self XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperatorWithName() { let service = container ~> (Service0.self, name: "MyService") XCTAssertNotNil(service) } #if !SWIFT_PACKAGE && arch(x86_64) func testFailingWithMessageOnUnresolvableService() { // For now we just comment out the test for `precondition()` because we cannot do it without depending on Nimble or CwlPreconditionTesting. // var logs = [String]() // Container.loggingFunction = { logs.append($0) } // // let expectation: Expectation = expect { // _ = container ~> (Service0.self, name: "NonExistentService") // } // // XCTAssertEqual(logs.count, 1) } #endif func testResolvingServiceUsingInfixOperatorWith1DynamicArgument() { let service = container ~> (Service1.self, argument: "Arg1") XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperatorWithNameAnd1DynamicArgument() { let service = container ~> (Service1.self, name: "MyService1", argument: "Arg1") XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperatorWith2DynamicArguments() { let service = container ~> (Service2.self, arguments: ("Arg1", 5)) XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperatorWithNameAnd2DynamicArguments() { let service: Service2 = container ~> (Service2.self, name: "MyService2", arguments: ("Arg1", 5)) XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperatorWith3DynamicArguments() { let service = container ~> (Service3.self, arguments: ("Arg1", 5, 0.2)) XCTAssertNotNil(service) } func testResolvingServiceUsingInfixOperatorWithNameAnd3DynamicArguments() { let service = container ~> (Service3.self, name: "MyService3", arguments: ("Arg1", 5, 0.2)) XCTAssertNotNil(service) } func testResolvingServiceUsingDeprecatedInfixOperators() { //This call has been removed //let service2 = container ~> (Service2.self, arguments: "Arg1", 5) //This never worked //let service2_name: Service2 = container ~> (Service2.self, name: "MyService2", arguments: "Arg1", 5) //This is deprecated let service3 = container ~> (Service3.self, arguments: "Arg1", 5, 0.2) let service3_name = container ~> (Service3.self, name: "MyService3", arguments: "Arg1", 5, 0.2) XCTAssertNotNil(service3) XCTAssertNotNil(service3_name) } func testResolvingOptionalServiceWithPostfixOperator() { let service: Service0? = container~> XCTAssertNotNil(service) } func testResolvingOptionalServiceUsingInfixOperator() { let service = container ~> Service0?.self XCTAssertNotNil(service) } } ================================================ FILE: Tests/SwinjectAutoregistrationTests/ResolutionErrorTests.swift ================================================ #if !SWIFT_PACKAGE import XCTest @testable import SwinjectAutoregistration extension ResolutionError: Equatable {} public func ==(lhs: ResolutionError, rhs: ResolutionError) -> Bool { switch (lhs, rhs){ case (.tooManyDependencies(let ldependencyCount), .tooManyDependencies(let rdependencyCount)): return ldependencyCount == rdependencyCount } } class ResolutionErrorTests: XCTestCase { class DependencyA {} class DependencyB {} class DependencyC {} class DependencyD {} class DependencyE {} class DependencyF {} class DependencyG {} class DependencyH {} class DependencyI {} class DependencyJ {} class Service1 { init(a: DependencyA){} } class Service2 { init(a: DependencyA, b: DependencyB){} } class Service3 { init(a: DependencyA, b: DependencyB, c: DependencyC){} } class Service9 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH, i: DependencyI){} } class Service21 { init(a: DependencyA, b: DependencyB, c: DependencyC, d: DependencyD, e: DependencyE, f: DependencyF, g: DependencyG, h: DependencyH, i: DependencyI, j: DependencyJ, k: DependencyA, l: DependencyB, m: DependencyC, n: DependencyD, o: DependencyE, p: DependencyF, q: DependencyG, r: DependencyH, s: DependencyI, t: DependencyJ, u: DependencyA){} } class OptionalService { init(a: DependencyB?){} } class UnwrappedService { init(a: DependencyA!, b: DependencyB){} } class BadService { init(a: DependencyA, b: DependencyB, c: DependencyC!, d: DependencyD?, e: DependencyE!, f: DependencyF, g: DependencyG, h: DependencyH?, i: DependencyI, j: DependencyJ, k: DependencyA, l: DependencyB, m: DependencyC, n: DependencyD, o: DependencyE, p: DependencyF, q: DependencyG, r: DependencyH, s: DependencyI, t: DependencyJ, u: DependencyA){} } class OptionalSingleTupleService { init(tuple: (a: DependencyA?, b: DependencyB?, c: DependencyC?)){} } class OptionalMutipleTupleService { init(tupleA: (a: DependencyA?, b: DependencyB?, c: DependencyC?), tupleB: (a: DependencyA?, b: DependencyB?)){} } class NestedClosureService { init(closure: (((String) -> String)?) -> String){} } class OptionalNestedClosureService { init(closure: ((((String) -> String)?) -> String)?){} } func testShowingWarningForServiceWithTooManyDependencies() { let w = resolutionErrors(forInitializer: Service21.init) XCTAssertEqual(w.first, ResolutionError.tooManyDependencies(21)) } func testNotShowingWarningForSingleDependency() { let w = resolutionErrors(forInitializer: Service1.init) XCTAssertEqual(w.count, 0) } func testShowingWarningForServiceWith9Dependencies() { let w = resolutionErrors(forInitializer: Service9.init) XCTAssertEqual(w.count, 0) } func testShowingWarningForServiceWithOptionalDependency() { let w = resolutionErrors(forInitializer: OptionalService.init) XCTAssertEqual(w.count, 0) } func testNotShowingWarningForServiceWithUnwrappedDependency() { let w = resolutionErrors(forInitializer: UnwrappedService.init) XCTAssertEqual(w.count, 0) } // This might fail // Single argument tuple looks exactly the same as multiple arguments when printed func testNotShowingWarningForSingleArgumentTupleOfOptonals() { let w = resolutionErrors(forInitializer: OptionalSingleTupleService.init) XCTAssertEqual(w.count, 0) } func testNotShowingWarningForMultiipleArgumentTuplesOfOptionals() { let w = resolutionErrors(forInitializer: OptionalMutipleTupleService.init) XCTAssertEqual(w.count, 0) } func testNotShowingWarningForNestedClosures() { let w = resolutionErrors(forInitializer: NestedClosureService.init) XCTAssertEqual(w.count, 0) } func testNotShowingWarningForOptionalClosure() { let w = resolutionErrors(forInitializer: OptionalNestedClosureService.init) XCTAssertEqual(w.count, 0) } } #endif ================================================ FILE: Tests/SwinjectAutoregistrationTests/TypeParserTests.swift ================================================ // // TypeParserTests.swift // SwinjectAutoregistration // // Created by Yoichi Tagaya on 2021/07/03. // Copyright © 2021 Swinject Contributors. All rights reserved. // #if !os(Linux) && !os(Android) import XCTest protocol ProtocolA{} protocol ProtocolB{} class ClassA{ class Nested{} } class _x0name²y {} class `protocol` {} @testable import SwinjectAutoregistration class TypeParserTests: XCTestCase { //Helpers func identifier(_ name: String, generics: [Type] = []) -> Type { return Type.identifier(TypeIdentifier(name: name, genericTypes: generics)) } func generic_identifier(_ name: String, generics: [String]) -> Type { return Type.identifier(TypeIdentifier(name: name, genericTypes: generics.map { identifier($0) })) } func testParserScansTypeIdentifier() { let string = "\(_x0name²y.self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, self.identifier(string)) } func testParserDoesNotScanNonTypeIdentifier() { let string = "1Array" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, nil) } func testParserScansSubtypeIdentifier() { let string = "\(ClassA.Nested.self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, self.identifier("Nested")) } func testParserScansArrayType() { let string = "\([String].self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, self.generic_identifier("Array", generics: ["String"])) } func testParserScansGenericTypeWithMultipleArguments() { let string = "\([Int: String].self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, self.generic_identifier("Dictionary", generics: ["Int", "String"])) } func testParserScansTupleType() { let string = "\((name: String, count: Int).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, Type.tuple([self.identifier("String"), self.identifier("Int")])) } func testParserScansTupleOfTuples() { let string = "\(((String, Int, Double), [String]).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, Type.tuple([Type.tuple([self.identifier("String"), self.identifier("Int"), self.identifier("Double")]), self.generic_identifier("Array", generics: ["String"])])) } func testParserScansClosureType() { let string = "\(((String, Int) -> String).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, Type.closure(parameters: [self.identifier("String"), self.identifier("Int")], returnType: self.identifier("String"), throws: false)) } func testParserScansNestedFunctionType() { let string = "\((((String) -> String, Int) -> String).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, Type.closure(parameters: [Type.closure(parameters: [self.identifier("String")], returnType: self.identifier("String"), throws: false), self.identifier("Int")], returnType: self.identifier("String"), throws: false)) } func testParserScansNoParameterFunctionType() { let string = "\((() -> Void).self)" let parser = TypeParser(string: string) let type = parser.parseType() let void = Type.tuple([]) // Void is empty tuple XCTAssertEqual(type, Type.closure(parameters: [], returnType: void, throws: false)) } func testParserScansThrowingFunctionType() { let string = "\((() throws -> Void).self)" let parser = TypeParser(string: string) let type = parser.parseType() let void = Type.tuple([]) // Void is empty tuple XCTAssertEqual(type, Type.closure(parameters: [], returnType: void, throws: true)) } func testParserScansOptional() { let string = "\((Int?).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, self.generic_identifier("Optional", generics: ["Int"])) } func testParserScansProtocolCompositionType() { let string = "\((ProtocolA & ProtocolB).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, Type.protocolComposition([TypeIdentifier(name: "ProtocolA"), TypeIdentifier(name: "ProtocolB")])) } func testParserScansMetatypes() { let string = "\((ProtocolA.Type.Type).self)" // Very meta let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, Type.identifier(TypeIdentifier(name: "ProtocolA", subTypeIdentifier: TypeIdentifier(name: "Type", subTypeIdentifier: TypeIdentifier(name: "Type"))))) } func testParserScansBacktickedType() { let string = "\((`protocol`).self)" let parser = TypeParser(string: string) let type = parser.parseType() XCTAssertEqual(type, self.identifier(string)) } } #endif ================================================ FILE: Tests/SwinjectAutoregistrationTests/XCTestManifests.swift ================================================ #if !canImport(ObjectiveC) import XCTest extension AutoregistrationTests { // DO NOT MODIFY: This is autogenerated, use: // `swift test --generate-linuxmain` // to regenerate. static let __allTests__AutoregistrationTests = [ ("testLoggingFunctionIsNotErased", testLoggingFunctionIsNotErased), ("testServiceIsRegisteredWithEightDependencies", testServiceIsRegisteredWithEightDependencies), ("testServiceIsRegisteredWithFiveDependencies", testServiceIsRegisteredWithFiveDependencies), ("testServiceIsRegisteredWithFourDependencies", testServiceIsRegisteredWithFourDependencies), ("testServiceIsRegisteredWithFourDynamicArguments", testServiceIsRegisteredWithFourDynamicArguments), ("testServiceIsRegisteredWithNineDependencies", testServiceIsRegisteredWithNineDependencies), ("testServiceIsRegisteredWithOneDependency", testServiceIsRegisteredWithOneDependency), ("testServiceIsRegisteredWithOneDynamicArgument", testServiceIsRegisteredWithOneDynamicArgument), ("testServiceIsRegisteredWithOptionalDependencies", testServiceIsRegisteredWithOptionalDependencies), ("testServiceIsRegisteredWithSevenDependencies", testServiceIsRegisteredWithSevenDependencies), ("testServiceIsRegisteredWithSixDependencies", testServiceIsRegisteredWithSixDependencies), ("testServiceIsRegisteredWithThreeDependencies", testServiceIsRegisteredWithThreeDependencies), ("testServiceIsRegisteredWithThreeDynamicArguments", testServiceIsRegisteredWithThreeDynamicArguments), ("testServiceIsRegisteredWithTwentyDependencies", testServiceIsRegisteredWithTwentyDependencies), ("testServiceIsRegisteredWithTwoDependencies", testServiceIsRegisteredWithTwoDependencies), ("testServiceIsRegisteredWithTwoDynamicArguments", testServiceIsRegisteredWithTwoDynamicArguments), ("testServiceIsRegisteredWithUnwrrappedDependencies", testServiceIsRegisteredWithUnwrrappedDependencies), ("testServiceIsRegisteredWithZeroDependencies", testServiceIsRegisteredWithZeroDependencies), ] } extension OperatorsTests { // DO NOT MODIFY: This is autogenerated, use: // `swift test --generate-linuxmain` // to regenerate. static let __allTests__OperatorsTests = [ ("testResolvingOptionalServiceUsingInfixOperator", testResolvingOptionalServiceUsingInfixOperator), ("testResolvingOptionalServiceWithPostfixOperator", testResolvingOptionalServiceWithPostfixOperator), ("testResolvingServiceUsingDeprecatedInfixOperators", testResolvingServiceUsingDeprecatedInfixOperators), ("testResolvingServiceUsingInfixOperator", testResolvingServiceUsingInfixOperator), ("testResolvingServiceUsingInfixOperatorWith1DynamicArgument", testResolvingServiceUsingInfixOperatorWith1DynamicArgument), ("testResolvingServiceUsingInfixOperatorWith2DynamicArguments", testResolvingServiceUsingInfixOperatorWith2DynamicArguments), ("testResolvingServiceUsingInfixOperatorWith3DynamicArguments", testResolvingServiceUsingInfixOperatorWith3DynamicArguments), ("testResolvingServiceUsingInfixOperatorWithName", testResolvingServiceUsingInfixOperatorWithName), ("testResolvingServiceUsingInfixOperatorWithNameAnd1DynamicArgument", testResolvingServiceUsingInfixOperatorWithNameAnd1DynamicArgument), ("testResolvingServiceUsingInfixOperatorWithNameAnd2DynamicArguments", testResolvingServiceUsingInfixOperatorWithNameAnd2DynamicArguments), ("testResolvingServiceUsingInfixOperatorWithNameAnd3DynamicArguments", testResolvingServiceUsingInfixOperatorWithNameAnd3DynamicArguments), ("testResolvingServiceUsingPostfixOperator", testResolvingServiceUsingPostfixOperator), ] } public func __allTests() -> [XCTestCaseEntry] { return [ testCase(AutoregistrationTests.__allTests__AutoregistrationTests), testCase(OperatorsTests.__allTests__OperatorsTests) ] } #endif ================================================ FILE: bin/generate ================================================ #!/usr/bin/env xcrun swift // Generates a Swift file with registration fuctions and other helper methods import Foundation let genericServices = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] let genericArgumentPrefix = "Arg" let autoregistrationPath = "Sources/AutoRegistration.swift" let checksPath = "Sources/CheckResolved.swift" let resolverPath = "Sources/Resolver.swift" func headers(_ fileName: String) -> String { return ["//", "// \(fileName)", "// SwinjectAutoregistration", "//", "// Generated by Swinject AutoRegistration generator.", "// Copyright © 2017 Swinject Contributors. All rights reserved.", "//"].joined(separator: "\n") } func registerComment(_ dependencies: Int, arguments: Int) -> String { let genericArguments = (1..<(arguments+1)).map{ "\(genericArgumentPrefix)\($0)" } // ["Arg1", "Arg2", "Arg3"] return [ "/** Registers a factory that resolves the Service based on dependencies inferred from the Service initializer.", " ", " Usage: `autoregister(MyService.self\((arguments > 0) ? ", \(arguments == 1 ? "argument" : "arguments"): \(commaConcat(genericArguments.map{"\($0).self"}))" : "")), initializer: MyService.init`", " - Parameters:", " - service: Registered service type", " - name: Optional name of the service", (arguments > 0) ? " - \(arguments == 1 ? "argument" : "arguments"): Argument type(s) that will be resolved dynamically instead of resolving dependency" : "", " - initializer: Initializer of the registered service", " - Returns: The registered service entry \(arguments > 0 ? "with \(arguments) arguments" : "")", " - Important: Might fail if one of the dependencies is unresolvable.", " */" ].joined(separator: "\n") } extension Array { subscript(safe index: Int) -> Element? { return indices ~= index ? self[index] : nil } } func genericType(for position: Int) -> String { let max = genericServices.count var generic: String switch position { case _ where position < max: generic = genericServices[position % max] default: generic = genericServices[position / max - 1] + genericServices[position % max] } let toEscape = ["as", "in"] if toEscape.contains(generic.lowercased()) { generic = "`\(generic)`" } return generic } func commaConcat(_ xs: [String]) -> String { return xs.joined(separator: ", ") } func extraParentheses(_ string: String, when condition: Bool) -> String { return condition ? "(\(string))" : string } func registerGenerator(_ dependenciesCount: Int, argumentsCount: Int, breakIntoVariables: Bool = false) -> String { // If there is only one argument and one dependency, it can be checked by compiler let isArgumentInjection = dependenciesCount == 1 && argumentsCount == 1 let argParameterName = argumentsCount == 1 ? "argument" : "arguments" var genericParameters = (0.. 0 ? "\(argParameterName): \(commaConcat(genericArgumentsVars))" : ""))" } var genericsDefinition = commaConcat(["Service"] + genericParameters + genericArguments) if isArgumentInjection { genericParameters = ["\(genericArgumentPrefix)1"] genericsDefinition = commaConcat(["Service"] + genericParameters) resolvers = ["\(genericArgumentPrefix.lowercased())1"] } let concatenatedParameters = commaConcat(genericParameters) let argumentsDefinition = argumentsCount == 0 ? "" : ", \(argParameterName) \(commaConcat(genericArguments.enumerated().map{ "\($0 >= 1 ? "_" : "") \($1.lowercased()): \($1).Type" }))" let initializer: String if breakIntoVariables { let services = genericParameters.enumerated().map { "let \($1.lowercased()): \($1)? = \(resolvers[$0])" } initializer = " " + services.joined(separator: "; ") + "\n" + " checkResolved(initializer: initializer, services: \(commaConcat(genericParameters.map{$0.lowercased()})))\n" + " return initializer(\(extraParentheses(commaConcat(genericParameters.map{ "\($0.lowercased())!" }), when: dependenciesCount != 1)))\n" } else { initializer = " initializer(\(extraParentheses(commaConcat(resolvers.map{"\($0)\(isArgumentInjection ? "" : "!")"}), when: dependenciesCount != 1)))" } let closureParameters = commaConcat(["res"] + genericArgumentsVars) var register = [ registerComment(dependenciesCount, arguments: argumentsCount), "@discardableResult", "func autoregister<\(genericsDefinition)>(_ service: Service.Type, name: String? = nil\(argumentsDefinition), initializer: @escaping (\(extraParentheses(concatenatedParameters, when: dependenciesCount != 1))) -> Service) -> ServiceEntry {", ] if argumentsCount > 1 { register += [" precondition(hasUnique(arguments: [\(commaConcat(genericArgumentsVars))]), \"Autoregistration of service with dynamic arguments of the same type (\(commaConcat(genericArgumentsVars.map{ "\\(\($0))" }))) is not supported\")"] } register += [ " return self.register(service.self, name: name, factory: { \(closureParameters) in ", initializer, " } as (\(commaConcat(["Resolver"] + genericArguments))) -> Service)", "}" ] return register.joined(separator: "\n") } func resolverGenerator(_ arguments: Int) -> String { let argParameterName = arguments == 1 ? "argument" : "arguments" let genericArguments = (1..<(arguments+1)).map{ "\(genericArgumentPrefix)\($0)" } // ["Arg1", "Arg2", "Arg3"] let genericsDefinition = commaConcat(["Service"] + genericArguments) let paramArgs = (1..<(arguments+1)).map { "\(genericArgumentPrefix.lowercased())\($0)" } let argumentsTests = paramArgs.map { "(\($0) as? Service) ?? " }.joined(separator: "") let argumentsDefinition = arguments == 0 ? "" : "\(argParameterName) \(commaConcat(genericArguments.enumerated().map{ "\($0 >= 1 ? "_" : "") \($1.lowercased()): \($1)" }))" let implementation = "return \(argumentsTests)self.resolve(Service.self)" let resolver = [ " func resolve<\(genericsDefinition)>(\(argumentsDefinition)) -> Service? {", " \(implementation)", " }" ] return resolver.joined(separator: "\n") } func checkGenerator(_ dependencies: Int) -> String { let genericParameters = (0..= 1 ? "_" : "") \($1.lowercased()): \($1)?" }))" let recursiveUnresolvedCall = dependencies > 1 ? "unresolvedService(\(commaConcat(genericParameters.dropLast().map { $0.lowercased() }))) ?? " : "" let lowercasedServicesString = commaConcat(genericParameters.map{ $0.lowercased() }) let maxGroupSize: Int = 10 let serviceGroups: [[String]] = genericParameters.map{ $0.lowercased() }.enumerated().reduce([]){ accum, s in var accum = accum let (index, service) = s let groupIndex = Int(index/maxGroupSize) if groupIndex >= accum.count { accum.append([]) } accum[groupIndex].append(service) return accum } let serviceArrayString = serviceGroups.map { "[\(commaConcat($0))] as [Any?]"}.joined(separator: " + ") let check = [ "func unresolvedService<\(generics)>(_\(servicesDefinition)) -> String? {", " return \(recursiveUnresolvedCall)( \(genericParameters.last!.lowercased()) == nil ? \"\\(\(genericParameters.last!).self)\" : nil )", "}", "", "func checkResolved(initializer: (\(extraParentheses(generics, when: dependencies != 1))) -> Service, services\(servicesDefinition)){", " let unresolved = ( \(serviceArrayString) ).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(\(lowercasedServicesString))!)\\nInitializer: (\(commaConcat(genericParameters.map{ "\\(\($0).self)" }))) -> \\(Service.self)\")", " }", "}" ] return check.joined(separator: "\n") } func write(to outputPath: String, lines: [String]) throws{ let output = ([ headers(outputPath), "\n\nimport Swinject\n\n", ] + lines) .joined(separator: "\n") let currentPath = URL(fileURLWithPath: FileManager.default.currentDirectoryPath) let swinjectPath = currentPath.appendingPathComponent(outputPath) try output.write(to: swinjectPath, atomically: true, encoding: String.Encoding.utf8) } print("Generating 💬") let dependenciesCount = Int(CommandLine.arguments[safe: 1] ?? "20")! let argumentsCount = Int(CommandLine.arguments[safe: 2] ?? "3")! let breakCount = Int(CommandLine.arguments[safe: 3] ?? "0")! let registerLines = (0...dependenciesCount).map { dep in (0...argumentsCount).filter{ dep >= $0 }.map { arg -> String in registerGenerator(dep, argumentsCount: arg, breakIntoVariables: dep + arg > breakCount) } } let registers = registerLines.reduce([]){ $0 + $1} var autoregistrationOutput = [ "let maxDependencies = \(dependenciesCount)", "let maxArguments = \(argumentsCount)", "\n", "public extension Container {\n", registers.joined(separator: "\n\n"), "\n\n}", ] let resolvers = (0...argumentsCount).map { arg in resolverGenerator(arg) } let resolverOutput = [ "extension Resolver {\n\n", resolvers.joined(separator: "\n\n"), "}\n\n" ] let checks = (1...dependenciesCount).map { dep in checkGenerator(dep) } let checksOutput = [checks.joined(separator: "\n\n")] do { try write(to: autoregistrationPath, lines: autoregistrationOutput) try write(to: resolverPath, lines: resolverOutput) try write(to: checksPath, lines: checksOutput) print("Done, swinject functions files written at \(autoregistrationPath), \(resolverPath), \(checksPath) 👍") } catch let e as NSError { print("An error occurred while saving the generated functions. Error: \(e)") }