We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the Deli configuration file or include it via command line.
application-dev.properties:
environment: dev server: url: https://dev.example.com/
deli.yml:
target: - App config: App: - project: App - properties: - Resources/Common/*.properties - Resources/application-dev.properties # override
command line:
deli build \ --property "Resource/application-dev.properties" \ --property "Resources/Common/*.properties"
ServerConfig.swift:
struct ServerConfig: ConfigProperty { let target: String = "server" let url: String }
NetworkManager.swift:
final class NetworkManager: Autowired { let serverUrl: String required init(_ config: ServerConfig) { serverUrl = config.url } }
final class NetworkManager { let serverUrl = AppContext.getProperty("server.url") ?? "" }
final class NetworkManager: Inject { let serverUrl = InjectProperty("server.url") }
UserService.swift:
final class UserService: Autowired { required init(_/*environment*/ network: NetworkProvider) { } }
LibraryFactory.swift:
final class LibraryFactory: Inject { func getBooks() -> [Book] { return Inject([Book].self, qualifierBy: "environment") } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to build
Change the Deli configuration file or include it via command line.
application-dev.properties:
deli.yml:
command line:
How to use
1. Package
ServerConfig.swift:
NetworkManager.swift:
2. Single (without Validate)
NetworkManager.swift:
3. Single (with Validate)
NetworkManager.swift:
4. Qualifier on Constructor Injection
UserService.swift:
5. Qualifier on Inject
LibraryFactory.swift:
Reference
The text was updated successfully, but these errors were encountered: