Skip to content

Commit

Permalink
Merge pull request #8 from SwingDev/task/v0.2.6
Browse files Browse the repository at this point in the history
Task/0.2.6 - bug fixes
  • Loading branch information
ddanielczyk authored Dec 19, 2023
2 parents 66c8033 + 6ce6d82 commit 63beffd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions InjectGrail.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'InjectGrail'
s.version = '0.2.5'
s.version = '0.2.6'
s.summary = 'Holy Grail of Swift Injection frameworks for iOS and MacOs.'
s.description = <<-DESC
Tired of injection framework that puts everything in one big bag of dependecy resolvers? This framework might be good for you.
Expand All @@ -25,5 +25,5 @@ Tired of injection framework that puts everything in one big bag of dependecy re

s.source_files = 'InjectGrail/Classes/**/*.{swift}'
s.preserve_paths = 'Scripts', 'Templates'
s.dependency 'Sourcery', '~> 2.0.2'
s.dependency 'Sourcery', '~> 2.1.2'
end
4 changes: 4 additions & 0 deletions Scripts/inject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ fi

ARGS=""

if [ -n "$NO_MOCKS" ]; then
ARGS="noMocks,$ARGS"
fi

if [ -n "$LEGACY_INJECTION" ]; then
ARGS="legacyInjection,$ARGS"
fi
Expand Down
8 changes: 6 additions & 2 deletions Templates/Inject.swifttemplate
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func outputInjectFunction(injectorType :String,
<%
} else {
%>
func inject(<%= arguments.map({"\($0.name): \($0.type)"}).joined(separator: ", ") %>) -> <%= injectorType %> {
func inject(<%= arguments.map({"\($0.name): \($0.type)"}).joined(separator: ", ") %>) -> <%= injectorType %>Impl {
return <%= injectorType %>Impl(
<%= targetProperties.map({target in let mapping = injectorMappings[target.name].map({source in useInjectorString ? "injector.\(source)" : source}); return "\(target.name): \(mapping ?? target.name)"}).joined(separator: ",\n ") %>
)
Expand Down Expand Up @@ -148,8 +148,12 @@ extension <%= injectData.rootInjector.name %> {
// sourcery:end
<% } %>
// sourcery:file:InjectGrail/Injectors.swift
import Foundation
<%_ for `import` in imports { -%>
import <%= `import` %>
<%_ } -%>

<%_
<%_
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Print injectors

Expand Down

0 comments on commit 63beffd

Please sign in to comment.