Official documentation instructs how to use kapt from Gradle and Maven. But how can I use kapt from command line, with kotlinc?
How to use kapt from command line (with kotlinc)?
1.6k views Asked by cubuspl42 At
1
There are 1 answers
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in SHELL
- macOS - Most secure way of a GUI SUDO_ASKPASS
- When does Bash read heredocs?
- Why `set -o pipefail` gives different output even though the pipe is not failing
- Run multiple shell scripts in Dockerfile
- Alias does not take effect when I use Vim to execute external commands
- why variable substitution is so different?
- Error: fish: ${ is not a valid variable in fish
- Custom Bash functions & custom statements - Need some advice
- unexpected operator == in square brackets when trying to use gum lib
- Delete first three lines containing a certain word
- Keep the log for the last 14 days
- Iterate over items in one array and groups of items in second array
- Keep multi-version of a static-lib like what we do for shared-libs
- How to write function in bash for reuse shell commands inside using osascript?
- Why is it that when I pass certain directory names to `ls`, sometimes it does not list their contents?
Related Questions in KOTLIN
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- ussd reader in Recket Native module
- making android analyze with coverity sast tool
- Jooq - Insert does not update object with generated id
- Doesn't work TrafficStats.clearThreadStatsTag() in Kotlin
- Difference between map and function returning when in Kotlin
- Every Time i run the app it gives me an error related to gradle
- How Do I Create A Path In The pubspec.yaml File?
- Android jetpack compose webview, image selector not works
- Why doesn't CIOEngine have a dispatcher in kotlin script?
- preventing duplicate text
- onCompletion(mp: MediaPlayer?) is unintentionally called after USB storage is connected
- When using a Room database on an Android application, is it possible to pre-populate data
- Jetpack compose - how I can hookup LiveData property from ViewModel with TextField in activity?
- Failed to getEnergyData
Related Questions in KAPT
- can kotlin annotation processor be add properties using Kotlin annotation processor?
- Gradle: Proper way to add KAPT-generated Kotlin sources to sources JAR
- Unresolved reference kapt and ksp in Android Studio when trying to do the setup for the use of ROOM local database
- failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
- Execution failed for task ':app:kspDebugKotlin'. > A failure occurred while executing ..GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
- Build failing with an exception in kaptBetaDebugKotlin
- Cannot implement Hilt with Compose Activity
- Kapt Kotlin incremental annotation processing not working
- Kapt task in error when adding jar built with openapi generator
- the following options were not recognized by any processor: '[dagger.fastinit, dagger.hilt.android.internal
- Execution failed for task ':app:kaptDebugKotlin' for kotlin
- Android Studio Kapt error: app:kaptGenerateStubsDebugKotlin compileDebugJavaWithJavac jvm target compatibility should be set to the same Java version
- Execution failed for task ':libimgur:kaptKotlin'
- Do I still need to use the kapt plugin (I am using ksp) if I am enabling dataBinding for a project?
- Migrating Room from KAPT to KSP leads to RuntimeException
Related Questions in KOTLINC
- kotlin coroutines don't work in a command line
- Can I build an android apk without "gradle" on command line?
- Is there a way to tell kotlin compiler (via gradle) to fail when some package isn't matching file location?
- Kotlin K1 to K2 plugin migration. analysisCompleted, binding context slicing
- No output when compiling kotlin-js IR using kotlinc cli
- Kotlin Error 'unresolved reference' appears when trying to run Java Code from a Kotlin file
- kotlinc: unresolved reference
- How to get Kotlinc 1.8.0 to run with Ubuntu on Windows
- How can kotlinc without gradle or IntelliJ IDEA take less than 10 seconds to compile Hello, World?
- lookup and verify sha256 for kotlinc in bazel
- kotlinc vs kotlinc-jvm to compile and kotlin vs java to run
- Running kotlin files in VS code terminal, kotlinc not recognized
- kotlinc compile multiple files/dependencies/imports
- Kotlin - IntelliJ cannot resolve the reference (from synthetic class)
- What are the performance differences between all the ways to declare a constant in Kotlin?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Add
tools.jarto Kotlin compilers' classpathAs of Kotlin version 1.1.3-2,
kotlincdoes not addtools.jarto compiler's classpath.tools.jaris required bykapt.As a workaround, you can patch
kotlinc.Edit line 79.
From:
To:
Note:
$JAVA_HOMEmust point to JDK, not JRE.Note: This is a hack.
Invoke
kotlincwith right argumentsReplace:
$MY_CLASSPATHwith your desired classpath/path/to/SomeAnnotationProcessor.jarwith actual path to some annotation processor./sources,./classesand./stubswith paths do directories where respective intermediate artifacts should be stored/path/to/MyKotlinFile.ktwith path to the Kotlin file(s) you want to compile$KOTLIN_HOMEwith the path to Kotlin's installation directory (you should already have this in your env)Note: -X arguments (advanced options) are non-standard and may be changed or removed without any notice
Note:
kapt's interface is undocumented. You can check the source code: https://github.com/JetBrains/kotlin/blob/master/plugins/kapt3/src/org/jetbrains/kotlin/kapt3/Kapt3Plugin.kt#L295This stuff was reverse-engineered from running
gradle build --debuginkotlin-examples/gradle/kotlin-dagger(https://github.com/JetBrains/kotlin-examples/tree/master/gradle/kotlin-dagger).This is just a starting point. I'm still not sure of a few things. Feel free to edit this answer.
Thanks to
runningcode: https://github.com/facebook/buck/issues/956#issuecomment-309080611If it wasn't obvious: this stuff sucks. JetBrains just assumed that CLI doesn't matter and they made the crucial interfaces undocumented / reserved for internal use.