diff --git a/README.md b/README.md index a75583f84bf..47679854cfe 100644 --- a/README.md +++ b/README.md @@ -225,13 +225,14 @@ strategy](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Resolutio ### Commands -The simplest way to publish a project and all its associated dependencies is to -just publish all projects. The following command builds SNAPSHOT dependencies of -all projects. All pom level dependencies within the published artifacts will -also point to SNAPSHOT versions that are co-published. +For more advanced use cases where developers wish to make changes to a project, +but have transitive dependencies point to publicly released versions, individual +projects may be published as follows. ```bash -./gradlew publishAllToLocal +# e.g. to publish Firestore and Functions +./gradlew -PprojectsToPublish="firebase-firestore,firebase-functions" \ + publishReleasingLibrariesToMavenLocal ``` Developers may take a dependency on these locally published versions by adding @@ -239,16 +240,6 @@ the `mavenLocal()` repository to your [repositories block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in your app module's build.gradle. -For more advanced use cases where developers wish to make changes to a project, -but have transitive dependencies point to publicly released versions, individual -projects may be published as follows. - -```bash -# e.g. to publish Firestore and Functions -./gradlew -PprojectsToPublish=":firebase-firestore,:firebase-functions" \ - publishProjectsToMavenLocal -``` - ### Code Formatting #### Java diff --git a/buildSrc/README.md b/buildSrc/README.md index 126208a2d88..bc32b0f0449 100644 --- a/buildSrc/README.md +++ b/buildSrc/README.md @@ -1,5 +1,8 @@ ## Build Source +> [!NOTE] +> Eventually, this will be merged with our [contributor documentation](https://firebase.github.io/firebase-android-sdk/). + This file will be more organized as time progresses. Because a lot of our plugins and systems require a moderate amount of cognitive overhead to understand, I thought it best to provide documentation for such systems. You can find the diff --git a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt index 45b9b659f6b..db433a1263a 100644 --- a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt +++ b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt @@ -191,9 +191,9 @@ abstract class PublishingPlugin : Plugin { allFirebaseLibraries: List ): ReleaseMetadata? { val projectsToPublish = project.provideProperty("projectsToPublish").orNull - val releaseName = project.provideProperty("releaseName").orNull + val releaseName = project.provideProperty("releaseName").orNull ?: "NO_NAME" - if (projectsToPublish == null || releaseName == null) return null + if (projectsToPublish == null) return null val projectNames = projectsToPublish.split(",") val librariesToRelease = diff --git a/firebase-firestore/README.md b/firebase-firestore/README.md index 96e65172615..b05694bd4a7 100644 --- a/firebase-firestore/README.md +++ b/firebase-firestore/README.md @@ -99,15 +99,10 @@ from within Android Studio. ## Build Local Jar of Firestore SDK -Run: ```bash -./gradlew publishAllToLocal +./gradlew -PprojectsToPublish="firebase-firestore" publishReleasingLibrariesToMavenLocal ``` -This will publish firebase SDK at SNAPSHOT versions. All pom level dependencies -within the published artifacts will also point to SNAPSHOT versions that are -co-published. The results will be built into your local maven repo. - Developers may then take a dependency on these locally published versions by adding the `mavenLocal()` repository to your [repositories block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in diff --git a/firebase-perf/README.md b/firebase-perf/README.md index c7662aebb45..ee8b7186fb1 100644 --- a/firebase-perf/README.md +++ b/firebase-perf/README.md @@ -84,28 +84,38 @@ firebase-android-sdk$ ./gradlew :firebase-perf:deviceCheck ### Creating a Release Candidate -``` -firebase-android-sdk$ ./gradlew -PpublishMode=SNAPSHOT -PprojectsToPublish="firebase-perf" firebasePublish -``` +Change the version field in `gradle.properties` to reflect the RC status: -### Publish project locally +```properties +version=20.4.1-SNAPSHOT +``` -The simplest way to publish a project and all its associated dependencies is to just publish all -projects. The following command builds **SNAPSHOT** dependencies of all projects. All pom level -dependencies within the published artifacts will also point to SNAPSHOT versions that are -co-published. +And then generate the library with required libraries: -``` -firebase-android-sdk$ ./gradlew publishAllToLocal +```bash +# firebase-perf requires firebase-sessions +./gradlew -PprojectsToPublish="firebase-perf,firebase-sessions" firebasePublish ``` -Alternative, publish `firebase-perf` only: +This will generate various files in the root build directory that align with +the release candidates. +Alternatively, you can just build the repository in isolation: +```bash +# firebase-perf requires firebase-sessions +./gradlew -PprojectsToPublish="firebase-perf,firebase-sessions" buildMavenZip ``` -firebase-android-sdk$ ./gradlew -PprojectsToPublish=":firebase-perf" publishProjectsToMavenLocal -``` -The location of published project `~/.m2/repository/com/google/firebase/`. +### Publish project locally + +You can publish the project directly to your [local maven](https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:maven_local) +repository like so: + +```bash +# firebase-perf requires firebase-sessions +./gradlew -PprojectsToPublish="firebase-perf,firebase-sessions" \ + publishReleasingLibrariesToMavenLocal +``` ### Read SDK from mavenLocal()