From c595bc31b4abc3d6628da573a09db6a76f612915 Mon Sep 17 00:00:00 2001 From: Vasilios Pantazopoulos Date: Tue, 29 Oct 2024 16:43:07 -0400 Subject: [PATCH 1/2] feat: add skylib-gazelle compatible target for `//android/rules.bzl` This adds a `bzl_library` target for `//android/rules.bzl` which should match the expected target name when using [`bazelbuild/bazel-skylib`'s gazelle plugin](https://registry.bazel.build/modules/bazel_skylib_gazelle_plugin). Without this, users of the plugin who also depend on these rules will need to manually adjust their configuration. --- android/BUILD | 13 +++++++++++++ rules/BUILD | 1 + 2 files changed, 14 insertions(+) diff --git a/android/BUILD b/android/BUILD index 4db0c1020..d7ee91bb7 100644 --- a/android/BUILD +++ b/android/BUILD @@ -16,3 +16,16 @@ Package used for redirecting Starlark rules from //android/rules.bzl to //rules/rules.bzl. Used for easier migration to a new branch due to directory differences. """ + +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +bzl_library( + name = "rules", + srcs = ["rules.bzl"], + visibility = [ + "//visibility:public", + ], + deps = [ + "//rules:bzl", + ], +) diff --git a/rules/BUILD b/rules/BUILD index c8b565dc4..b1a560bca 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -96,6 +96,7 @@ bzl_library( "rules.bzl", ], visibility = [ + "//android:__pkg__", "//mobile_install:__pkg__", "//stardoc:__pkg__", "//test/rules/android_sdk_repository:__pkg__", From 203adefde1ef5a4243e9ad2d2cd9b06837605fd5 Mon Sep 17 00:00:00 2001 From: Vasilios Pantazopoulos Date: Thu, 31 Oct 2024 11:54:50 -0400 Subject: [PATCH 2/2] do the thing, but for a //rules target instead --- android/BUILD | 13 ------------- rules/BUILD | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/android/BUILD b/android/BUILD index d7ee91bb7..4db0c1020 100644 --- a/android/BUILD +++ b/android/BUILD @@ -16,16 +16,3 @@ Package used for redirecting Starlark rules from //android/rules.bzl to //rules/rules.bzl. Used for easier migration to a new branch due to directory differences. """ - -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "rules", - srcs = ["rules.bzl"], - visibility = [ - "//visibility:public", - ], - deps = [ - "//rules:bzl", - ], -) diff --git a/rules/BUILD b/rules/BUILD index b1a560bca..b21b536eb 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -96,7 +96,6 @@ bzl_library( "rules.bzl", ], visibility = [ - "//android:__pkg__", "//mobile_install:__pkg__", "//stardoc:__pkg__", "//test/rules/android_sdk_repository:__pkg__", @@ -119,6 +118,21 @@ bzl_library( ], ) +# Publicly-visible single-file `rules.bzl` target, for users of +# `bazelbuild/bazel-skylib`'s `bazel_skylib_gazelle_plugin`: +# https://registry.bazel.build/modules/bazel_skylib_gazelle_plugin +bzl_library( + name = "rules", + srcs = ["rules.bzl"], + visibility = [ + "//visibility:public", + ], + deps = [ + ":bzl", + ], +) + + bzl_library( name = "min_sdk_version_bzl", srcs = ["min_sdk_version.bzl"],