File tree Expand file tree Collapse file tree 3 files changed +44
-4
lines changed
Expand file tree Collapse file tree 3 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,47 @@ world2
6262!!!
6363```
6464
65+ With version 1.7.10.3, you can also do this magic:
66+
67+ ```
68+ val s1 = """
69+ if(a > 1) {
70+ return true
71+ }
72+ """.trimIndent()
73+ val s2 = """
74+ def test(a) {
75+ $s1
76+ }
77+ """.trimIndent()
78+
79+ val s3 = """
80+ class Test {
81+ $s2
82+ }
83+ """.trimIndent()
84+ ```
85+
86+ The result value of s3 will be:
87+
88+ ```
89+ class Test {
90+ def test(a) {
91+ if(a > 1) {
92+ return true
93+ }
94+ }
95+ }
96+ ```
97+
98+ It is really useful when you use Kotlin String template as a template to render some other Strings.
99+
65100## Try it
66101
67102```
68103plugins {
69104 ...
70- id("com.bennyhuo.kotlin.trimindent") version "1.7.10.2 "
105+ id("com.bennyhuo.kotlin.trimindent") version "1.7.10.3 "
71106}
72107```
73108
@@ -83,12 +118,17 @@ buildscript {
83118
84119plugins {
85120 ...
86- id("com.bennyhuo.kotlin.trimindent") version "1.7.10.3 -SNAPSHOT"
121+ id("com.bennyhuo.kotlin.trimindent") version "1.7.10.4 -SNAPSHOT"
87122}
88123```
89124
90125## Change Log
91126
127+ ### 1.7.10.3
128+
129+ * Fix: A newline was mistakenly inserted after an interpolated variable.
130+ * Feat: Reindent the whole value of the interpolated variable.
131+
92132### 1.7.10.2
93133
94134Compatible with Java 8.
Original file line number Diff line number Diff line change 11kotlin.code.style =official
22
3- VERSION_NAME =1.7.10.3-SNAPSHOT
3+ VERSION_NAME =1.7.10.3
44
55GROUP =com.bennyhuo.kotlin
66
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ dependencies {
1818 testImplementation(kotlin(" test-junit" ))
1919 testImplementation(" org.jetbrains.kotlin:kotlin-compiler-embeddable" )
2020 testImplementation(" com.github.tschuchortdev:kotlin-compile-testing:1.4.9" )
21- testImplementation(" com.bennyhuo.kotlin:kotlin-compile-testing-extensions:1.7.10.2-SNAPSHOT " )
21+ testImplementation(" com.bennyhuo.kotlin:kotlin-compile-testing-extensions:1.7.10.2" )
2222}
2323
2424val compileKotlin: KotlinCompile by tasks
You can’t perform that action at this time.
0 commit comments