Skip to content

Update MakeReleaseNotes to crash if notes are missing. #5613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
package com.google.firebase.gradle.plugins

import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.StopActionException
import org.gradle.api.tasks.TaskAction
import org.gradle.work.DisableCachingByDefault

/**
* Creates the release notes for the given project.
Expand All @@ -35,6 +37,7 @@ import org.gradle.api.tasks.TaskAction
* changes to release
* @see make
*/
@DisableCachingByDefault
abstract class MakeReleaseNotesTask : DefaultTask() {
@get:InputFile abstract val changelogFile: RegularFileProperty

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

if (!project.firebaseLibrary.publishJavadoc)
throw StopActionException("No release notes required for ${project.name}")

if (!unreleased.hasContent())
throw StopActionException("No changes to release for project: ${project.name}")
throw GradleException("Missing release notes for \"${project.name}\"")

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

Expand Down