diff --git a/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt b/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt index 6fc36e55bc6..68b799d4ff9 100644 --- a/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt +++ b/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt @@ -16,9 +16,6 @@ package org.jetbrains.kotlin.incremental.testingUtils -import com.google.common.collect.Sets -import com.google.common.hash.Hashing -import com.google.common.io.Files import com.google.protobuf.ExtensionRegistry import com.intellij.openapi.util.io.FileUtil import org.jetbrains.kotlin.incremental.LocalFileKotlinClass @@ -36,6 +33,7 @@ import java.io.File import java.io.PrintWriter import java.io.StringWriter import java.util.* +import java.util.zip.CRC32 import kotlin.comparisons.compareBy // Set this to true if you want to dump all bytecode (test will fail in this case) @@ -45,7 +43,7 @@ fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Bool val pathsInExpected = getAllRelativePaths(expected) val pathsInActual = getAllRelativePaths(actual) - val commonPaths = Sets.intersection(pathsInExpected, pathsInActual) + val commonPaths = pathsInExpected.intersect(pathsInActual) val changedPaths = commonPaths .filter { DUMP_ALL || !Arrays.equals(File(expected, it).readBytes(), File(actual, it).readBytes()) } .sorted() @@ -71,7 +69,11 @@ fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Bool Assert.assertEquals(expectedString, actualString) } -private fun File.hash() = Files.hash(this, Hashing.crc32()) +private fun File.checksumString(): String { + val crc32 = CRC32() + crc32.update(this.readBytes()) + return java.lang.Long.toHexString(crc32.value) +} private fun getDirectoryString(dir: File, interestingPaths: List): String { val buf = StringBuilder() @@ -93,7 +95,7 @@ private fun getDirectoryString(dir: File, interestingPaths: List): Strin } } else { - p.println(child.name, " ", child.hash()) + p.println(child.name, " ", child.checksumString()) } } diff --git a/build.xml b/build.xml index ac98c0efda8..10f04eb2880 100644 --- a/build.xml +++ b/build.xml @@ -675,25 +675,28 @@ - - + + + + + + - - +