File tree Expand file tree Collapse file tree 1 file changed +30
-7
lines changed Expand file tree Collapse file tree 1 file changed +30
-7
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
6
+
7
+ import compiler plugin:
5
8
6
- import compiler plugin:
7
9
``` kotlin
8
10
dependencies {
9
- implementation(" io.github.stslex:compiler-plugin:0.0.1 " )
10
- kotlinCompilerPluginClasspath(" io.github.stslex:compiler-plugin:0.0.1 " )
11
+ implementation(" io.github.stslex:compiler-plugin:$version " )
12
+ kotlinCompilerPluginClasspath(" io.github.stslex:compiler-plugin:$version " )
11
13
}
12
14
```
13
15
14
- in code:
16
+ in code (all annotation properties are optional):
17
+
15
18
``` kotlin
19
+
16
20
import io.github.stslex.compiler_plugin.DistinctUntilChangeFun
17
21
18
- @DistinctUntilChangeFun
19
- fun setUserName (username : String ){
20
- // function logic
22
+ @DistinctUntilChangeFun(
23
+ logging = true ,
24
+ singletonAllow = false ,
25
+ name = " set_user_second_name" ,
26
+ action = TestLogger ::class
27
+ )
28
+ fun setUserName (username : String ) {
29
+ // function logic
21
30
}
22
31
```
32
+
33
+ for custom actions:
34
+
35
+ ``` kotlin
36
+ class TestLogger : Action {
37
+
38
+ override fun invoke (
39
+ name : String ,
40
+ isProcess : Boolean
41
+ ) {
42
+ println (" test action $name procession: $isProcess " )
43
+ }
44
+ }
45
+ ```
You can’t perform that action at this time.
0 commit comments