@@ -405,31 +405,30 @@ def configureGroovydoc(TaskProvider groovydoc) {
405405 }
406406}
407407
408- def preprocessBranchesAndPrsWorkflowCodecovOutput = layout. buildDirectory. file(' codecov_branches-and-prs.yml' )
409- def preprocessReleaseWorkflowCodecovOutput = layout. buildDirectory. file(' codecov_release.yml' )
408+ tasks. preprocessBranchesAndPrsWorkflow {
409+ inputs. file(' .github/codecov.yml' ). withPropertyName(' codecovConfig' )
410+ def preprocessBranchesAndPrsWorkflowCodecovOutput = layout. buildDirectory. file(' codecov_branches-and-prs.yml' )
411+ outputs. file(preprocessBranchesAndPrsWorkflowCodecovOutput). withPropertyName(' codecovConfig' )
410412
411- def copyCodecovConfig = tasks. register(' copyCodecovConfig' ) {
412413 doLast {
413414 copy {
414- from(
415- [
416- preprocessBranchesAndPrsWorkflowCodecovOutput,
417- preprocessReleaseWorkflowCodecovOutput
418- ]. max {it. get(). asFile. lastModified() })
415+ from(preprocessBranchesAndPrsWorkflowCodecovOutput)
419416 into(' .github' )
420417 rename { ' codecov.yml' }
421418 }
422419 }
423420}
424421
425- tasks. preprocessBranchesAndPrsWorkflow {
426- inputs. file(' .github/codecov.yml' ). withPropertyName(' codecovConfig' )
427- outputs. file(preprocessBranchesAndPrsWorkflowCodecovOutput). withPropertyName(' codecovConfig' )
428- finalizedBy(copyCodecovConfig)
429- }
430-
431422tasks. preprocessReleaseWorkflow {
432423 inputs. file(' .github/codecov.yml' ). withPropertyName(' codecovConfig' )
424+ def preprocessReleaseWorkflowCodecovOutput = layout. buildDirectory. file(' codecov_release.yml' )
433425 outputs. file(preprocessReleaseWorkflowCodecovOutput). withPropertyName(' codecovConfig' )
434- finalizedBy(copyCodecovConfig)
426+
427+ doLast {
428+ copy {
429+ from(preprocessReleaseWorkflowCodecovOutput)
430+ into(' .github' )
431+ rename { ' codecov.yml' }
432+ }
433+ }
435434}
0 commit comments