Skip to content

Commit fc84cfd

Browse files
committed
Hide workerIsolation configuration status message in quiet mode to avoid build output pollution
1 parent fa31868 commit fc84cfd

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

  • modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks

modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,25 +1064,30 @@ abstract class GenerateTask : DefaultTask() {
10641064
// exits, and Gradle reuses the same worker daemon across tasks that share the same classpath,
10651065
// so startup cost is amortized — typically paid only once per parallel slot.
10661066
val isolation = workerIsolation.getOrElse("classloader").lowercase()
1067+
val quietMode = quiet.getOrElse(false)
10671068
val workQueue = when (isolation) {
10681069
"process" -> {
1069-
val heapMsg = maxWorkerHeapSize.orNull?.let { " (maxHeapSize=$it)" } ?: ""
1070-
logger.lifecycle(
1071-
"[openApiGenerate] Worker isolation: process$heapMsg " +
1072-
"(isolated JVM per task, no Metaspace leak - " +
1073-
"use workerIsolation = \"classloader\" to skip per-task JVM startup cost at the cost of increased Metaspace usage)"
1074-
)
1070+
if (!quietMode) {
1071+
val heapMsg = maxWorkerHeapSize.orNull?.let { " (maxHeapSize=$it)" } ?: ""
1072+
logger.lifecycle(
1073+
"[openApiGenerate] Worker isolation: process$heapMsg " +
1074+
"(isolated JVM per task, no Metaspace leak - " +
1075+
"use workerIsolation = \"classloader\" to skip per-task JVM startup cost at the cost of increased Metaspace usage)"
1076+
)
1077+
}
10751078
workerExecutor.processIsolation {
10761079
maxWorkerHeapSize.orNull?.let { forkOptions.maxHeapSize = it }
10771080
}
10781081
}
10791082

10801083
"classloader" -> {
1081-
logger.lifecycle(
1082-
"[openApiGenerate] Worker isolation: classloader " +
1083-
"(fast startup, but generator classes accumulate in Gradle daemon Metaspace - " +
1084-
"consider workerIsolation = \"process\" if you hit metaspace pressure)"
1085-
)
1084+
if (!quietMode) {
1085+
logger.lifecycle(
1086+
"[openApiGenerate] Worker isolation: classloader " +
1087+
"(fast startup, but generator classes accumulate in Gradle daemon Metaspace - " +
1088+
"consider workerIsolation = \"process\" if you hit metaspace pressure)"
1089+
)
1090+
}
10861091
workerExecutor.classLoaderIsolation()
10871092
}
10881093

0 commit comments

Comments
 (0)