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.

Use kotlin compiler plugin and reflection to generate code [Moved from old repo]

See original GitHub issue

Describe the problem or limitation you are having in your project: Currently the api-classes-generator and the entry-generator use a errorprone and hard to understand code generation using stringBuilders. The code would be much cleaner and easier to maintain if we use reflection to generate the api-wrapper and annotations for the entry-classes generation. Also it would make the project easier to use as a user doesn’t have to write config json’s anymore.

Describe how this feature / enhancement will help you overcome this problem or limitation: One no longer needs to configure the errorprone json files and maitanance is much simpler.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work: None to provide.

Describe implementation detail for your proposal (in code), if possible: Use the compiler plugin created in issue #13 for the config generation. Maybe use kotlinPoet for the api classes generation -> done in #14

If this enhancement will not be used often, can it be worked around with a few lines of code?: Yes with the current system. But it’s not user friendly at all.

Is there a reason why this should be in this project and not individually solved?: Yes as the code generation is the main part of the project.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
chippmanncommented, Feb 22, 2020

@Wavesonics Then you dont have to change a thing. I configured it to be mandatory to execute before any kotlin compile task. So its executed during a normal build as well. So calling just build is fine.

0reactions
Wavesonicscommented, Feb 21, 2020

That’s great news, once you get the new task in, I can change the task being called from the Editor Plugin in #33 (currently it’s calling build)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin compiler options
The Kotlin compiler for JVM compiles Kotlin source files into Java class files. The command-line tools for Kotlin to JVM compilation are kotlinc ......
Read more >
JetBrains-Research/reflekt: A plugin for Kotlin ... - GitHub
Reflekt is a compile-time reflection library that leverages the flows of the standard reflection approach and can find classes, objects (singleton classes) or ......
Read more >
Reflekt: a Library for Compile-Time Reflection in Kotlin - arXiv
Reflekt is a reflection library that provides the means to search for classes, object expressions, and functions in Kotlin source code at  ......
Read more >
Android build warning Mapping new ns to old ns
In Android Studio you can also update the Gradle Plugin Version (and the Gradle Version) by going to File > Project Structure. –...
Read more >
Kotlinx.Serialization part1 - Medium
But Kotlinx library will use generate code and it will call the objects ... }or old version:apply plugin: 'kotlinx-serialization'.
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