Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customizing toolchain level jvm_flags #141

Open
Bencodes opened this issue Sep 13, 2023 · 1 comment
Open

Support customizing toolchain level jvm_flags #141

Bencodes opened this issue Sep 13, 2023 · 1 comment

Comments

@Bencodes
Copy link
Contributor

Users are unable to easily customize the jvm_flags backing some of the tools in toolchain.bzl as they are all being passed as their raw deploy jars instead of their executable Bazel types.

This means that JVM resource tuning changes like #140 will always need to be checked into rules_android or kept in forks rather than leveraging the existing attributes that Bazel provides.

@Bencodes
Copy link
Contributor Author

Some refactoring will need to be done but something like this would add some flexibility:

java_binary(
    name = "r8",
    main_class = "com.android.tools.r8.R8",
    visibility = ["//visibility:public"],
    jvm_flags = ["-Xmx8G",  "-XX:ThreadStackSize=2048", ...]
    runtime_deps = ["@android_gmaven_r8//jar"],
)
    r8 = attr.label(
        cfg = "exec",
        default = "//tools/android:r8", # Use the R8 runnable target instead of the deploy jar
        executable = True,
        allow_files = True,
    ),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant