Skip to content

Commit

Permalink
Support Kotlin Multiplatform Project (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech committed Oct 18, 2021
1 parent 77aabd0 commit 0bc4e0e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ fun hasLintPlugin(): Boolean {
}

fun Project.kotlinFiles(baseDir: String = ".") =
fileTree(mapOf("dir" to baseDir, "exclude" to "**/build/**", "includes" to listOf("**/*.kt", "**/*.kts")))
fileTree(mapOf(
"dir" to baseDir,
"excludes" to listOf("build/**", "**/build/**", "generated/**", "**/generated/**"),
"includes" to listOf("**/*.kt", "**/*.kts")
))

fun Project.editorconfigFile() = fileTree(mapOf("dir" to ".", "include" to ".editorconfig"))

Expand Down Expand Up @@ -377,8 +381,9 @@ private fun Project.isAndroidProject(): Boolean {
private fun Project.isKotlinProject(): Boolean {
val isKotlin = plugins.hasPlugin("kotlin")
val isKotlinAndroid = plugins.hasPlugin("kotlin-android")
val isKotlinMultiPlatform = plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")
val isKotlinPlatformCommon = plugins.hasPlugin("kotlin-platform-common")
val isKotlinPlatformJvm = plugins.hasPlugin("kotlin-platform-jvm")
val isKotlinPlatformJs = plugins.hasPlugin("kotlin-platform-js")
return isKotlin || isKotlinAndroid || isKotlinPlatformCommon || isKotlinPlatformJvm || isKotlinPlatformJs
return isKotlin || isKotlinAndroid || isKotlinMultiPlatform || isKotlinPlatformCommon || isKotlinPlatformJvm || isKotlinPlatformJs
}

0 comments on commit 0bc4e0e

Please sign in to comment.