Skip to content

Commit

Permalink
Migrate to composite plugin (#6608)
Browse files Browse the repository at this point in the history
Per [b/384990125](https://b.corp.google.com/issues/384990125),

This migrates all of our `buildSrc` logic into a composite plugin called
`plugins`.

This PR makes no attempt to organize the code; that is out-of-scope for
the PR.

This PR also fixes various references to `buildSrc` (including markdown
links), to avoid any breakage.
  • Loading branch information
daymxn authored Dec 19, 2024
1 parent 49a637f commit c7eb32a
Show file tree
Hide file tree
Showing 98 changed files with 178 additions and 177 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Check buildSrc
name: Check plugins

on:
pull_request:
paths:
- 'buildSrc/**'
- 'plugins/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-src-check:
plugins-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
Expand All @@ -20,13 +20,13 @@ jobs:
java-version: 17
distribution: temurin
cache: gradle
- name: buildSrc Tests
- name: plugins tests
env:
FIREBASE_CI: 1
run: |
./gradlew -b buildSrc/build.gradle.kts -PenablePluginTests=true check
./gradlew plugins:check
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@82082dac68ad6a19d980f8ce817e108b9f496c2a
with:
files: "**/build/test-results/**/*.xml"
check_name: "buildSrc Test Results"
check_name: "plugins test results"
98 changes: 49 additions & 49 deletions .github/workflows/release-note-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,59 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: Create output file
run: touch changelog_comment.md
- name: Create output file
run: touch changelog_comment.md

- name: Get changed changelog files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
with:
files_ignore: |
buildSrc/**
files: |
**/CHANGELOG.md
- name: Get changed changelog files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
with:
files_ignore: |
plugins/**
files: |
**/CHANGELOG.md
- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Set up Python 3.10
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
with:
python-version: '3.10'
- name: Set up Python 3.10
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
with:
python-version: '3.10'

- name: Set up fireci
id: install-fireci
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: pip3 install -e ci/fireci
- name: Set up fireci
id: install-fireci
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: pip3 install -e ci/fireci

- name: Generate comment
id: generate-comment
if: ${{ steps.install-fireci.outcome == 'success' }}
run: |
fireci changelog_comment -c "${{ steps.changed-files.outputs.all_changed_files }}" -o ./changelog_comment.md
- name: Generate comment
id: generate-comment
if: ${{ steps.install-fireci.outcome == 'success' }}
run: |
fireci changelog_comment -c "${{ steps.changed-files.outputs.all_changed_files }}" -o ./changelog_comment.md
- name: Add PR Comment
uses: mshick/add-pr-comment@v2.8.1
continue-on-error: true
with:
status: ${{ steps.generate-comment.outcome }}
message-path: ./changelog_comment.md
message-skipped: |
## Release note changes
No release note changes were detected. If you made changes that should be
present in the next release, ensure you've added an entry in the appropriate
`CHANGELOG.md` file(s).
message-failure: |
## Release note changes
A `CHANGELOG.md` file seems to not match the expected format.
Please ensure your changelog files are following the format as
defined in [our documentation](#).
- name: Add PR Comment
uses: mshick/add-pr-comment@v2.8.1
continue-on-error: true
with:
status: ${{ steps.generate-comment.outcome }}
message-path: ./changelog_comment.md
message-skipped: |
## Release note changes
No release note changes were detected. If you made changes that should be
present in the next release, ensure you've added an entry in the appropriate
`CHANGELOG.md` file(s).
message-failure: |
## Release note changes
A `CHANGELOG.md` file seems to not match the expected format.
Please ensure your changelog files are following the format as
defined in [our documentation](#).
115 changes: 0 additions & 115 deletions buildSrc/build.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion ci/danger/Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ has_changelog_changes = hasChangesIn(["CHANGELOG"])
# Ignore changes in these directories
$exclude_directories = [
'.github/',
'buildSrc/',
'plugins/',
'ci/',
'encoders/',
'firebase-annotations/',
Expand Down
4 changes: 2 additions & 2 deletions contributor-docs/onboarding/new_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ subdirectory with its respective build file(s).

```bash
firebase-android-sdk
├── buildSrc
├── plugins
├── appcheck
│ └── firebase-appcheck
│ └── firebase-appcheck-playintegrity
Expand All @@ -45,7 +45,7 @@ Note that the build file name for any given SDK is not `build.gradle` or `build.
but rather mirrors the name of the sdk, e.g.
`firebase-common/firebase-common.gradle` or `firebase-common/firebase-common.gradle.kts`.

All of the core Gradle build logic lives in `buildSrc` and is used by all
All of the core Gradle build logic lives in `plugins` and is used by all
SDKs.

SDKs can be grouped together for convenience by placing them in a directory of
Expand Down
2 changes: 1 addition & 1 deletion firebase-perf/dev-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ firebase-android-sdk$ ./gradlew :firebase-perf:dev-app:devicecheck
There are differences in terms of Firebase projects when running this command in different scenarios.

1. **CI Run**: These tests are run under Firebase Test Lab of the unified Firebase project
(according to [this](https://github.com/firebase/firebase-android-sdk/blob/main/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.java))
(according to [this](https://github.com/firebase/firebase-android-sdk/blob/main/plugins/src/main/java/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.java))
but the performance events are sent to a different project with which apps are configured with
(see `copyRootGoogleServices` task).

Expand Down
2 changes: 1 addition & 1 deletion firebase-perf/e2e-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ firebase-android-sdk$ ./gradlew :firebase-perf:e2e-app:devicecheck
There are differences in terms of Firebase projects when running this command in different scenarios.

1. **CI Run**: These tests are run under Firebase Test Lab of the unified Firebase project
(according to [this](https://github.com/firebase/firebase-android-sdk/blob/main/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.java))
(according to [this](https://github.com/firebase/firebase-android-sdk/blob/main/plugins/src/main/java/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.java))
but the performance events are sent to a different project with which apps are configured with
(see `copyRootGoogleServices` task)
and the Prow Configuration in tg/831643).
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/README.md → plugins/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Build Source
## Plugins

> [!NOTE]
> Eventually, this will be merged with our [contributor documentation](https://firebase.github.io/firebase-android-sdk/).
Expand Down
Loading

0 comments on commit c7eb32a

Please sign in to comment.