Code cleanup: several inspections applied
This commit is contained in:
committed by
Mikhail Glukhikh
parent
fdca96634e
commit
840847e47c
@@ -27,7 +27,7 @@ interface ICReporter {
|
||||
fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {}
|
||||
|
||||
fun pathsAsString(files: Iterable<File>): String =
|
||||
files.map { it.canonicalPath }.joinToString()
|
||||
files.joinToString { it.canonicalPath }
|
||||
|
||||
fun pathsAsString(vararg files: File): String =
|
||||
pathsAsString(files.toList())
|
||||
|
||||
@@ -41,9 +41,7 @@ import java.util.*
|
||||
|
||||
|
||||
fun Iterable<File>.javaSourceRoots(roots: Iterable<File>): Iterable<File> =
|
||||
filter(File::isJavaFile)
|
||||
.map { findSrcDirRoot(it, roots) }
|
||||
.filterNotNull()
|
||||
filter(File::isJavaFile).mapNotNull { findSrcDirRoot(it, roots) }
|
||||
|
||||
fun makeModuleFile(name: String, isTest: Boolean, outputDir: File, sourcesToCompile: Iterable<File>, javaSourceRoots: Iterable<File>, classpath: Iterable<File>, friendDirs: Iterable<File>): File {
|
||||
val builder = KotlinModuleXmlBuilder()
|
||||
@@ -166,7 +164,7 @@ fun<Target> OutputItemsCollectorImpl.generatedFiles(
|
||||
return outputs.map { outputItem ->
|
||||
val target =
|
||||
outputItem.sourceFiles.firstOrNull()?.let { sourceToTarget[it] } ?:
|
||||
targets.filter { getOutputDir(it)?.let { outputItem.outputFile.startsWith(it) } ?: false }.singleOrNull() ?:
|
||||
targets.singleOrNull { getOutputDir(it)?.let { outputItem.outputFile.startsWith(it) } ?: false } ?:
|
||||
representativeTarget
|
||||
|
||||
when (outputItem.outputFile.extension) {
|
||||
|
||||
@@ -42,5 +42,5 @@ open class BasicMapsOwner {
|
||||
maps.forEach { it.flush(memoryCachesOnly) }
|
||||
}
|
||||
|
||||
@TestOnly fun dump(): String = maps.map { it.dump() }.joinToString("\n\n")
|
||||
@TestOnly fun dump(): String = maps.joinToString("\n\n") { it.dump() }
|
||||
}
|
||||
Reference in New Issue
Block a user