Skip to content

Commit 30f4a1b

Browse files
mroberkaibolay
andauthored
Open source the Firebase build tools (#7670)
See main...feature/openSourceBuildTools for the details Feature for: - #2845 - #1350 --------- Co-authored-by: Kai Bolay <kbolay@google.com>
1 parent 8bd67ff commit 30f4a1b

File tree

388 files changed

+34827
-0
lines changed

Some content is hidden

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

388 files changed

+34827
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Create release (build tools)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
product:
7+
description: Which product to make a release of ?
8+
required: true
9+
type: choice
10+
options:
11+
- app-distribution
12+
- crashlytics
13+
- performance
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
ARTIFACTS: ${{ github.workspace }}/build/artifacts
20+
21+
jobs:
22+
make-app-distribution-release:
23+
runs-on: ubuntu-latest
24+
if: inputs.product == 'app-distribution'
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- name: Set up JDK 17
29+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
30+
with:
31+
java-version: 17
32+
distribution: temurin
33+
cache: gradle
34+
- name: Make release for Firebase App Distribution
35+
run: |
36+
./gradlew \
37+
-Dorg.gradle.project.buildDir=${ARTIFACTS} \
38+
-Dmaven.repo.local=${ARTIFACTS} \
39+
:firebase-appdistribution-gradle:publishToMavenLocal
40+
cd ${ARTIFACTS}
41+
zip -r m2repository.zip com
42+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
43+
with:
44+
name: artifacts
45+
path: ${{ env.ARTIFACTS }}
46+
47+
make-crashlytics-release:
48+
runs-on: ubuntu-latest
49+
if: inputs.product == 'crashlytics'
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
- name: Set up JDK 17
54+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
55+
with:
56+
java-version: 17
57+
distribution: temurin
58+
cache: gradle
59+
- name: Make release for Firebase Crashlytics
60+
run: |
61+
./gradlew \
62+
-Dorg.gradle.project.buildDir=${ARTIFACTS} \
63+
-Dmaven.repo.local=${ARTIFACTS} \
64+
:firebase-crashlytics-buildtools:publishToMavenLocal
65+
./gradlew \
66+
-Dorg.gradle.project.buildDir=${ARTIFACTS} \
67+
-Dmaven.repo.local=${ARTIFACTS} \
68+
:firebase-crashlytics-gradle:publishToMavenLocal
69+
cd ${ARTIFACTS}
70+
zip -r m2repository.zip com
71+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
72+
with:
73+
name: artifacts
74+
path: ${{ env.ARTIFACTS }}
75+
76+
make-performance-release:
77+
runs-on: ubuntu-latest
78+
if: inputs.product == 'performance'
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82+
- name: Set up JDK 17
83+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
84+
with:
85+
java-version: 17
86+
distribution: temurin
87+
cache: gradle
88+
- name: Make release for Firebase Performance
89+
run: |
90+
./gradlew \
91+
-Dorg.gradle.project.buildDir=${ARTIFACTS} \
92+
-Dmaven.repo.local=${ARTIFACTS} \
93+
:firebase-perf-gradle:publishToMavenLocal
94+
cd ${ARTIFACTS}
95+
zip -r m2repository.zip com
96+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
97+
with:
98+
name: artifacts
99+
path: ${{ env.ARTIFACTS }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Perf Gradle Compatibility Tests
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * *' # Run daily at 6 AM
6+
workflow_dispatch: # Allow manual triggering
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
performance-plugin:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
19+
with:
20+
java-version: 17
21+
distribution: temurin
22+
cache: gradle
23+
- name: Run tests
24+
id: tests
25+
run: |
26+
./gradlew \
27+
:firebase-perf-gradle:test --tests \
28+
"com.google.firebase.perf.plugin.transform.InstrumentationApiCompatTest.gradleBuildRunsInstrumentationForAllVariants_latestGradleAndAgp"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### App Distribution Gradle plugin version 5.2.1
2+
3+
* {{fixed}} Declare dependency on GoogleServices plugin
4+
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# App Distribution Gradle Plugin
2+
3+
This directory contains the source code for the
4+
[Firebase App Distribution Gradle Plugin](https://firebase.google.com/docs/app-distribution/android/distribute-gradle),
5+
which allows uploading distributions, enabling access for testers, and adding release notes.
6+
7+
---
8+
9+
## appdistribution-gradle
10+
11+
This subproject produces a Gradle Plugin which faciliates the use cases of
12+
appdistribution-buildtools for Android apps built with Gradle.
13+
14+
#### Build / Install
15+
16+
`./gradlew :firebase-appdistribution-gradle:publishToMavenLocal`
17+
18+
The produced local Maven artifact is "com.google.firebase:firebase-appdistribution-gradle".
19+
20+
#### Test
21+
22+
To run unit tests, run:
23+
24+
`./gradlew :firebase-appdistribution-gradle:test`
25+
26+
To run integration tests, run:
27+
28+
`./gradlew :firebase-appdistribution-gradle:integrationTest`
29+
30+
To test manually, add the plugin to your Android project
31+
32+
`apply plugin: 'com.google.firebase.appdistribution'`
33+
34+
## Release Process
35+
36+
1. Create a PR with the changes, and request a review to submit it to `main`. Add the changes in the
37+
`CHANGELOG.md`.
38+
2. Once the changes have been submitted to `main` they will be released along with the next Android
39+
SDK release.
40+
41+
### Building the Maven artifact
42+
43+
Make sure to bump the [version of the plugin](gradle.properties#L3).
44+
45+
Use the
46+
["Make Releases" GitHub Actions workflow](https://github.com/firebase/firebase-android-buildtools/actions/workflows/make-releases.yml)
47+
([source](../.github/workflows/make-releases.yml)) to produce maven artifacts. Please refer to the
48+
[GitHub Actions documentation](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow)
49+
on how to trigger the workflow manually. The `m2repository.zip` can be downloaded from the
50+
"Artifacts" section on the workflow execution page.
51+
52+
### Testing the artifact (optional)
53+
54+
Download the `m2repository.zip` artifact from GCS. Extract the contents of the zip file to a local
55+
directory. In the project-level Gradle file of a test app add the path to the local maven
56+
repository to the `repositories` block and
57+
`classpath 'com.google.firebase:firebase-appdistribution-gradle:x.y.z'`
58+
to the dependencies block.
59+
60+
```
61+
repositories {
62+
// ...
63+
64+
// Add path to gradle plugin local maven repository
65+
maven {
66+
url 'file://<path_to_gradle_plugin_maven_repo>'
67+
}
68+
}
69+
dependencies {
70+
// ...
71+
72+
// Add the pre version of the Gradle plugin
73+
classpath 'com.google.firebase:firebase-appdistribution-gradle:x.y.z'
74+
}
75+
```
76+
77+
Sync your project and validate by running an app distribution gradle
78+
command such as:
79+
80+
```
81+
./gradlew assembleDebug appDistributionUploadDebug
82+
```
83+

0 commit comments

Comments
 (0)