diff --git a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt index 988539cec82..70358905112 100644 --- a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt +++ b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt @@ -190,11 +190,12 @@ class K2Native : CLICompiler() { else -> put(GENERATE_TEST_RUNNER, TestRunnerKind.NONE) } // We need to download dependencies only if we use them ( = there are files to compile). - put(CHECK_DEPENDENCIES, if (configuration.kotlinSourceRoots.isNotEmpty() || !arguments.sourceLibraries.isNullOrEmpty()) { - true - } else { - arguments.checkDependencies - }) + put( + CHECK_DEPENDENCIES, + configuration.kotlinSourceRoots.isNotEmpty() + || !arguments.sourceLibraries.isNullOrEmpty() + || arguments.checkDependencies + ) if (arguments.friendModules != null) put(FRIEND_MODULES, arguments.friendModules!!.split(File.pathSeparator).filterNot(String::isEmpty)) @@ -310,8 +311,11 @@ private fun selectSourceLibraries( val produceBinaryOrBitcode = outputKind.let { it.isNativeBinary || it == CompilerOutputKind.BITCODE } return if (sourceLibraries.isNotEmpty() && !produceBinaryOrBitcode) { - configuration.report(ERROR, "The $SOURCE_LIBRARY_ARG flag is only supported when producing native binaries or bitcode files, " + - "but the compiler is producing ${outputKind.name.toLowerCase()}") + configuration.report( + ERROR, + "The $SOURCE_LIBRARY_ARG flag is only supported when producing native binaries or bitcode files, " + + "but the compiler is producing ${outputKind.name.toLowerCase()}" + ) emptyList() } else { sourceLibraries diff --git a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt index f45dd3e7ae9..05c6d026578 100644 --- a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt +++ b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt @@ -160,7 +160,7 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument( value = SOURCE_LIBRARY_ARG, valueDescription = "", - description = "A library to be processed in the same manner as source files (test processing, ObjC export etc).\n" + + description = "A library to be processed in the same manner as source files.\n" + "Must be one of libraries passed with '-library'" ) var sourceLibraries: Array? = null @@ -193,7 +193,7 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument( value = "-Xlibrary-to-cover", valueDescription = "", - description = "A library that should be covered.\n" + + description = "Provide code coverage for the given library.\n" + "Must be one of libraries passed with '-library'", delimiter = "" ) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt index d04c2344484..c6d1d914454 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt @@ -80,7 +80,11 @@ private sealed class FeaturedLibrariesReporter { protected abstract fun notIncludedLibraryMessageTitle(): String override fun reportIllegalKind(library: KonanLibrary) { - val kind = if (library.isInterop) "Interop" else "Default" + val kind = when { + library.isInterop -> "Interop" + library.isDefault -> "Default" + else -> "Unknown kind" + } configuration.report(CompilerMessageSeverity.STRONG_WARNING, illegalKindMessage(kind, library.libraryName)) } @@ -115,10 +119,10 @@ private sealed class FeaturedLibrariesReporter { private class CoveredLibraryReporter(configuration: CompilerConfiguration): BaseReporter(configuration) { override fun illegalKindMessage(kind: String, libraryName: String): String = - "$kind library $libraryName can't be covered" + "Cannot provide the code coverage for the $kind library $libraryName." override fun notIncludedLibraryMessageTitle(): String = - "Following libraries are specified to be covered with -Xlibrary-to-cover, but not included to the build:" + "The code coverage is enabled for the following libraries, but they are not included to the build:" } companion object { diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt index 21aa50417f5..9838ad2bb8e 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfig.kt @@ -39,7 +39,8 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration internal val target = targetManager.target internal val phaseConfig = configuration.get(CLIConfigurationKeys.PHASE_CONFIG)!! - val infoArgsOnly = configuration.kotlinSourceRoots.isEmpty() && configuration[KonanConfigKeys.SOURCE_LIBRARIES].isNullOrEmpty() + val infoArgsOnly = configuration.kotlinSourceRoots.isEmpty() + && configuration[KonanConfigKeys.SOURCE_LIBRARIES].isNullOrEmpty() // TODO: debug info generation mode and debug/release variant selection probably requires some refactoring. val debug: Boolean get() = configuration.getBoolean(KonanConfigKeys.DEBUG) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt index d4a9949f27b..d1c4505d6b0 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt @@ -95,7 +95,7 @@ class KonanConfigKeys { val RUNTIME_FILE: CompilerConfigurationKey = CompilerConfigurationKey.create("override default runtime file path") val SOURCE_LIBRARIES: CompilerConfigurationKey> - = CompilerConfigurationKey("a klibraries used to produce the final binaries instead of source code") // TODO: Better description. + = CompilerConfigurationKey("libraries used to be processed in the same manner as source files") val SOURCE_MAP: CompilerConfigurationKey> = CompilerConfigurationKey.create("generate source map") val STATIC_FRAMEWORK: CompilerConfigurationKey