Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions rules/android_sdk_repository/helper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,7 @@ def create_android_sdk_rules(
":windows": "build-tools/%s/aapt.exe" % build_tools_directory,
"//conditions:default": ":aapt_binary",
}),
aapt2 = select({
":windows": "build-tools/%s/aapt2.exe" % build_tools_directory,
"//conditions:default": ":aapt2_binary",
}),
aapt2 = ":aapt2",
adb = select({
":windows": "platform-tools/adb.exe",
"//conditions:default": "platform-tools/adb",
Expand All @@ -239,10 +236,7 @@ def create_android_sdk_rules(
}),
# See https://github.com/bazelbuild/bazel/issues/8757
tags = ["__ANDROID_RULES_MIGRATION__"],
zipalign = select({
":windows": "build-tools/%s/zipalign.exe" % build_tools_directory,
"//conditions:default": ":zipalign_binary",
}),
zipalign = ":zipalign",
)

native.toolchain(
Expand Down Expand Up @@ -356,6 +350,14 @@ def create_android_sdk_rules(
}),
)

native.alias(
name = "zipalign",
actual = select({
":windows": "build-tools/%s/zipalign.exe" % build_tools_directory,
"//conditions:default": ":zipalign_binary",
}),
)

native.alias(
name = "fail",
actual = select({
Expand Down
2 changes: 1 addition & 1 deletion rules/java.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def _run(

# Set reasonable max heap default. Required to prevent runaway memory usage.
# Can still be overridden by callers of this method.
jvm_flags = ["-Xms3G", "-Xmx3G", "-XX:+ExitOnOutOfMemoryError"] + jvm_flags
jvm_flags = ["-Xms512M", "-Xmx3G", "-XX:+ExitOnOutOfMemoryError"] + jvm_flags
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a select for this if it's a specific Windows limitation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, are you sure this is a problem for all Windows Android Java actions? We do have Windows Android builds running in BazelCI and I haven't seen any memory-related errors yet. Are you sure this isn't something wrong with your specific dev environment?


# executable should be a File or a FilesToRunProvider
jar = args.get("executable")
Expand Down