Skip to content

Commit a5d0f0d

Browse files
authored
Update MakeReleaseNotes to crash if notes are missing. (#5613)
The task is only invoked on projects that are scheduled to be released. And projects that publish refdocs are the ones that also publish release notes. The task now verifies that if it's called in a project that publishes refdocs, it has to have release notes, otherwise it breaks.
1 parent 36cc041 commit a5d0f0d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/MakeReleaseNotesTask.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
package com.google.firebase.gradle.plugins
1818

1919
import org.gradle.api.DefaultTask
20+
import org.gradle.api.GradleException
2021
import org.gradle.api.file.RegularFileProperty
2122
import org.gradle.api.tasks.InputFile
2223
import org.gradle.api.tasks.OutputFile
2324
import org.gradle.api.tasks.StopActionException
2425
import org.gradle.api.tasks.TaskAction
26+
import org.gradle.work.DisableCachingByDefault
2527

2628
/**
2729
* Creates the release notes for the given project.
@@ -35,6 +37,7 @@ import org.gradle.api.tasks.TaskAction
3537
* changes to release
3638
* @see make
3739
*/
40+
@DisableCachingByDefault
3841
abstract class MakeReleaseNotesTask : DefaultTask() {
3942
@get:InputFile abstract val changelogFile: RegularFileProperty
4043

@@ -82,8 +85,11 @@ abstract class MakeReleaseNotesTask : DefaultTask() {
8285
val unreleased = changelog.releases.first()
8386
val version = project.version.toString()
8487

88+
if (!project.firebaseLibrary.publishJavadoc)
89+
throw StopActionException("No release notes required for ${project.name}")
90+
8591
if (!unreleased.hasContent())
86-
throw StopActionException("No changes to release for project: ${project.name}")
92+
throw GradleException("Missing release notes for \"${project.name}\"")
8793

8894
val versionClassifier = version.replace(".", "-")
8995

0 commit comments

Comments
 (0)