question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’ve tried using this project on a kotlin Android application but could not make it work with the reflection free configuration. I tried:

kapt {
    generateStubs = true

    arguments {
        arg("toothpick_registry_package_name", "myproject.package")
        arg("toothpick_registry_children_package_names", "toothpick.smoothie")
    }
}

and

dependencies {
    // ...
    kapt 'com.github.stephanenicolas.toothpick:toothpick-compiler:1.0.6'
    compile "com.github.stephanenicolas.toothpick:toothpick-runtime:1.0.6"
    compile "com.github.stephanenicolas.toothpick:smoothie:1.0.6"
}

But the processor is not generating classes for the reflection free configuration.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
cs-victor-nascimentocommented, Jun 11, 2017

@stephanenicolas sure!

In this part of the wiki you have:

Setting up the registries

Toothpick generates the registries at the same time it generates the factories and member injectors. As a developer using Toothpick, you need to

  • configure the package into which the annotation processor will generate the registries for a given compilation unit (the application and each library);
  • inform the toothpick annotation processor of possible dependency of your compilation unit : toothpick will need to know where to find the registries for each of them.

I’ll add something like:

Notice that for the annotation processor to generate these classes, your project must already contain at least one class with an annotation that Toothpick’s processor is marked to process. If you don’t have any class annotated with @Inject or the other annotations, then Toothpick’s processor will simply be skipped.

Also, in order to enhance the documentation, I think there should be some more pages to the wiki:

  • Getting Started: an obvious one that I was surprised it is missing. It should provided a step by step guide to configuring an application.
  • Kotlin setup: which would only show how to use kapt with argumets (currently not a very famous option IMHO).
  • Testing: there is currently only a link to an implementation in the README.
  • Smoothie library: there is but a few words about what it does.

Perhaps it is only a matter of creating a README in those submodules’ roots. I could propose some initial content in a PR if you agree that this is a good direction.

I think a gh-pages with JavaDoc hosting and some other goodies would greatly enhance the experience of getting acquainted with the project.

2reactions
cs-victor-nascimentocommented, Jun 10, 2017

Well, it worked \o/

My configuration was perfectly right from the beginning. The issue was that I had no classes annotated with either @Inject nor anything. So the processor was not being called upon. I think it is worth mentioning this in the README or in the wiki.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin Examples | Programiz
This page contains examples of basic concepts of Python programming like loops, functions, ... The best way to learn Kotlin is by practicing...
Read more >
Kotlin Examples - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python,...
Read more >
Samples - Kotlin
Sample name What's shared? iOS integrat... Kotlin Multiplatform Mobile Sample Algorithms Xcode build... KMM RSS Reader Models, Networking, Data Storage, UI State Xcode build... kmm‑ktor‑sample Networking...
Read more >
Kotlin Tutorial for Beginners (Examples) - Guru99
In this Kotlin Tutorial for beginners, you will learn Kotlin programming language basics: What is Kotlin? History of Kotlin; Reasons of why ...
Read more >
Various examples for Kotlin - GitHub
https://github.com/Kotlin/kmm-integration-sample - This is a sample project for the "Make your Android application work on iOS" tutorial. Master branch contains ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found