Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
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
26 changes: 26 additions & 0 deletions 26 WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,32 @@ maven_install(
],
)

### rules_android setup
http_archive(
name = "rules_android",
sha256 = "7dc7a6ed0b9bf53f1f363292733e3d7164e140e96ed433a2937b19570d01d517",
strip_prefix = "rules_android-0.6.1",
url = "https://github.com/bazelbuild/rules_android/releases/download/v0.6.1/rules_android-v0.6.1.tar.gz",
)

load("@rules_android//:prereqs.bzl", "rules_android_prereqs")
rules_android_prereqs()

load("@rules_android//:defs.bzl", "rules_android_workspace")
rules_android_workspace()

load("@rules_android//rules:rules.bzl", "android_sdk_repository")
android_sdk_repository(
name = "androidsdk"
)

register_toolchains(
"@rules_android//toolchains/android:android_default_toolchain",
"@rules_android//toolchains/android_sdk:android_sdk_tools",
)

### end of rules_android setup

### googleapis setup

# as of 12/08/2022
Expand Down
37 changes: 37 additions & 0 deletions 37 cel_android_library.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Macro to create android_library rules with CEL specific options applied."""

load("@rules_android//rules:rules.bzl", "android_library")

def cel_android_library(name, **kwargs):
"""
Generates android_library target with CEL specific javacopts applied

Args:
name: name of the android_library target
**kwargs: rest of the args accepted by android_library
"""
default_javacopts = [
"-XDstringConcat=inline", # SDK forces usage of StringConcatFactory (java 9+)
]

javacopts = kwargs.get("javacopts", [])
all_javacopts = default_javacopts + javacopts

android_library(
name = name,
javacopts = all_javacopts,
**kwargs
)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.