Skip to content

Commit

Permalink
Use logger in dependency graph init script (#191)
Browse files Browse the repository at this point in the history
Dependency graph init script now uses Gradle logger to emit warning/info messages.
This allows these messages to be suppressed using `--quiet`.
  • Loading branch information
aleksandrserbin committed Apr 19, 2024
1 parent 750cdda commit 6ccde15
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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'
Expand Down

0 comments on commit 6ccde15

Please sign in to comment.