Skip to content

Commit

Permalink
Replace toLowerCase
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Mar 6, 2023
1 parent 101f26e commit bc378dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.android.build.gradle.api.LibraryVariant
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation
import java.util.Locale

internal fun Project.isMainSourceSet(sourceSet: KotlinSourceSet): Boolean {
return isMainSourceSet(allCompilationsOf(sourceSet))
Expand All @@ -22,8 +23,7 @@ private fun isMainCompilation(compilation: KotlinCompilation): Boolean {
return androidVariant is LibraryVariant || androidVariant is ApplicationVariant
}
} catch (e: NoSuchMethodError) {
// Kotlin Plugin version below 1.4
return !compilation.name.toLowerCase().endsWith("test")
return !compilation.name.lowercase(Locale.getDefault()).endsWith("test")
}
return compilation.name == "main"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.gradle.api.internal.project.ProjectInternal
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType
import org.gradle.testfixtures.ProjectBuilder
import java.util.Locale
import kotlin.test.*

class AndroidAutoConfigurationTest {
Expand Down Expand Up @@ -47,7 +48,7 @@ class AndroidAutoConfigurationTest {
project as ProjectInternal
project.evaluate()
dokkaTasks.flatMap { it.dokkaSourceSets }.forEach { sourceSet ->
if ("test" in sourceSet.name.toLowerCase()) {
if ("test" in sourceSet.name.lowercase(Locale.getDefault())) {
assertTrue(
sourceSet.suppress.get(),
"Expected source set `${sourceSet.name}` to be suppressed by default"
Expand Down

0 comments on commit bc378dd

Please sign in to comment.