Skip to content

Commit 0a67ba1

Browse files
committed
Merge remote-tracking branch 'origin/master' into mila/BloomFilter
2 parents 6b22865 + 5c2b381 commit 0a67ba1

File tree

41 files changed

+780
-731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+780
-731
lines changed

.github/workflows/build-release-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Perform gradle build
2626
run: |
27-
./gradlew firebasePublish -PpublishConfigFilePath=release.cfg -PpublishMode=RELEASE
27+
./gradlew firebasePublish
2828
2929
- name: Generate release notes
3030
run: |

.github/workflows/check-head-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414

1515
- name: Perform gradle build
1616
run: |
17-
./gradlew checkHeadDependencies -PpublishConfigFilePath=release.cfg -PpublishMode=RELEASE
17+
./gradlew checkHeadDependencies

.github/workflows/create_releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
base: 'releases/${{ inputs.name }}'
4141
branch: 'releases/${{ inputs.name }}.release'
42-
add-paths: release.cfg,release_report.md
42+
add-paths: release.json,release_report.md
4343
title: '${{ inputs.name}} release'
4444
body: 'Auto-generated PR for release ${{ inputs.name}}'
4545
commit-message: 'Create release config for ${{ inputs.name }}'

.github/workflows/semver-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414

1515
- name: Perform gradle build
1616
run: |
17-
./gradlew semverCheckForRelease -PpublishConfigFilePath=release.cfg -PpublishMode=RELEASE
17+
./gradlew semverCheckForRelease

.github/workflows/validate-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414

1515
- name: Perform gradle build
1616
run: |
17-
./gradlew validatePomForRelease -PpublishConfigFilePath=release.cfg -PpublishMode=RELEASE
17+
./gradlew validatePomForRelease
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.0
2-
latestReleasedVersion=16.1.2
1+
version=17.0.1
2+
latestReleasedVersion=17.0.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.0
2-
latestReleasedVersion=16.1.2
1+
version=17.0.1
2+
latestReleasedVersion=17.0.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.0
2-
latestReleasedVersion=16.1.1
1+
version=17.0.1
2+
latestReleasedVersion=17.0.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.0
2-
latestReleasedVersion=16.1.2
1+
version=17.0.1
2+
latestReleasedVersion=17.0.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.0
2-
latestReleasedVersion=16.1.2
1+
version=17.0.1
2+
latestReleasedVersion=17.0.0

