| load("@rules_closure//closure:defs.bzl", "closure_js_library") | |
| load("@rules_license//rules:license.bzl", "license") | |
| load("//build_defs:rules.bzl", "j2cl_alias") | |
| # Description: | |
| # Public targets available externally. Also see build_defs/rules.bzl for the provided rules. | |
| load("@bazel_skylib//rules:common_settings.bzl", "string_flag") | |
| package( | |
| default_applicable_licenses = [":j2cl_license"], | |
| default_visibility = ["//visibility:public"], | |
| licenses = ["reciprocal"], | |
| ) | |
| license( | |
| name = "j2cl_license", | |
| package_name = "j2cl", | |
| ) | |
| exports_files(["LICENSE"]) | |
| # JRE emulation | |
| # This is not an alias since it is intended only for js targets not j2cl targets | |
| closure_js_library( | |
| name = "jre", | |
| exports = ["//jre/java:jre"], | |
| ) | |
| alias( | |
| name = "jre-j2wasm", | |
| actual = "//jre/java:jre-j2wasm", | |
| ) | |
| alias( | |
| name = "jsinterop-annotations", | |
| actual = "//third_party:jsinterop-annotations", | |
| ) | |
| j2cl_alias( | |
| name = "jsinterop-annotations-j2cl", | |
| actual = "//third_party:jsinterop-annotations-j2cl", | |
| ) | |
| # JUnit library emulation | |
| j2cl_alias( | |
| name = "junit", | |
| actual = "//junit/emul/java:junit_emul", | |
| ) | |
| # JUnit async runner (EXPERIMENTAL) | |
| alias( | |
| name = "junit_async_runner", | |
| actual = "//junit/generator/java/com/google/j2cl/junit/async", | |
| ) | |
| alias( | |
| name = "junit_async_runner-j2cl", | |
| actual = "//junit/generator/java/com/google/j2cl/junit/async:async-j2cl", | |
| ) | |
| # Optional minifier library for development servers | |
| alias( | |
| name = "minifier", | |
| actual = "//tools/java/com/google/j2cl/tools/minifier", | |
| ) | |
| # Flag to configure j2kt-web experiment. Please talk to j2cl-team@ before using it. | |
| string_flag( | |
| name = "j2kt_web_environment", | |
| build_setting_default = "production", | |
| values = [ | |
| # Enables J2KT/Web for the set packages in the J2KT_WEB_ENABLED allowlist. | |
| "production", | |
| # Enables J2KT/Web for the set packages in the J2KT_WEB_EXPERIMENT_ENABLED allowlist. | |
| "experimental", | |
| # Enables J2KT/Web for the set packages in the J2KT_WEB_STAGING_ENABLED allowlist. | |
| "staging", | |
| # Disables J2KT/Web for all targets, regardless of allowlist membership. | |
| "disabled", | |
| ], | |
| ) | |
| # Flag to enable profiling for particular targets. | |
| # Example usage: | |
| # blaze build <my_binary> --//:profiling_filter=<target_pattern> | |
| # pprof --flame blaze-bin/<target>_<mnemonic>.profile | |
| # You should also see the matched targets & corresponding pprof command in the blaze output. | |
| string_flag( | |
| name = "profiling_filter", | |
| build_setting_default = "<disabled>", | |
| scope = "universal", | |
| ) |