Skip to content

Commit

Permalink
Fix mobile-install tool assignments
Browse files Browse the repository at this point in the history
* zipalign and aapt2 are multi-file in OSS land (@AndroidSDK)
* Add the alias for dexbuilder.
* Adds a presubmit test for `bazel mobile-install :app -- --nodeploy`

Part of #12

PiperOrigin-RevId: 605356366
Change-Id: I57824df1b16eb986b694a4d312fc20b959a7db64
  • Loading branch information
ted-xie authored and copybara-github committed Feb 8, 2024
1 parent df9a3c2 commit 4d537b6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
14 changes: 14 additions & 0 deletions kokoro/presubmit/presubmit_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function main() {
"--verbose_failures"
"--experimental_google_legacy_api"
"--experimental_enable_android_migration_apis"
)

TEST_ARGS=(
"--build_tests_only"
"--test_output=errors"
)
Expand Down Expand Up @@ -132,6 +135,7 @@ function main() {
"$bazel" test \
"${COMMON_ARGS[@]}" \
"${TOOL_ARGS[@]}" \
"${TEST_ARGS[@]}" \
-- \
"${TOOL_TEST_TARGETS[@]}"

Expand All @@ -143,6 +147,7 @@ function main() {
"$bazel" test \
"${COMMON_ARGS[@]}" \
"${RULE_ARGS[@]}" \
"${TEST_ARGS[@]}" \
-- \
"${RULE_TEST_TARGETS[@]}"

Expand All @@ -153,6 +158,15 @@ function main() {
"${RULE_ARGS[@]}" \
-- \
//java/com/basicapp:basic_app

# Mobile-install test with no deployment
"$bazel" mobile-install \
"${COMMON_ARGS[@]}" \
"${RULE_ARGS[@]}" \
-- \
//java/com/basicapp:basic_app \
--nodeploy

}

main
4 changes: 2 additions & 2 deletions mobile_install/tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TOOL_ATTRS = dict(
default = Label(
"@androidsdk//:aapt2_binary",
),
allow_single_file = True,
allow_files = True,
cfg = "exec",
executable = True,
),
Expand Down Expand Up @@ -119,7 +119,7 @@ TOOL_ATTRS = dict(
default = Label(
"@androidsdk//:zipalign_binary",
),
allow_single_file = True,
allow_files = True,
cfg = "exec",
executable = True,
),
Expand Down
15 changes: 13 additions & 2 deletions tools/android/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ alias(

alias(
name = "desugared_java8_legacy_apis",
actual = ":gen_fail", # TODO(#122): Fix library desugaring
actual = ":gen_fail", # TODO(#122): Fix library desugaring
visibility = ["//visibility:public"],
)

Expand All @@ -73,7 +73,6 @@ java_binary(
runtime_deps = ["@android_gmaven_r8//jar"],
)


java_binary(
name = "r8",
main_class = "com.android.tools.r8.R8",
Expand All @@ -87,3 +86,15 @@ java_binary(
visibility = ["//visibility:public"],
runtime_deps = ["@rules_android_maven//:com_android_tools_build_gradle"],
)

alias(
name = "dexbuilder",
actual = "@bazel_tools//tools/android:dexbuilder",
visibility = ["//visibility:public"],
)

alias(
name = "dexmerger",
actual = "@bazel_tools//tools/android:dexmerger",
visibility = ["//visibility:public"],
)

0 comments on commit 4d537b6

Please sign in to comment.