Skip to content

Commit 3a42d8a

Browse files
committed
release 1.7.10.3
1 parent 591556e commit 3a42d8a

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

Readme.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff 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
```
68103
plugins {
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
84119
plugins {
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

94134
Compatible with Java 8.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
kotlin.code.style=official
22

3-
VERSION_NAME=1.7.10.3-SNAPSHOT
3+
VERSION_NAME=1.7.10.3
44

55
GROUP=com.bennyhuo.kotlin
66

trimindent-compiler/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

2424
val compileKotlin: KotlinCompile by tasks

0 commit comments

Comments
 (0)