File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
> Check annotated functions arguments. If they don't change - return last result.
4
4
> Functions could be logged.
5
+ > Support extra custom action on function processing
5
6
6
7
import compiler plugin:
7
8
``` kotlin
8
9
dependencies {
9
- implementation(" io.github.stslex:compiler-plugin:0.0.1 " )
10
- kotlinCompilerPluginClasspath(" io.github.stslex:compiler-plugin:0.0.1 " )
10
+ implementation(" io.github.stslex:compiler-plugin:$version " )
11
+ kotlinCompilerPluginClasspath(" io.github.stslex:compiler-plugin:$version " )
11
12
}
12
13
```
13
14
14
- in code:
15
+ in code:
16
+
15
17
``` kotlin
18
+
16
19
import io.github.stslex.compiler_plugin.DistinctUntilChangeFun
17
20
18
- @DistinctUntilChangeFun
19
- fun setUserName (username : String ){
20
- // function logic
21
+ @DistinctUntilChangeFun(
22
+ logging = true ,
23
+ singletonAllow = false ,
24
+ name = " set_user_second_name" ,
25
+ action = TestLogger ::class
26
+ )
27
+ fun setUserName (username : String ) {
28
+ // function logic
21
29
}
22
30
```
31
+
32
+ for custom actions:
33
+
34
+ ``` kotlin
35
+ class TestLogger : Action {
36
+
37
+ override fun invoke (
38
+ name : String ,
39
+ isProcess : Boolean
40
+ ) {
41
+ println (" test action $name procession: $isProcess " )
42
+ }
43
+ }
44
+ ```
You can’t perform that action at this time.
0 commit comments