Skip to content

Commit

Permalink
Internal
Browse files Browse the repository at this point in the history
FUTURE_COPYBARA_INTEGRATE_REVIEW=#2128 from android:settings_gradle f328a24
PiperOrigin-RevId: 602560158
  • Loading branch information
brettchabot authored and copybara-androidxtest committed Jan 30, 2024
1 parent 761f92f commit c0addf2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 48 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:
key: ${{ runner.os }}-${{ env.cache-version }}-bazel-test-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.cache-version }}-bazel-test-
- name: Run Robolectric tests
run: bazelisk test --test_tag_filters=robolectric --build_tag_filters=robolectric --test_output=all ...
- name: Run Robolectric tests and fast tagged tests
run: bazelisk test --test_tag_filters=robolectric,fast --build_tag_filters=robolectric,fast --test_output=all ...
shell: bash
- name: 'Clean bazel cache'
# Don't cache the bazel/external directory, since it can be > 2GB
Expand Down Expand Up @@ -131,4 +131,3 @@ jobs:
name: test-reports
path: gradle-tests/**/build/reports/androidTests/


12 changes: 11 additions & 1 deletion tools/release/BUILD → gradle-tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load(
"//build_extensions:axt_versions.bzl",
"ANDROIDX_JUNIT_VERSION",
Expand Down Expand Up @@ -33,13 +34,22 @@ expand_template(
"{RULES_VERSION}": RULES_VERSION,
"{RUNNER_VERSION}": RUNNER_VERSION,
"{SERVICES_VERSION}": SERVICES_VERSION,
"{MODIFY_WARNING}": "// This file is auto-generated from tools/release/validation_and_propagate_versions.sh\n// DO NOT MODIFY locally",
},
template = "settings.gradle.template",
)

genrule(
name = "update_settings_gradle_rule",
srcs = [":update_settings_gradle"],
outs = ["settings.gradle"],
outs = ["settings.gradle.generated"],
cmd = "cp $(location :update_settings_gradle) \"$@\"",
)

diff_test(
name = "settings_gradle_diff_test",
file1 = "settings.gradle",
file2 = ":settings.gradle.generated",
failure_message = "Unexpected diff detected in settings.gradle. Have you run tools/release/validate_and_propagate_versions.sh?",
tags = ["fast"],
)
3 changes: 3 additions & 0 deletions gradle-tests/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is auto-generated from tools/release/validation_and_propagate_versions.sh
// DO NOT MODIFY locally

pluginManagement {
repositories {
gradlePluginPortal()
Expand Down
41 changes: 0 additions & 41 deletions gradle-tests/settings.gradle.previous

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{MODIFY_WARNING}

pluginManagement {
repositories {
gradlePluginPortal()
Expand Down Expand Up @@ -36,7 +38,6 @@ include ':runner'
include ':espresso'
include ':espresso:accessibility'
include ':espresso:contrib'
include ':espresso-device'
include ':espresso:idling_resource'
include ':espresso:web'
include ':orchestrator'
4 changes: 2 additions & 2 deletions tools/release/validate_and_propagate_versions.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ OUTPUT=`bazelisk run //tools/release/java/androidx/test/tools/releaseupdater:rel
if [[ ! -z "$OUTPUT" ]]; then
echo $OUTPUT | xargs buildozer
fi
bazelisk build //tools/release:update_settings_gradle_rule
cp bazel-bin/tools/release/settings.gradle gradle-tests/settings.gradle
bazelisk build //gradle-tests:update_settings_gradle_rule
cp bazel-bin/gradle-tests/settings.gradle.generated gradle-tests/settings.gradle

0 comments on commit c0addf2

Please sign in to comment.