Skip to content

Commit 9579d3f

Browse files
make target to populate gradle-tests/settings.gradle off of build-extensions/axt_versions.bzl
PiperOrigin-RevId: 599542567
1 parent 1ae53b9 commit 9579d3f

File tree

4 files changed

+110
-1
lines changed

4 files changed

+110
-1
lines changed

build_extensions/axt_versions.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
"""Defines next to be released AXT versions."""
1+
"""Defines next to be released AXT versions.
2+
3+
Use tools/release/validate_and_propagate_versions.sh to propagate these versions to
4+
//:axt_m2_repository and gradle-tests/settings.gradle
5+
"""
26

37
RUNNER_VERSION = "1.6.0-alpha06"
48
RULES_VERSION = "1.6.0-alpha03"

tools/release/BUILD

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
2+
load(
3+
"//build_extensions:axt_versions.bzl",
4+
"ANDROIDX_JUNIT_VERSION",
5+
"ANDROIDX_TRUTH_VERSION",
6+
"ANNOTATION_VERSION",
7+
"CORE_VERSION",
8+
"ESPRESSO_VERSION",
9+
"MONITOR_VERSION",
10+
"ORCHESTRATOR_VERSION",
11+
"RULES_VERSION",
12+
"RUNNER_VERSION",
13+
"SERVICES_VERSION",
14+
)
15+
16+
package(
17+
default_visibility = [
18+
"//:__subpackages__",
19+
],
20+
)
21+
22+
expand_template(
23+
name = "update_settings_gradle",
24+
out = "settings.gradle.out",
25+
substitutions = {
26+
"{ANDROIDX_JUNIT_VERSION}": ANDROIDX_JUNIT_VERSION,
27+
"{ANDROIDX_TRUTH_VERSION}": ANDROIDX_TRUTH_VERSION,
28+
"{ANNOTATION_VERSION}": ANNOTATION_VERSION,
29+
"{CORE_VERSION}": CORE_VERSION,
30+
"{ESPRESSO_VERSION}": ESPRESSO_VERSION,
31+
"{MONITOR_VERSION}": MONITOR_VERSION,
32+
"{ORCHESTRATOR_VERSION}": ORCHESTRATOR_VERSION,
33+
"{RULES_VERSION}": RULES_VERSION,
34+
"{RUNNER_VERSION}": RUNNER_VERSION,
35+
"{SERVICES_VERSION}": SERVICES_VERSION,
36+
},
37+
template = "settings.gradle.template",
38+
)
39+
40+
genrule(
41+
name = "update_settings_gradle_rule",
42+
srcs = [":update_settings_gradle"],
43+
outs = ["settings.gradle"],
44+
cmd = "cp $(location :update_settings_gradle) \"$@\"",
45+
)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
google()
5+
mavenCentral()
6+
mavenLocal()
7+
}
8+
}
9+
dependencyResolutionManagement {
10+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11+
repositories {
12+
google()
13+
mavenCentral()
14+
mavenLocal()
15+
}
16+
versionCatalogs {
17+
libs {
18+
library('core', 'androidx.test:core:{CORE_VERSION}')
19+
library('runner', 'androidx.test:runner:{RUNNER_VERSION}')
20+
library('ext.junit', 'androidx.test.ext:junit:{ANDROIDX_JUNIT_VERSION}')
21+
library('ext.truth', 'androidx.test.ext:truth:{ANDROIDX_TRUTH_VERSION}')
22+
library('espresso.accessibility', 'androidx.test.espresso:espresso-accessibility:{ESPRESSO_VERSION}')
23+
library('espresso.contrib', 'androidx.test.espresso:espresso-contrib:{ESPRESSO_VERSION}')
24+
library('espresso.core', 'androidx.test.espresso:espresso-core:{ESPRESSO_VERSION}')
25+
library('espresso.idlingresource', 'androidx.test.espresso:espresso-idling-resource:{ESPRESSO_VERSION}')
26+
library('espresso.intents', 'androidx.test.espresso:espresso-intents:{ESPRESSO_VERSION}')
27+
library('espresso.web', 'androidx.test.espresso:espresso-web:{ESPRESSO_VERSION}')
28+
library('orchestrator', 'androidx.test:orchestrator:{ORCHESTRATOR_VERSION}')
29+
30+
}
31+
}
32+
}
33+
34+
rootProject.name = "Gradle Tests"
35+
include ':runner'
36+
include ':espresso'
37+
include ':espresso:accessibility'
38+
include ':espresso:contrib'
39+
include ':espresso-device'
40+
include ':espresso:idling_resource'
41+
include ':espresso:web'
42+
include ':orchestrator'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
#
3+
# This script will do the following:
4+
#
5+
# 1) Validate that the version numbers in axt_versions.bzl were incremented
6+
# correctly
7+
# 2) Update //:axt_m2repository based off of axt_versions.bzl
8+
# 3) Update gradle-tests/settings.gradle using axt_versions.bzl
9+
#
10+
# To run, execute this script from the repository root:
11+
#
12+
# cd $REPOSITORY_ROOT
13+
# bash tools/release/validate_and_propagate_versions.sh
14+
#
15+
16+
bazelisk run //tools/release/java/androidx/test/tools/releaseupdater:releaseupdater | xargs buildozer
17+
bazelisk build //tools/release:update_settings_gradle_rule
18+
cp bazel-bin/tools/release/settings.gradle gradle-tests/settings.gradle

0 commit comments

Comments
 (0)