Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -23,7 +23,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{app_check}} Debug Testing")
versionName.set("appcheck-debug-testing")
hasKTX.set(false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{app_check}} Debug")
versionName.set("appcheck-debug")
hasKTX.set(false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{app_check}} Play integrity")
versionName.set("appcheck-playintegrity")
hasKTX.set(false)
}
}

Expand Down
1 change: 0 additions & 1 deletion firebase-abt/firebase-abt.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{ab_testing}}")
versionName.set("ab_testing")
hasKTX.set(false)
}
}

Expand Down
1 change: 0 additions & 1 deletion firebase-ai/firebase-ai.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{firebase_ai_logic}}")
versionName.set("ai")
hasKTX.set(false)
}
}

Expand Down
1 change: 0 additions & 1 deletion firebase-appdistribution/firebase-appdistribution.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{appdistro}}")
versionName.set("app-distro")
hasKTX.set(false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ firebaseLibrary {
releaseNotes {
name.set("Dynamic feature modules support")
versionName.set("dynamic-feature-modules-support")
hasKTX.set(false)
}
}

Expand Down
1 change: 0 additions & 1 deletion firebase-crashlytics-ndk/firebase-crashlytics-ndk.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{crashlytics}} NDK")
versionName.set("crashlytics-ndk")
hasKTX.set(false)
}
testLab.enabled = true
publishJavadoc = false
Expand Down
1 change: 0 additions & 1 deletion firebase-dataconnect/firebase-dataconnect.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{data_connect_short}}")
versionName.set("data-connect")
hasKTX.set(false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ firebaseLibrary {
releaseNotes {
name.set("Cloud Messaging Direct Boot")
versionName.set("messaging-directboot")
hasKTX.set(false)
}
}

Expand Down
1 change: 0 additions & 1 deletion firebase-sessions/firebase-sessions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ firebaseLibrary {

releaseNotes {
enabled = false
hasKTX = false
}
}

Expand Down
1 change: 0 additions & 1 deletion firebase-vertexai/firebase-vertexai.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ firebaseLibrary {
releaseNotes {
name.set("{{vertex_ai_in_firebase}}")
versionName.set("vertex-ai")
hasKTX.set(false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ abstract class BaseFirebaseLibraryPlugin : Plugin<Project> {

releaseNotes {
enabled.convention(true)
hasKTX.convention(true)
artifactId.convention(project.name)
artifactName.convention(project.name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,10 @@ abstract class MakeReleaseNotesTask : DefaultTask() {
.trimMargin()
.trim()

val ktxReleaseNotes =
"""
|#### ${config.name.get()} Kotlin extensions version $version {: #${config.versionName.get()}-ktx_v$versionClassifier}
|
|${unreleased.ktx?.toReleaseNotes() ?: KTXTransitiveReleaseText(project.name)}
"""
.trimMargin()
.trim()
.takeIf { config.hasKTX.get() }

val releaseNotes =
"""
|$baseReleaseNotes
|
|${ktxReleaseNotes.orEmpty()}
"""
.trimMargin()
.trim()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,7 @@ abstract class MoveUnreleasedChangesTask : DefaultTask() {
if (!unreleased.hasContent())
throw StopActionException("No changes to move for project: ${project.name}")

return unreleased.copy(version = releaseVersion.get(), ktx = createEntryForKTX(unreleased))
}

/**
* Creates the [ReleaseEntry.ktx] for a new release.
*
* Ensures the entry is only created if the library has a KTX lib to begin with, and adds template
* subtext if it lacks any changes.
*
* @see ReleaseNotesConfigurationExtension
* @see KTXTransitiveReleaseText
*/
private fun createEntryForKTX(release: ReleaseEntry): ReleaseContent? {
val releaseNotesConfig = project.firebaseLibrary.releaseNotes

val nonEmptyKTXContent = release.ktx?.takeIf { it.hasContent() }

val ktxContent =
nonEmptyKTXContent
?: ReleaseContent(
KTXTransitiveReleaseText(releaseNotesConfig.artifactName.get()),
emptyList(),
)

return ktxContent.takeIf { releaseNotesConfig.hasKTX.get() }
return unreleased.copy(version = releaseVersion.get())
}

private fun configure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import org.gradle.api.provider.Property
* @property enabled Whether to generate release notes for this library. Defaults to true.
* @property name The variable name mapping for this library, defined on G3.
* @property versionName The version name mapping for this library, defined on G3.
* @property hasKTX The library has a sub module with the suffix '-ktx' that releases alongside this
* library, and should have the transitive text added to the release notes. Defaults to true. Will
* likely be removed when we officially drop KTX libraries.
* @property artifactName The name of the generation artifact. _Only_ required if your project's
* name is different than your generated artifact name. Defaults to the project name.
* @see MakeReleaseNotesTask
Expand All @@ -40,6 +37,5 @@ abstract class ReleaseNotesConfigurationExtension {
abstract val enabled: Property<Boolean>
abstract val name: Property<String>
abstract val versionName: Property<String>
abstract val hasKTX: Property<Boolean>
abstract val artifactName: Property<String>
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ package com.google.firebase.gradle.plugins

import com.google.firebase.gradle.plugins.ChangeType.FIXED
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.collections.shouldBeEmpty
import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.collections.shouldHaveAtLeastSize
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNot
import io.kotest.matchers.shouldNotBe
import io.kotest.matchers.string.beEmpty
import io.kotest.matchers.string.shouldMatch
import java.io.File
import org.gradle.testkit.runner.GradleRunner
Expand Down Expand Up @@ -56,22 +52,6 @@ class MoveUnreleasedChangesTests : FunSpec() {
releasedEntry.ktx shouldBe ktxEntry
}

@Test
fun `Uses template text on KTX libs with no changes`() {
basicChangelog.releases.first().ktx shouldBe null

val newChangelog = buildWithChangelog(basicChangelog)
validateChangelog(basicChangelog, newChangelog)

val releasedEntry = newChangelog.releases[1]

releasedEntry.ktx shouldNotBe null
releasedEntry.ktx?.let {
it.subtext shouldNot beEmpty()
it.changes.shouldBeEmpty()
}
}

@Test
fun `Handles empty Unreleased sections`() {
val changelog = basicChangelog.replaceUnreleasedWith { ReleaseEntry.Empty }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ Note: We did some super cool stuff here!

* [removed] some stuff that we didn't really like got removed

## Kotlin
* [feature] Added
[`Query.dataObjects<T>()`](/docs/reference/kotlin/com/google/firebase/firestore/ktx/package-summary#dataObjects)
and
[`DocumentReference.dataObjects<T>()`](/docs/reference/kotlin/com/google/firebase/firestore/ktx/package-summary#dataObjects_1)
Kotlin Flows to listen for realtime updates and convert its values to a
specific type.

# 24.5.0
* [fixed] Fixed stack overflow caused by deeply nested server timestamps.
(GitHub [#4702](//github.com/firebase/firebase-android-sdk/issues/4702){: .external})
Expand Down
9 changes: 0 additions & 9 deletions plugins/src/test/resources/MakeReleaseNotes/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,3 @@ Note: We did some super cool stuff here!
* {{unchanged}} Idk ig we did some stuff

* {{removed}} some stuff that we didn't really like got removed

#### {{firebase_storage_full}} Kotlin extensions version 24.6.0 {: #storage-ktx_v24-6-0}

* {{feature}} Added
[`Query.dataObjects<T>()`](/docs/reference/kotlin/com/google/firebase/firestore/ktx/package-summary#dataObjects)
and
[`DocumentReference.dataObjects<T>()`](/docs/reference/kotlin/com/google/firebase/firestore/ktx/package-summary#dataObjects_1)
Kotlin Flows to listen for realtime updates and convert its values to a
specific type.
Loading