Minor: simplify File.isKotlinFile utility function
KT-8487
This commit is contained in:
+2
-6
@@ -104,12 +104,8 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractCo
|
|||||||
|
|
||||||
private fun getKotlinSources(): List<File> = (getSource() as Iterable<File>).filter { it.isKotlinFile() }
|
private fun getKotlinSources(): List<File> = (getSource() as Iterable<File>).filter { it.isKotlinFile() }
|
||||||
|
|
||||||
protected fun File.isKotlinFile(): Boolean {
|
protected fun File.isKotlinFile(): Boolean =
|
||||||
return when (FilenameUtils.getExtension(name).toLowerCase()) {
|
FilenameUtils.isExtension(name.toLowerCase(), listOf("kt", "kts"))
|
||||||
"kt", "kts" -> true
|
|
||||||
else -> false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun populateSources(args:T, sources: List<File>) {
|
private fun populateSources(args:T, sources: List<File>) {
|
||||||
args.freeArgs = sources.map { it.absolutePath }
|
args.freeArgs = sources.map { it.absolutePath }
|
||||||
|
|||||||
Reference in New Issue
Block a user