KT-18765 Move incremental compilation message from Gradle's warning to info logging level

This commit is contained in:
Andrey Mischenko
2017-09-11 17:55:18 +08:00
parent 9e3f866831
commit 4a2ea4de4b
3 changed files with 24 additions and 2 deletions
@@ -418,7 +418,16 @@ abstract class BaseGradleIT {
private fun Project.createGradleTailParameters(options: BuildOptions, params: Array<out String> = arrayOf()): List<String> =
params.toMutableList().apply {
add("--stacktrace")
add("--${minLogLevel.name.toLowerCase()}")
when (minLogLevel) {
// Do not allow to configure Gradle project with `ERROR` log level (error logs visible on all log levels)
LogLevel.ERROR -> error("Log level ERROR is not supported by Gradle command-line")
// Omit log level argument for default `LIFECYCLE` log level,
// because there is no such command-line option `--lifecycle`
// see https://docs.gradle.org/current/userguide/logging.html#sec:choosing_a_log_level
LogLevel.LIFECYCLE -> Unit
//Command line option for other log levels
else -> add("--${minLogLevel.name.toLowerCase()}")
}
if (options.daemonOptionSupported) {
add(if (options.withDaemon) "--daemon" else "--no-daemon")
}
@@ -265,6 +265,19 @@ class KotlinGradleIT: BaseGradleIT() {
}
}
@Test
fun testIncrementalCompilationLogLevel() {
val infoProject = Project("kotlinProject", GRADLE_VERSION, minLogLevel = LogLevel.INFO)
infoProject.build("build") {
assertContains(USING_INCREMENTAL_COMPILATION_MESSAGE)
}
val lifecycleProject = Project("kotlinProject", GRADLE_VERSION, minLogLevel = LogLevel.LIFECYCLE)
lifecycleProject.build("build") {
assertNotContains(USING_INCREMENTAL_COMPILATION_MESSAGE)
}
}
@Test
fun testConvertJavaToKotlin() {
val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION)
@@ -315,7 +315,7 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
val environment = when {
!incremental -> GradleCompilerEnvironment(computedCompilerClasspath, messageCollector, outputItemCollector, args)
else -> {
logger.warn(USING_INCREMENTAL_COMPILATION_MESSAGE)
logger.info(USING_INCREMENTAL_COMPILATION_MESSAGE)
GradleIncrementalCompilerEnvironment(computedCompilerClasspath, changedFiles, reporter, taskBuildDirectory,
messageCollector, outputItemCollector, args, kaptAnnotationsFileUpdater,
artifactDifferenceRegistryProvider,