Fix compilation warnings in 'pill-importer' project

These warnings have fail compilation with bootstrap.
This commit is contained in:
Yahor Berdnikau
2022-05-02 12:26:12 +02:00
committed by Space
parent e4c84032e1
commit e38ca74927
6 changed files with 23 additions and 10 deletions
@@ -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.US)
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.US)}' variant...")
val modulePrefix = System.getProperty("pill.module.prefix", "")
val modelParser = ModelParser(variant, modulePrefix)
@@ -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.US) == "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.US) == "xml" && ALLOWED_ARTIFACT_PATTERNS.none { p -> p.matches(it.name) } }
.forEach { it.delete() }
}
@@ -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()
@@ -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.US) == "jar" -> "jar://" + this(file) + "!/"
else -> "file://" + this(file)
}