Skip to content

Commit

Permalink
Fix compilation warnings in 'pill-importer' project
Browse files Browse the repository at this point in the history
These warnings have fail compilation with bootstrap.
  • Loading branch information
Tapchicoma committed May 2, 2022
1 parent 8c7acd6 commit 01a24fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugins/pill/pill-importer/src/JpsCompatiblePluginTasks.kt
Expand Up @@ -91,14 +91,14 @@ class JpsCompatiblePluginTasks(
fun pill() {
initEnvironment(rootProject)

val variantOptionValue = System.getProperty("pill.variant", "base").toUpperCase()
val variantOptionValue = System.getProperty("pill.variant", "base").uppercase(Locale.getDefault())
val variant = PillExtensionMirror.Variant.values().firstOrNull { it.name == variantOptionValue }
?: run {
rootProject.logger.error("Invalid variant name: $variantOptionValue")
return
}

rootProject.logger.lifecycle("Pill: Setting up project for the '${variant.name.toLowerCase()}' variant...")
rootProject.logger.lifecycle("Pill: Setting up project for the '${variant.name.lowercase(Locale.getDefault())}' variant...")

val modulePrefix = System.getProperty("pill.module.prefix", "")
val modelParser = ModelParser(variant, modulePrefix)
Expand Down Expand Up @@ -161,14 +161,14 @@ class JpsCompatiblePluginTasks(
private fun removeJpsAndPillRunConfigurations() {
File(projectDir, ".idea/runConfigurations")
.walk()
.filter { (it.name.startsWith("JPS_") || it.name.startsWith("Pill_")) && it.extension.toLowerCase() == "xml" }
.filter { (it.name.startsWith("JPS_") || it.name.startsWith("Pill_")) && it.extension.lowercase(Locale.getDefault()) == "xml" }
.forEach { it.delete() }
}

private fun removeArtifactConfigurations() {
File(projectDir, ".idea/artifacts")
.walk()
.filter { it.extension.toLowerCase() == "xml" && ALLOWED_ARTIFACT_PATTERNS.none { p -> p.matches(it.name) } }
.filter { it.extension.lowercase(Locale.getDefault()) == "xml" && ALLOWED_ARTIFACT_PATTERNS.none { p -> p.matches(it.name) } }
.forEach { it.delete() }
}

Expand Down
3 changes: 2 additions & 1 deletion plugins/pill/pill-importer/src/util/PathContext.kt
Expand Up @@ -9,6 +9,7 @@ import org.gradle.api.Project
import org.jetbrains.kotlin.pill.model.PModule
import org.jetbrains.kotlin.pill.model.PProject
import java.io.File
import java.util.*

private val USER_HOME_DIR_PATH = System.getProperty("user.home").withSlash()

Expand All @@ -29,7 +30,7 @@ interface PathContext {

fun url(file: File): Pair<String, String> {
val path = when {
file.isFile && file.extension.toLowerCase() == "jar" -> "jar://" + this(file) + "!/"
file.isFile && file.extension.lowercase(Locale.getDefault()) == "jar" -> "jar://" + this(file) + "!/"
else -> "file://" + this(file)
}

Expand Down

0 comments on commit 01a24fd

Please sign in to comment.