diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65a61408..1e98ecb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,26 +7,54 @@ on: branches: [ master ] env: - DEVELOPER_DIR: /Applications/Xcode_14.1.app + DEVELOPER_DIR: /Applications/Xcode_15.4.app jobs: - build: - runs-on: macos-12 + NeedleFoundationTests: + runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: "NeedleFoundationTests" - run: xcodebuild test -project NeedleFoundation.xcodeproj -scheme NeedleFoundation -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14' + run: xcodebuild test -project NeedleFoundation.xcodeproj -scheme NeedleFoundation -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' + NeedleGeneratorTests: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleGeneratorTests" run: cd Generator && swift test -Xswiftc -DDEBUG + NeedleGeneratorBinary: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleGeneratorBinary" run: cd Generator && swift build -c release + NeedleSampleMVCApp: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleSampleMVCApp" - run: xcodebuild build -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14' + run: xcodebuild build -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' + NeedleSampleMVCTests: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleSampleMVCTests" - run: xcodebuild test -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeTests -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14' + run: xcodebuild test -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeTests -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' + NeedleSamplePluginizedApp: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleSamplePluginizedApp" - run: xcodebuild build -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14' + run: xcodebuild build -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' + NeedleSamplePluginizedScoreSheetTests: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleSamplePluginizedScoreSheetTests" - run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme ScoreSheetTests -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14' + run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme ScoreSheetTests -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' + NeedleSamplePluginizedTicTacToeCoreTests: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 - name: "NeedleSamplePluginizedTicTacToeCoreTests" - run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeCoreTests -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14' + run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeCoreTests -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' diff --git a/Generator/Package.swift b/Generator/Package.swift index 56080ee9..b7419968 100644 --- a/Generator/Package.swift +++ b/Generator/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.6 +// swift-tools-version:5.10 import PackageDescription let package = Package( diff --git a/Generator/README.md b/Generator/README.md index f4a51da2..938364f6 100644 --- a/Generator/README.md +++ b/Generator/README.md @@ -29,7 +29,7 @@ Needle is intended to be heavily multi-threaded. This makes stepping through the ### Structure of generated code -The shortest way to describe the code generated by needle is that it's primary purpose is to create classes that conform to all the `*Dependency` protocols in your application code. +The shortest way to describe the code generated by needle is that its primary purpose is to create classes that conform to all the `*Dependency` protocols in your application code. In order to do this needle creates Provider classes which perform the job just described. So the providers need to have a number of vars, one for each of the vars in the protocol. The body of these vars is quite simple. Typically, something like: ``` diff --git a/Generator/Sources/NeedleFramework/Generating/Pluginized/PluginizedDependencyGraphExporter.swift b/Generator/Sources/NeedleFramework/Generating/Pluginized/PluginizedDependencyGraphExporter.swift index 104c8ba2..876b7405 100644 --- a/Generator/Sources/NeedleFramework/Generating/Pluginized/PluginizedDependencyGraphExporter.swift +++ b/Generator/Sources/NeedleFramework/Generating/Pluginized/PluginizedDependencyGraphExporter.swift @@ -19,7 +19,7 @@ import Foundation import SourceParsingFramework /// The generation phase entry class that executes tasks to process dependency -/// graph components, inlcuding pluginized and non-core ones, into necessary +/// graph components, including pluginized and non-core ones, into necessary /// dependency providers and their registrations, then exports the contents to /// the destination path. class PluginizedDependencyGraphExporter { @@ -28,10 +28,10 @@ class PluginizedDependencyGraphExporter { /// code for the given components and pluginized components, and export /// the source code to the given destination path. /// - /// - parameter components: Array of Components to generate dependnecy + /// - parameter components: Array of Components to generate dependency /// providers for /// - parameter pluginizedComponents: Array of pluginized components to - /// generate plugin extensions and dependnecy providers for. + /// generate plugin extensions and dependency providers for. /// - parameter imports: The import statements. /// - parameter path: Path to file where we want the results written to. /// - parameter executor: The executor to use for concurrent computation of diff --git a/Generator/Sources/NeedleFramework/Generating/Serializers/Pluginized/PluginExtensionDynamicContentSerializer.swift b/Generator/Sources/NeedleFramework/Generating/Serializers/Pluginized/PluginExtensionDynamicContentSerializer.swift index e0ee0714..5991b295 100644 --- a/Generator/Sources/NeedleFramework/Generating/Serializers/Pluginized/PluginExtensionDynamicContentSerializer.swift +++ b/Generator/Sources/NeedleFramework/Generating/Serializers/Pluginized/PluginExtensionDynamicContentSerializer.swift @@ -16,7 +16,7 @@ import Foundation -/// A serializer that produces the class definitation source code for the +/// A serializer that produces the class definition source code for the /// plugin extension provider. class PluginExtensionDynamicContentSerializer: Serializer { @@ -36,7 +36,7 @@ class PluginExtensionDynamicContentSerializer: Serializer { return """ /// \(component.data.name) plugin extension - extension \(component.data.name): ExtensionRegistration { + extension \(component.data.name): NeedleFoundation.ExtensionRegistration { public func registerExtensionItems() { \(properties) } diff --git a/Generator/Sources/NeedleFramework/Parsing/Tasks/ASTProducerTask.swift b/Generator/Sources/NeedleFramework/Parsing/Tasks/ASTProducerTask.swift index 7d7978ea..74fe7255 100644 --- a/Generator/Sources/NeedleFramework/Parsing/Tasks/ASTProducerTask.swift +++ b/Generator/Sources/NeedleFramework/Parsing/Tasks/ASTProducerTask.swift @@ -20,7 +20,7 @@ import SourceParsingFramework import SwiftParser /// A task that parses a Swift source content and produces Swift AST that -/// can then be parsed into the dependnecy graph. +/// can then be parsed into the dependency graph. class ASTProducerTask: AbstractTask { /// Initializer. diff --git a/Generator/Sources/NeedleFramework/Utilities/Constants.swift b/Generator/Sources/NeedleFramework/Utilities/Constants.swift index 77fcc76a..f2613f84 100644 --- a/Generator/Sources/NeedleFramework/Utilities/Constants.swift +++ b/Generator/Sources/NeedleFramework/Utilities/Constants.swift @@ -26,5 +26,5 @@ let bootstrapComponentName = "BootstrapComponent" /// The name of the protocol that all Dependency protocols inherit from. let dependencyProtocolName = "Dependency" -/// The name fo the class that all Component classes inherit from +/// The name of the class that all Component classes inherit from let componentClassName = "Component" diff --git a/Generator/Sources/needle/Version.swift b/Generator/Sources/needle/Version.swift index 8c0fa8bc..3d38bbe7 100644 --- a/Generator/Sources/needle/Version.swift +++ b/Generator/Sources/needle/Version.swift @@ -14,4 +14,4 @@ // limitations under the License. // -let version = "0.24.0" +let version = "0.25.0" diff --git a/Generator/bin/needle b/Generator/bin/needle index 9550c1c6..c6639208 100755 Binary files a/Generator/bin/needle and b/Generator/bin/needle differ diff --git a/NeedleFoundation.podspec b/NeedleFoundation.podspec index 61d2a588..fb22e937 100644 --- a/NeedleFoundation.podspec +++ b/NeedleFoundation.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'NeedleFoundation' - s.version = '0.24.0' + s.version = '0.25.0' s.summary = 'Compile-time safe Swift dependency injection framework with real code.' s.description = 'Needle is a dependency injection (DI) system for Swift. Unlike other DI frameworks, such as Cleanse, Swinject, Needle encourages hierarchical DI structure and utilizes code generation to ensure compile-time safety. This allows us to develop our apps and make changes with confidence. If it compiles, it works. In this aspect, Needle is more similar to Android Dagger.' diff --git a/Package.swift b/Package.swift index 9f647019..7abe325c 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.10 import PackageDescription let package = Package( diff --git a/Sources/NeedleFoundation/Bootstrap.swift b/Sources/NeedleFoundation/Bootstrap.swift index cdf50a19..851f2bf8 100644 --- a/Sources/NeedleFoundation/Bootstrap.swift +++ b/Sources/NeedleFoundation/Bootstrap.swift @@ -17,7 +17,7 @@ import Foundation /// An empty protocol that can be used for any components that require no -/// dependencies. This can be used as the dependnecy protocol of the root +/// dependencies. This can be used as the dependency protocol of the root /// component of a dependency graph. public protocol EmptyDependency: AnyObject {} diff --git a/Sources/NeedleFoundation/Component.swift b/Sources/NeedleFoundation/Component.swift index 075fe2a3..1dc11286 100644 --- a/Sources/NeedleFoundation/Component.swift +++ b/Sources/NeedleFoundation/Component.swift @@ -30,7 +30,7 @@ public protocol Registration { /// directly. /// @CreateMock public protocol Scope: AnyObject { - /// The path to reach this component on the dependnecy graph. + /// The path to reach this component on the dependency graph. var path: [String] { get } /// The parent of this component. @@ -83,7 +83,7 @@ open class Component: Scope { /// The parent of this component. public let parent: Scope - /// The path to reach this scope on the dependnecy graph. + /// The path to reach this scope on the dependency graph. // Use `lazy var` to avoid computing the path repeatedly. Internally, // this is always accessed with the `__DependencyProviderRegistry`'s lock // acquired. @@ -207,7 +207,7 @@ open class Component: Scope { /// The parent of this component. public let parent: Scope - /// The path to reach this scope on the dependnecy graph. + /// The path to reach this scope on the dependency graph. // Use `lazy var` to avoid computing the path repeatedly. Internally, // this is always accessed with the `__DependencyProviderRegistry`'s lock // acquired. diff --git a/Sources/NeedleFoundation/Internal/DependencyProviderRegistry.swift b/Sources/NeedleFoundation/Internal/DependencyProviderRegistry.swift index c5d8ff8b..e1c039d1 100644 --- a/Sources/NeedleFoundation/Internal/DependencyProviderRegistry.swift +++ b/Sources/NeedleFoundation/Internal/DependencyProviderRegistry.swift @@ -25,7 +25,7 @@ import Foundation // Once that happens, we can declare an `open createDependencyProvider` // method in the base component class. Generate extensions to all the // component subclasses that override the method to instantiate the -// dependnecy providers. +// dependency providers. public class __DependencyProviderRegistry { /// The singleton instance. diff --git a/Sources/NeedleFoundation/Pluginized/Internal/PluginExtensionProviderRegistry.swift b/Sources/NeedleFoundation/Pluginized/Internal/PluginExtensionProviderRegistry.swift index 2d85c93e..bbffd48d 100644 --- a/Sources/NeedleFoundation/Pluginized/Internal/PluginExtensionProviderRegistry.swift +++ b/Sources/NeedleFoundation/Pluginized/Internal/PluginExtensionProviderRegistry.swift @@ -24,7 +24,7 @@ import Foundation // Once that happens, we can declare an `open createPluginExtensionProvider` // method in the base pluginized component class. Generate extensions to // all the pluginized component subclasses that override the method to -// instantiate the dependnecy providers. +// instantiate the dependency providers. public class __PluginExtensionProviderRegistry { /// The singleton instance.