You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/kotlin/components/Extensions.kt
+31-3Lines changed: 31 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
packagecomponents
2
2
3
+
importStringCare
3
4
importStringCare.Configuration
4
5
importStringCare.Extension
5
6
importgroovy.json.StringEscapeUtils
@@ -33,6 +34,16 @@ fun String.normalize(): String {
33
34
return com.joinToString("")
34
35
}
35
36
37
+
fun String.normalizePath(): String {
38
+
val unixPath =this.replace("\\", "/")
39
+
.replace("\\\\", "/")
40
+
.replace("//", "/")
41
+
returnwhen (getOs()) {
42
+
Os.OSX-> unixPath
43
+
Os.WINDOWS-> unixPath.replace("/", "\\")
44
+
}
45
+
}
46
+
36
47
fun String.escape(): String=Regex.escape(this)
37
48
fun String.unescape(): String=StringEscapeUtils.unescapeJava(this)
38
49
fun String.removeNewLines(): String=this.replace("\n", "")
@@ -135,13 +146,16 @@ fun Process.outputString(): String {
135
146
fundefaultConfig(): Configuration {
136
147
returnConfiguration("app").apply {
137
148
stringFiles.add("strings.xml")
138
-
srcFolders.add("src${File.separator}main")
149
+
srcFolders.add("src/main")
139
150
}
140
151
}
141
152
142
153
fun ResourceFile.backup(): File {
143
-
val cleanPath ="${StringCare.tempFolder}${File.separator}${this.module}${File.separator}${this.sourceFolder}${this.file.absolutePath.split(this.sourceFolder)[1]}"
0 commit comments