KT-18765 Move incremental compilation message from Gradle's warning to info logging level
This commit is contained in:
+10
-1
@@ -418,7 +418,16 @@ abstract class BaseGradleIT {
|
|||||||
private fun Project.createGradleTailParameters(options: BuildOptions, params: Array<out String> = arrayOf()): List<String> =
|
private fun Project.createGradleTailParameters(options: BuildOptions, params: Array<out String> = arrayOf()): List<String> =
|
||||||
params.toMutableList().apply {
|
params.toMutableList().apply {
|
||||||
add("--stacktrace")
|
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) {
|
if (options.daemonOptionSupported) {
|
||||||
add(if (options.withDaemon) "--daemon" else "--no-daemon")
|
add(if (options.withDaemon) "--daemon" else "--no-daemon")
|
||||||
}
|
}
|
||||||
|
|||||||
+13
@@ -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
|
@Test
|
||||||
fun testConvertJavaToKotlin() {
|
fun testConvertJavaToKotlin() {
|
||||||
val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION)
|
val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION)
|
||||||
|
|||||||
+1
-1
@@ -315,7 +315,7 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
|
|||||||
val environment = when {
|
val environment = when {
|
||||||
!incremental -> GradleCompilerEnvironment(computedCompilerClasspath, messageCollector, outputItemCollector, args)
|
!incremental -> GradleCompilerEnvironment(computedCompilerClasspath, messageCollector, outputItemCollector, args)
|
||||||
else -> {
|
else -> {
|
||||||
logger.warn(USING_INCREMENTAL_COMPILATION_MESSAGE)
|
logger.info(USING_INCREMENTAL_COMPILATION_MESSAGE)
|
||||||
GradleIncrementalCompilerEnvironment(computedCompilerClasspath, changedFiles, reporter, taskBuildDirectory,
|
GradleIncrementalCompilerEnvironment(computedCompilerClasspath, changedFiles, reporter, taskBuildDirectory,
|
||||||
messageCollector, outputItemCollector, args, kaptAnnotationsFileUpdater,
|
messageCollector, outputItemCollector, args, kaptAnnotationsFileUpdater,
|
||||||
artifactDifferenceRegistryProvider,
|
artifactDifferenceRegistryProvider,
|
||||||
|
|||||||
Reference in New Issue
Block a user