From 243a275af7f5e15a009050560901fb03735ddbde Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 22:15:10 +0000 Subject: [PATCH] Fix: Make metalavaSemver depend on copyApiTxtFile Explicitly wire the output of the copyApiTxtFile task (new_api.txt) to the input of the metalavaSemver task, ensuring the file is present before metalavaSemver runs. --- .../gradle/plugins/FirebaseAndroidLibraryPlugin.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/src/main/java/com/google/firebase/gradle/plugins/FirebaseAndroidLibraryPlugin.kt b/plugins/src/main/java/com/google/firebase/gradle/plugins/FirebaseAndroidLibraryPlugin.kt index 8f4563e3107..e253525eca3 100644 --- a/plugins/src/main/java/com/google/firebase/gradle/plugins/FirebaseAndroidLibraryPlugin.kt +++ b/plugins/src/main/java/com/google/firebase/gradle/plugins/FirebaseAndroidLibraryPlugin.kt @@ -161,13 +161,14 @@ class FirebaseAndroidLibraryPlugin : BaseFirebaseLibraryPlugin() { ) } - project.tasks.register("copyApiTxtFile") { - apiTxtFile.set(project.file("api.txt")) - output.set(project.file("new_api.txt")) - } + val copyApiTxtFileTask = + project.tasks.register("copyApiTxtFile") { + apiTxtFile.set(project.file("api.txt")) + output.set(project.file("new_api.txt")) + } project.tasks.register("metalavaSemver") { - apiTxtFile.set(project.file("new_api.txt")) + apiTxtFile.set(copyApiTxtFileTask.flatMap { it.output }) otherApiFile.set(project.file("api.txt")) currentVersionString.value(firebaseLibrary.version) previousVersionString.value(firebaseLibrary.previousVersion)