build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import com.google.firebase.gradle.plugins.license.LicenseResolverPlugin
16-
import com.google.firebase.gradle.MultiProjectReleasePlugin
17-
1815
buildscript {
1916
// TODO: remove once all sdks have migrated to version catalog
2017
ext.kotlinVersion = libs.versions.kotlin.get()
@@ -58,11 +55,10 @@ ext {
5855
protobufJavaUtilVersion = libs.versions.protobufjavautil.get()
5956
}
6057

61-
apply plugin: com.google.firebase.gradle.plugins.publish.PublishingPlugin
6258
apply plugin: com.google.firebase.gradle.plugins.ci.ContinuousIntegrationPlugin
6359
apply plugin: com.google.firebase.gradle.plugins.ci.SmokeTestsPlugin
6460

65-
apply plugin: MultiProjectReleasePlugin
61+
apply plugin: com.google.firebase.gradle.plugins.PublishingPlugin
6662

6763
firebaseContinuousIntegration {
6864
ignorePaths = [

buildSrc/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
plugins {
1616
id("com.ncorti.ktfmt.gradle") version "0.11.0"
1717
id("com.github.sherter.google-java-format") version "0.9"
18+
kotlin("plugin.serialization") version "1.7.10"
1819
`kotlin-dsl`
1920
}
2021

@@ -67,6 +68,7 @@ dependencies {
6768

6869
implementation("org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r")
6970

71+
implementation(libs.kotlinx.serialization.json)
7072
implementation("com.google.code.gson:gson:2.8.9")
7173
implementation("com.android.tools.build:gradle:7.2.2")
7274
implementation("com.android.tools.build:builder-test-api:7.2.2")
@@ -90,7 +92,7 @@ gradlePlugin {
9092
}
9193
register("publishingPlugin") {
9294
id = "PublishingPlugin"
93-
implementationClass = "com.google.firebase.gradle.plugins.publish.PublishingPlugin"
95+
implementationClass = "com.google.firebase.gradle.plugins.PublishingPlugin"
9496
}
9597
register("firebaseLibraryPlugin") {
9698
id = "firebase-library"

buildSrc/src/main/java/com/google/firebase/gradle/MultiProjectReleasePlugin.java

Lines changed: 0 additions & 128 deletions
This file was deleted.

buildSrc/src/main/java/com/google/firebase/gradle/plugins/CheckHeadDependencies.kt

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,45 @@ import org.gradle.api.provider.ListProperty
2020
import org.gradle.api.tasks.Input
2121
import org.gradle.api.tasks.TaskAction
2222

23+
/**
24+
* Validates that all project level dependencies are in the release.
25+
*
26+
* Any releasing library that has a project level dependency on another library invokes the release
27+
* of said dependent libary. This is checked via the [artifactId]
28+
* [FirebaseLibraryExtension.artifactId], so that the check is version agnostic.
29+
*
30+
* @throws GradleException if any project level dependencies are found that are not included in the
31+
* release
32+
*/
2333
abstract class CheckHeadDependencies : DefaultTask() {
2434
@get:Input abstract val projectsToPublish: ListProperty<FirebaseLibraryExtension>
2535

26-
@get:Input abstract val allFirebaseProjects: ListProperty<String>
27-
2836
@TaskAction
2937
fun run() {
30-
val projectsReleasing: Set<String> = projectsToPublish.get().map { it.artifactId.get() }.toSet()
38+
val projectsReleasing = computeProjectsReleasing()
39+
3140
val errors =
3241
projectsToPublish
3342
.get()
34-
.associate {
35-
it.artifactId.get() to
36-
it
37-
.projectDependenciesByName()
38-
.intersect(allFirebaseProjects.get())
39-
.subtract(projectsReleasing)
40-
.subtract(DEPENDENCIES_TO_IGNORE)
41-
}
43+
.associate { it.artifactId.get() to it.projectLevelDepsAsArtifactIds() - projectsReleasing }
4244
.filterValues { it.isNotEmpty() }
4345
.map { "${it.key} requires: ${it.value.joinToString(", ") }" }
4446

4547
if (errors.isNotEmpty()) {
4648
throw GradleException(
47-
"Project-level dependency errors found. Please update the release config.\n${
48-
errors.joinToString(
49-
"\n"
50-
)
51-
}"
49+
"Project-level dependency errors found. Please update the release config.\n" +
50+
"${errors.joinToString("\n")}"
5251
)
5352
}
5453
}
5554

56-
private fun FirebaseLibraryExtension.projectDependenciesByName() =
55+
private fun FirebaseLibraryExtension.projectLevelDepsAsArtifactIds() =
5756
resolveProjectLevelDependencies().map { it.artifactId.get() }
5857

58+
private fun computeProjectsReleasing() =
59+
projectsToPublish.get().map { it.artifactId.get() } + DEPENDENCIES_TO_IGNORE
60+
5961
companion object {
60-
val DEPENDENCIES_TO_IGNORE: List<String> = listOf("protolite-well-known-types")
62+
val DEPENDENCIES_TO_IGNORE = listOf("protolite-well-known-types")
6163
}
6264
}

buildSrc/src/main/java/com/google/firebase/gradle/plugins/DackkaPlugin.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ abstract class DackkaPlugin : Plugin<Project> {
134134

135135
kotlinDoc.configure {
136136
dependsOn(generateDocumentation, firesiteTransform, copyDocsToCommonDirectory)
137+
138+
outputs.dir(copyDocsToCommonDirectory.map { it.destinationDir })
137139
}
138140
}
139141
}

buildSrc/src/main/java/com/google/firebase/gradle/plugins/GmavenHelper.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import javax.xml.parsers.DocumentBuilder
2020
import javax.xml.parsers.DocumentBuilderFactory
2121
import org.w3c.dom.Document
2222

23+
/** TODO(b/279466888) - Make GmavenHelper testable */
2324
class GmavenHelper(val groupId: String, val artifactId: String) {
2425
val GMAVEN_ROOT = "https://dl.google.com/dl/android/maven2"
2526

buildSrc/src/main/java/com/google/firebase/gradle/plugins/GradleUtils.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package com.google.firebase.gradle.plugins
1616

1717
import java.io.File
18+
import org.gradle.api.DefaultTask
1819
import org.gradle.api.Project
1920
import org.gradle.api.artifacts.Dependency
2021
import org.gradle.api.attributes.Attribute
@@ -24,6 +25,7 @@ import org.gradle.kotlin.dsl.apply
2425
import org.gradle.workers.WorkAction
2526
import org.gradle.workers.WorkParameters
2627
import org.gradle.workers.WorkQueue
28+
import org.jetbrains.kotlin.gradle.utils.provider
2729

2830
/**
2931
* Creates a file at the buildDir for the given [Project].
@@ -45,6 +47,25 @@ fun Project.fileFromBuildDir(path: String) = file("$buildDir/$path")
4547
*/
4648
fun Provider<File>.childFile(path: String) = map { File("${it.path}/$path") }
4749

50+
/**
51+
* Returns a new [File] under the given sub directory.
52+
*
53+
* Syntax sugar for:
54+
* ```
55+
* File("$path/$childPath")
56+
* ```
57+
*/
58+
fun File.childFile(childPath: String) = File("$path/$childPath")
59+
60+
/**
61+
* Provides a temporary file for use during the task.
62+
*
63+
* Creates a file under the [temporaryDir][DefaultTask.getTemporaryDir] of the task, and should be
64+
* preferred to defining an explicit [File]. This will allow Gradle to make better optimizations on
65+
* our part, and helps us avoid edge-case scenarios like conflicting file names.
66+
*/
67+
fun DefaultTask.tempFile(path: String) = provider { temporaryDir.childFile(path) }
68+
4869
/**
4970
* Returns a list of children files, or an empty list if this [File] doesn't exist or doesn't have
5071
* any children.

0 commit comments

Comments
 (0)