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
10 changes: 4 additions & 6 deletions .github/workflows/metalava-semver-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ jobs:
permissions:
pull-requests: write
steps:
- name: Checkout main
- name: Checkout PR
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.base_ref }}

- name: Set up JDK 17
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
Expand All @@ -21,13 +19,13 @@ jobs:
distribution: temurin
cache: gradle

- name: Copy previous api.txt files
- name: Copy new api.txt files
run: ./gradlew copyApiTxtFile

- name: Checkout PR
- name: Checkout main
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.head_ref }}
ref: ${{ github.base_ref }}
clean: false

- name: Run Metalava SemVer check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,12 @@ class FirebaseAndroidLibraryPlugin : BaseFirebaseLibraryPlugin() {

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

project.tasks.register<SemVerTask>("metalavaSemver") {
apiTxtFile.set(project.file("api.txt"))
otherApiFile.set(project.file("previous_api.txt"))
outputApiFile.set(project.file("opi.txt"))
apiTxtFile.set(project.file("new_api.txt"))
otherApiFile.set(project.file("api.txt"))
currentVersionString.value(firebaseLibrary.version)
previousVersionString.value(firebaseLibrary.previousVersion)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,12 @@ class FirebaseJavaLibraryPlugin : BaseFirebaseLibraryPlugin() {

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

project.tasks.register<SemVerTask>("metalavaSemver") {
apiTxtFile.set(project.file("api.txt"))
otherApiFile.set(project.file("previous_api.txt"))
outputApiFile.set(project.file("opi.txt"))
apiTxtFile.set(project.file("new_api.txt"))
otherApiFile.set(project.file("api.txt"))
currentVersionString.value(firebaseLibrary.version)
previousVersionString.value(firebaseLibrary.previousVersion)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction

abstract class SemVerTask : DefaultTask() {
Expand All @@ -33,7 +32,7 @@ abstract class SemVerTask : DefaultTask() {
@get:Input abstract val currentVersionString: Property<String>
@get:Input abstract val previousVersionString: Property<String>

@get:OutputFile abstract val outputApiFile: RegularFileProperty
// TODO cache output

@TaskAction
fun run() {
Expand Down
Loading