-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KTOR-7825 Decrease Gradle memory consumption (#4483)
* Decrease memory for Kotlin Daemons and Gradle Daemon * Disable Gradle Doctor task monitoring by default
- Loading branch information
Showing
6 changed files
with
71 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
buildSrc/src/main/kotlin/conventions.gradleDoctor.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
import org.gradle.api.services.internal.RegisteredBuildServiceProvider | ||
|
||
plugins { | ||
id("com.osacky.doctor") | ||
} | ||
|
||
doctor { | ||
enableTestCaching = false | ||
} | ||
|
||
// Always monitor tasks on CI, but disable it locally by default with providing an option to opt-in. | ||
// See 'doctor.enableTaskMonitoring' in gradle.properties for details. | ||
val enableTasksMonitoring = CI || | ||
properties.getOrDefault("doctor.enableTaskMonitoring", "false").toString().toBoolean() | ||
|
||
if (!enableTasksMonitoring) { | ||
logger.info("Gradle Doctor task monitoring is disabled.") | ||
gradle.sharedServices.unregister("listener-service") | ||
} | ||
|
||
fun BuildServiceRegistry.unregister(name: String) { | ||
val registration = registrations.getByName(name) | ||
registrations.remove(registration) | ||
(registration.service as RegisteredBuildServiceProvider<*, *>).maybeStop() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters