Skip to content

Commit

Permalink
Move Gradle Doctor conventions to build-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Jan 17, 2025
1 parent 6cba3b1 commit fc73b74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies {
implementation(libs.kotlin.gradlePlugin)
implementation(libs.dokka.gradlePlugin)
implementation(libs.develocity)
implementation(libs.gradleDoctor)

// A hack to make version catalogs accessible from buildSrc sources
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

import ktorbuild.internal.ktorBuild
import org.gradle.api.services.internal.RegisteredBuildServiceProvider

plugins {
id("ktorbuild.base")
id("com.osacky.doctor")
}

Expand All @@ -21,8 +23,8 @@ doctor {

// 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 = System.getenv("TEAMCITY_VERSION") != null ||
properties.getOrDefault("doctor.enableTaskMonitoring", "false").toString().toBoolean()
val enableTasksMonitoring = ktorBuild.isCI.get() ||
findProperty("doctor.enableTaskMonitoring")?.toString().toBoolean()

if (!enableTasksMonitoring) {
logger.info("Gradle Doctor task monitoring is disabled.")
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ extra["nonDefaultProjectStructure"] = mutableListOf(
apply(from = "gradle/compatibility.gradle")

plugins {
id("ktorbuild.base")
id("ktorbuild.doctor")
alias(libs.plugins.binaryCompatibilityValidator)
conventions.gradleDoctor
}

println("Build version: ${project.version}")
Expand Down
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {
implementation(libs.kotlin.serialization)

implementation(libs.kotlinter)
implementation(libs.gradleDoctor)

// A hack to make version catalogs accessible from buildSrc sources
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
Expand Down

0 comments on commit fc73b74

Please sign in to comment.