Code Monkey home page Code Monkey logo

inject's Introduction

inject

Inject

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.
GitHub tag (latest by date)

For more information about the library, refer to the blog post here which was featured in Android Weekly issue #396.

Badge

The blog post was also featured in Kotlin Weekly issue #182.

Getting Started ๐Ÿ

The library is provided through repsy.io. Checkout the releases package to get the latest version.
GitHub tag (latest by date)

Repository

repositories {
    maven { url = "https://repo.repsy.io/mvn/chrynan/public" }
}

Dependencies

implementation("com.chrynan.inject:inject:VERSION")

Usage ๐Ÿ‘จโ€๐Ÿ’ป

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() { ... }

Available annotations and interfaces

  • @Inject
  • @Named("name")
  • @Qualifier
  • @Scope
  • @Singleton
  • Provider<T>

Documentation ๐Ÿ“ƒ

More detailed documentation is available in the docs folder. The entry point to the documentation can be found here.

Security ๐Ÿ›ก๏ธ

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.

Contributing โœ๏ธ

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!

Sponsorship โค๏ธ

Support this project by becoming a sponsor of my work! And make sure to give the repository a โญ

License โš–๏ธ

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.

inject's People

Contributors

chrynan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inject's Issues

Unable to pull this library into project - Unauthorized

Describe the bug
When integrating with my project (and a clean standalone project) - I get this error

Could not GET 'https://maven.pkg.github.com/chrynan/inject/com/chrynan/inject/inject-jvm/0.7.0/inject-jvm-0.7.0.pom'. Received status code 401 from server: Unauthorized

To Reproduce
Steps to reproduce the behaviour:

  1. Add maven repo to top level build.gradle
  2. Add library dependency to app build.gradle
  3. Sync and rebuild
  4. See error:
    Could not GET 'https://maven.pkg.github.com/chrynan/inject/com/chrynan/inject/inject-jvm/0.7.0/inject-jvm-0.7.0.pom'. Received status code 401 from server: Unauthorized

Expected behaviour
Dep should be available in project

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac OSX

Support for ios_simulator_arm64

Problem description
I was trying to create a multiplatform project supporting android and ios platforms. I am using your latest version of the library - 1.0.0. And it works as expected for these targets:

kotlin {
    android()
    iosX64()
    iosArm64()

   ..

But for application to run on an M1 ios simulator I need to add iosSimulatorArm64() which is now not supported. This is the build error I am getting:

Unable to build Kotlin project configuration

org.gradle.internal.resolve.ArtifactNotFoundException: Could not find inject-1.0.0-samplessources.jar (com.chrynan.inject:inject:1.0.0).
Searched in the following locations:
    https://repo.repsy.io/mvn/chrynan/public/com/chrynan/inject/inject/1.0.0/inject-1.0.0-samplessources.jar
	at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:28)
	at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveArtifact(ExternalResourceResolver.java:500)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:469)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.lambda$resolveArtifact$15(ErrorHandlingModuleComponentRepository.java:181)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.tryResolveAndMaybeBlacklist(ErrorHandlingModuleComponentRepository.java:237)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.performOperationWithRetries(ErrorHandlingModuleComponentRepository.java:203)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveArtifact(ErrorHandlingModuleComponentRepository.java:179)
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainArtifactResolver.resolveArtifact(RepositoryChainArtifactResolver.java:102)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet$LazyArtifactSupplier.calculateValue(DefaultArtifactSet.java:284)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet$LazyArtifactSupplier.calculateValue(DefaultArtifactSet.java:255)
	at org.gradle.internal.model.CalculatedValueContainer$CalculationState.lambda$attachValue$0(CalculatedValueContainer.java:218)
	at org.gradle.internal.Try.ofFailable(Try.java:41)
	at org.gradle.internal.model.CalculatedValueContainer$CalculationState.attachValue(CalculatedValueContainer.java:213)
	at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:186)
	at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:177)
	at org.gradle.api.internal.artifacts.PreResolvedResolvableArtifact.getFile(PreResolvedResolvableArtifact.java:88)
	at org.jetbrains.plugins.gradle.tooling.util.resolve.DependencyResolverImpl.resolveDependencies(DependencyResolverImpl.java:239)
	at org.jetbrains.plugins.gradle.tooling.util.resolve.DependencyResolverImpl.resolveDependencies(DependencyResolverImpl.java:119)

Solution
Can you please add support for iosSimulatorArm64 target so I can build it on M1 ios simulator?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.