https://github.com/succlz123/naix
A KCP(Kotlin Compiler Plugin) that helps Android-Kotlin developers to automatically output method call information through annotations.
https://github.com/succlz123/naix
kcp kotlin kotlin-compiler-plugin
Last synced: 8 months ago
JSON representation
A KCP(Kotlin Compiler Plugin) that helps Android-Kotlin developers to automatically output method call information through annotations.
- Host: GitHub
- URL: https://github.com/succlz123/naix
- Owner: succlz123
- Created: 2020-08-17T06:24:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-02T03:42:30.000Z (about 5 years ago)
- Last Synced: 2024-12-27T11:23:08.062Z (10 months ago)
- Topics: kcp, kotlin, kotlin-compiler-plugin
- Language: Java
- Homepage:
- Size: 77.1 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Naix
A Kotlin Compiler Plugin (Not Gradle Transform Plugin) that helps **Android-Kotlin** developers to automatically output method call information through annotations.
### Usage
[](https://jitpack.io/#succlz123/naix)
~~~
repositories {
maven { url 'https://jitpack.io' }
}
~~~
~~~
dependencies {
classpath "com.github.succlz123.naix:gradle-plugin:x.y.z"
}
~~~
~~~
apply plugin: 'com.github.succlz123.naix'
~~~
~~~
implementation "com.github.succlz123.naix:compiler-runtime:x.y.z"
~~~
### Option
#### Disable Naix
~~~
naix {
enable = false
}
~~~
#### Custom Logger
~~~ kotlin
NaixOption.set { className, methodName, msg -> Log.i("Naix ", msg) }
~~~
### Sample
#### Naix
~~~ kotlin
@Naix
fun func1(a: String?, b: String?, c: Double?): String {
retrun "test"
}
~~~
↓
~~~
╔══════════════════════════════════════════════════════════════════════════════╗
║ Class#Method -> org/succlz123/naix/app/MainActivity#func1 ║
║ Parameters -> a = 123 b = test c = 1.2 ║
║ Return value -> test ║
║ Elapsed time -> 0 ms ║
╚══════════════════════════════════════════════════════════════════════════════╝
~~~
#### NaixFull
~~~ kotlin
@NaixFull
fun func2(a: String?, b: String?, c: Long): String {
...... // some method call
retrun "test2"
}
~~~
↓
~~~
╔══════════════════════════════════════════════════════════════════════════════╗
║ Class#Method -> org/succlz123/naix/app/MainActivity#func2 ║
║ Parameters -> a = 321 b = tset c = 2.1 ║
║ 1 -> 1 ms, kotlin/jvm/internal/Intrinsics#areEqual ║
║ 2 -> 0 ms, java/util/ArrayList# ║
║ 3 -> 0 ms, org/succlz123/naix/app/MainActivity#funcTest ║
║ 4 -> 0 ms, java/util/ArrayList# ║
║ 5 -> 0 ms, java/util/ArrayList#add ║
║ Return value -> test2 ║
║ Elapsed time -> 1 ms ║
╚══════════════════════════════════════════════════════════════════════════════╝
~~~
### Thanks
https://www.youtube.com/watch?v=w-GMlaziIyo
https://github.com/Leaking/Hunter