Skip to content
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,33 @@
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.firebase.gradle.plugins

import org.gradle.api.DefaultTask
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction

abstract class CopyApiTask : DefaultTask() {
@get:InputFile abstract val apiTxtFile: RegularFileProperty
@get:OutputFile abstract val output: RegularFileProperty

@TaskAction
fun run() {
output.get().asFile.writeText(apiTxtFile.get().asFile.readText())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ class FirebaseAndroidLibraryPlugin : BaseFirebaseLibraryPlugin() {
.getLatestReleasedVersion()
)
}

project.tasks.register<CopyApiTask>("copyApiTxtFile") {
apiTxtFile.set(project.file("api.txt"))
output.set(project.file("previous_api.txt"))
}
}

private fun setupApiInformationAnalysis(project: Project, android: LibraryExtension) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ class FirebaseJavaLibraryPlugin : BaseFirebaseLibraryPlugin() {

dependsOn("copyPreviousArtifacts")
}

project.tasks.register<CopyApiTask>("copyApiTxtFile") {
apiTxtFile.set(project.file("api.txt"))
output.set(project.file("previous_api.txt"))
}
}

private fun setupApiInformationAnalysis(project: Project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ constructor(val project: Project, val type: LibraryType) {
val version: String
get() = project.version.toString()

val previousVersion: String
get() = project.properties["latestReleasedVersion"].toString()

val path: String = project.path

val runtimeClasspath: String =
Expand Down
Loading