A simple Kotlin multi-platform abstraction around
the javax.inject annotations. This allows using the
annotations in Kotlin common code so that platform specific annotation processors can register them.
For more information about the library, refer to the blog post here which was
featured in Android Weekly issue #396.
The blog post was also featured in Kotlin Weekly issue #182.
The library is provided through repsy.io. Checkout
the releases package to get the latest version.
repositories {
maven { url = "https://repo.repsy.io/mvn/chrynan/public" }
}
implementation("com.chrynan.inject:inject:VERSION")
Simply use the provided annotations just as you would use the javax.inject annotations.
For example, using the Inject
annotation on a constructor in Kotlin Common code:
class MyUseCase @Inject constructor() { ... }
@Inject
@Named("name")
@Qualifier
@Scope
@Singleton
Provider<T>
More detailed documentation is available in the docs folder. The entry point to the documentation can be found here.
For security vulnerabilities, concerns, or issues, please responsibly disclose the information either by opening a public GitHub Issue or reaching out to the project owner.
Outside contributions are welcome for this project. Please follow the code of conduct and coding conventions when contributing. If contributing code, please add thorough documents. and tests. Thank you!
Support this project by becoming a sponsor of my work! And make sure to give the repository a ⭐
Copyright 2021 chRyNaN
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
The javax.inject library is also licensed under the Apache License 2.0.