Skip to content

Commit b525696

Browse files
authored
Tweak Path to String (#1360)
* Remove `kotlin.io.path.pathString` * Override `toString` for `JarPath`
1 parent c376692 commit b525696

File tree

2 files changed

+3
-2
lines changed
  • src
    • documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/snippet
    • functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/util

2 files changed

+3
-2
lines changed

src/documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/snippet/CodeSnippetExtractor.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import java.util.regex.Pattern
55
import kotlin.io.path.ExperimentalPathApi
66
import kotlin.io.path.Path
77
import kotlin.io.path.name
8-
import kotlin.io.path.pathString
98
import kotlin.io.path.readText
109
import kotlin.io.path.relativeTo
1110
import kotlin.io.path.walk
@@ -28,7 +27,7 @@ object CodeSnippetExtractor {
2827
lang: DslLang,
2928
markdownPath: Path,
3029
): List<SnippetExecutable> {
31-
val relativeDocPath = markdownPath.relativeTo(docRoot).pathString
30+
val relativeDocPath = markdownPath.relativeTo(docRoot).toString()
3231
return createSnippets(markdownPath.readText(), lang).map { (lineNumber, snippet) ->
3332
SnippetExecutable.create(
3433
lang,

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/util/JarPath.kt

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class JarPath(val path: Path) :
2525
fun getMainAttr(name: String): String? {
2626
return manifest.mainAttributes.getValue(name)
2727
}
28+
29+
override fun toString(): String = path.toString()
2830
}
2931

3032
fun ZipFile.getContent(entryName: String): String {

0 commit comments

Comments
 (0)