Replace systemIndependentPath from Idea with invariantSeparatorsPath
This commit is contained in:
committed by
teamcity
parent
0727981ae6
commit
049066f8ac
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.code
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.util.io.systemIndependentPath
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import java.io.File
|
||||
@@ -275,16 +274,16 @@ class CodeConformanceTest : TestCase() {
|
||||
|
||||
private class FileMatcher(val root: File, paths: Collection<String>) {
|
||||
private val files = paths.map { File(it) }
|
||||
private val paths = files.mapTo(HashSet()) { it.systemIndependentPath }
|
||||
private val relativePaths = files.filterTo(ArrayList()) { it.isDirectory }.mapTo(HashSet()) { it.systemIndependentPath + "/" }
|
||||
private val paths = files.mapTo(HashSet()) { it.invariantSeparatorsPath }
|
||||
private val relativePaths = files.filterTo(ArrayList()) { it.isDirectory }.mapTo(HashSet()) { it.invariantSeparatorsPath + "/" }
|
||||
|
||||
fun matchExact(file: File): Boolean {
|
||||
return file.relativeTo(root).systemIndependentPath in paths
|
||||
return file.relativeTo(root).invariantSeparatorsPath in paths
|
||||
}
|
||||
|
||||
fun matchWithContains(file: File): Boolean {
|
||||
if (matchExact(file)) return true
|
||||
val relativePath = file.relativeTo(root).systemIndependentPath
|
||||
val relativePath = file.relativeTo(root).invariantSeparatorsPath
|
||||
return relativePaths.any { relativePath.startsWith(it) }
|
||||
}
|
||||
}
|
||||
@@ -368,7 +367,7 @@ class CodeConformanceTest : TestCase() {
|
||||
for ((repo, files) in repoOccurrencesStableOrder) {
|
||||
appendLine(repo)
|
||||
for (file in files) {
|
||||
appendLine(" ${file.relativeTo(root).systemIndependentPath}")
|
||||
appendLine(" ${file.relativeTo(root).invariantSeparatorsPath}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.generators.imltogradle
|
||||
|
||||
import com.google.gson.JsonParser
|
||||
import com.intellij.openapi.util.io.systemIndependentPath
|
||||
import org.jetbrains.jps.model.JpsSimpleElement
|
||||
import org.jetbrains.jps.model.java.JavaResourceRootType
|
||||
import org.jetbrains.jps.model.java.JavaSourceRootType
|
||||
@@ -17,8 +16,7 @@ import org.jetbrains.jps.model.library.JpsOrderRootType
|
||||
import org.jetbrains.jps.model.module.*
|
||||
import org.jetbrains.kotlin.generators.imltogradle.GradleDependencyNotation.IntellijDepGradleDependencyNotation
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.system.measureNanoTime
|
||||
|
||||
|
||||
private lateinit var intellijModuleNameToGradleDependencyNotationsMapping: Map<String, List<GradleDependencyNotation>>
|
||||
private val KOTLIN_REPO_ROOT = File(".").canonicalFile
|
||||
@@ -205,8 +203,8 @@ fun convertJpsDependencyElement(dep: JpsDependencyElement): List<JpsLikeDependen
|
||||
|
||||
fun convertJpsModuleSourceRoot(imlFile: File, sourceRoot: JpsModuleSourceRoot): String {
|
||||
return when (sourceRoot.rootType) {
|
||||
is JavaSourceRootType -> "java.srcDir(\"${sourceRoot.file.relativeTo(imlFile.parentFile).systemIndependentPath}\")"
|
||||
is JavaResourceRootType -> "resources.srcDir(\"${sourceRoot.file.relativeTo(imlFile.parentFile).systemIndependentPath}\")"
|
||||
is JavaSourceRootType -> "java.srcDir(\"${sourceRoot.file.relativeTo(imlFile.parentFile).invariantSeparatorsPath}\")"
|
||||
is JavaResourceRootType -> "resources.srcDir(\"${sourceRoot.file.relativeTo(imlFile.parentFile).invariantSeparatorsPath}\")"
|
||||
else -> error("Unknown sourceRoot = $sourceRoot")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
package org.jetbrains.kotlin.jvm.abi
|
||||
|
||||
import com.intellij.openapi.util.io.systemIndependentPath
|
||||
import org.jetbrains.kotlin.codegen.BytecodeListingTextCollectingVisitor
|
||||
import org.jetbrains.kotlin.incremental.isClassFile
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
import org.jetbrains.org.objectweb.asm.*
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractIrJvmAbiContentTest : AbstractJvmAbiContentTest() {
|
||||
override val useIrBackend = true
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.jetbrains.kotlin.jvm.abi
|
||||
|
||||
import com.intellij.openapi.util.io.systemIndependentPath
|
||||
import org.jetbrains.kotlin.codegen.BytecodeListingTextCollectingVisitor
|
||||
import org.jetbrains.kotlin.incremental.isClassFile
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
@@ -29,7 +28,7 @@ abstract class AbstractJvmAbiContentTest : BaseJvmAbiTest() {
|
||||
}
|
||||
|
||||
val actual = classToBytecode.entries
|
||||
.sortedBy { it.key.relativeTo(baseDir).systemIndependentPath }
|
||||
.sortedBy { it.key.relativeTo(baseDir).invariantSeparatorsPath }
|
||||
.joinToString("\n") { it.value }
|
||||
val signaturesFile = testDir.resolve("signatures.txt")
|
||||
if (!signaturesFile.exists()) {
|
||||
|
||||
Reference in New Issue
Block a user