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 22
33> Check annotated functions arguments. If they don't change - return last result.
44> Functions could be logged.
5+ > Support extra custom action on function processing
6+
7+ import compiler plugin:
58
6- import compiler plugin:
79``` kotlin
810dependencies {
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 " )
1113}
1214```
1315
14- in code:
16+ in code (all annotation properties are optional):
17+
1518``` kotlin
19+
1620import io.github.stslex.compiler_plugin.DistinctUntilChangeFun
1721
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
2130}
2231```
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