From 6ccde1512289d8cfa38517bba2bb7968789c8f4d Mon Sep 17 00:00:00 2001 From: Alex Serbin Date: Fri, 19 Apr 2024 15:03:17 +0200 Subject: [PATCH] Use logger in dependency graph init script (#191) Dependency graph init script now uses Gradle logger to emit warning/info messages. This allows these messages to be suppressed using `--quiet`. --- .../gradle-actions.github-dependency-graph.init.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph.init.gradle b/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph.init.gradle index ae03c18..5a15992 100644 --- a/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph.init.gradle +++ b/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph.init.gradle @@ -12,7 +12,7 @@ if (gradleVersion < GradleVersion.version("5.2") || if (getVariable('GITHUB_DEPENDENCY_GRAPH_CONTINUE_ON_FAILURE') != "true") { throw new GradleException("Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated.") } - println "::warning::Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated." + logger.warn("::warning::Dependency Graph is not supported for ${gradleVersion}. No dependency snapshot will be generated.") return } @@ -23,11 +23,11 @@ if (isTopLevelBuild) { def reportFile = getUniqueReportFile(getVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR')) if (reportFile == null) { - println "::warning::No dependency snapshot generated for step. Could not determine unique job correlator - specify GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR var for this step." + logger.warn("::warning::No dependency snapshot generated for step. Could not determine unique job correlator - specify GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR var for this step.") return } - println "Generating dependency graph into '${reportFile}'" + logger.lifecycle("Generating dependency graph into '${reportFile}'") } apply from: 'gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy'