Auto-Dagger2 | Annotation processor on top of Dagger | Build Tool library

 by   lukaspili Java Version: Current License: MIT

kandi X-RAY | Auto-Dagger2 Summary

kandi X-RAY | Auto-Dagger2 Summary

Auto-Dagger2 is a Java library typically used in Utilities, Build Tool applications. Auto-Dagger2 has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Auto Dagger2 is an annotation processor built on top of the Dagger2 annotation processor. It basically generates the component for you. The goal is to reduce the boilerplate code required by Dagger2 when you have "empty" or simple components. It is usually the case in Android development. You can also mix manually written components with the ones generated by Auto Dagger2. Auto Dagger2 produces the human-readable code you would (hopefully) write yourself.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Auto-Dagger2 has a low active ecosystem.
              It has 166 star(s) with 14 fork(s). There are 10 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 4 have been closed. On average issues are closed in 113 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Auto-Dagger2 is current.

            kandi-Quality Quality

              Auto-Dagger2 has 0 bugs and 41 code smells.

            kandi-Security Security

              Auto-Dagger2 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Auto-Dagger2 code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Auto-Dagger2 is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Auto-Dagger2 releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              Auto-Dagger2 saves you 719 person hours of effort in developing the same functionality from scratch.
              It has 1661 lines of code, 149 functions and 63 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed Auto-Dagger2 and discovered the below as its top functions. This is intended to give you an instant insight into Auto-Dagger2 implemented functionality, and help decide if they suit your requirements.
            • Extracts the components from the annotation
            • Finds scope annotation
            • Validates an annotation value
            • Finds the type of an annotation
            • Compose a component
            • Returns the list of types names of this module
            • Gets the class name
            • Returns the component class name
            • Returns the class name of a component
            • Injects this activity into the Activity
            • Creates a new instance of this component
            • Invoked when the component is created
            • Returns the set of supported AutoComponents
            • Injects the main component of this component
            • Injects the component
            • Creates the instance of this component
            • Overrides the superclass to process the extractors
            • Extracts the annotations from the annotation
            • Get the types of auto component annotation
            • Checks if an annotation is valid for this annotation
            • Compose a subcomponent
            • Get type names from a list of typeMirrors
            • Called when an annotation is annotated
            • Extracts the parameter
            • Combines the elements
            • Processes an element
            Get all kandi verified functions for this library.

            Auto-Dagger2 Key Features

            No Key Features are available at this moment for Auto-Dagger2.

            Auto-Dagger2 Examples and Code Snippets

            No Code Snippets are available at this moment for Auto-Dagger2.

            Community Discussions

            QUESTION

            Dagger 2.10 subcomponent generator - Injector validation fails
            Asked 2017-Aug-26 at 16:45

            I'm trying to create an annotation processor which will process my MVP views (fragments) to auto-generated Subcomponents (similar to https://github.com/lukaspili/Auto-Dagger2, but for the new Dagger 2.10 android injectors)

            So far, I've been able to generate appropriate files, but there is a strange error message when compiling generated components

            Error:(22, 58) error: @dagger.android.support.FragmentKey methods should bind dagger.android.AndroidInjector.Factory, not dagger.android.AndroidInjector.Factory. See google.github.io/dagger/android

            The structure of Factory module and Subcomponent files should be correct, because as soon as I copy-paste the generated classes and create a regular classes (both Factory module and Subcomponent) and use real classes instead of generated ones, the message is no longer shown and compilation succeeds

            It seems like the problem lies in AndroidMapKeyValidator (link), where !MoreTypes.equivalence().equivalent(returnType, intendedReturnType) call apparently fails, but I don't have much of an experience debugging annotation processors, so I don't know why precisely...

            Can maybe anyone help where to search for the problem? Thanks

            FYI: MyFragment does extend android.support.v4.app.Fragment

            My files:

            Generated Factory @Module public interface BuildersModule { @Binds @IntoMap @FragmentKey(MyFragment.class) abstract AndroidInjector.Factory factory(MySubcomponent.Builder builder); }

            Generated subcomponent @Subcomponent(modules = MyModule.class) public interface MySubcomponent extends AndroidInjector { MyPresenter presenter(); @Subcomponent.Builder abstract class Builder extends AndroidInjector.Builder {} }

            ...

            ANSWER

            Answered 2017-Aug-26 at 16:45

            If anyone is interested in solution:

            I found out that for some reason, references of ClassType-s compared during project's compile time are not the same when validating generated method.

            And these references, despite the fact that they are pointing to the same class, are checked for equality in auto-common library in EqualVisitor.visitDeclared method. Apparently, this can be a bug in auto-common, because Elements in visitDeclared are compared by object reference, but not type reference.

            So workaround here is to use local fixed copy of auto-common library and exclude all dependencies of the original library.

            Source https://stackoverflow.com/questions/43304779

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Auto-Dagger2

            As you can see, the @Singleton annotation is applied to the generated component as well.
            Beware that the groupId changed to com.github.lukaspili.autodagger2.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/lukaspili/Auto-Dagger2.git

          • CLI

            gh repo clone lukaspili/Auto-Dagger2

          • sshUrl

            git@github.com:lukaspili/Auto-Dagger2.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link