Sanitize names for script class files
Use the same process that is done for package parts in the JVM back-end, except adding the "Kt" suffix #KT-15225 Fixed
This commit is contained in:
@@ -45,4 +45,9 @@ object NameUtils {
|
||||
str.substring(0, 1).toUpperCase(Locale.ENGLISH) + str.substring(1)
|
||||
else
|
||||
"_$str"
|
||||
|
||||
// "pkg/someScript.kts" -> "SomeScript"
|
||||
@JvmStatic
|
||||
fun getScriptNameForFile(filePath: String): Name =
|
||||
Name.identifier(NameUtils.getPackagePartClassNamePrefix(filePath.substringAfterLast('/').substringBeforeLast('.')))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user