From 69553b8837b7cdde79a5327d33fd757c0d1fbd9d Mon Sep 17 00:00:00 2001 From: 5h4d0w4rt <5h4d0w4rt@gmail.com> Date: Wed, 3 Nov 2021 10:04:35 +0500 Subject: [PATCH] rename imports --- BUILD | 2 +- deps.bzl | 2 +- examples/BUILD | 2 +- prometheus/BUILD | 15 ++++++++------- prometheus/defs.bzl | 8 ++++---- prometheus/internal/BUILD | 4 ++-- prometheus/internal/defaults.bzl | 2 +- prometheus/internal/platforms.bzl | 2 +- prometheus/internal/prom.bzl | 10 +++++----- prometheus/internal/promtool.bzl | 18 +++++++++--------- prometheus/internal/repositories.bzl | 4 ++-- prometheus/internal/toolchain.bzl | 12 ++++++------ 12 files changed, 41 insertions(+), 40 deletions(-) diff --git a/BUILD b/BUILD index e82e273..18c997b 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("@//prometheus:defs.bzl", "prometheus", "promtool") +load("@io_bazel_rules_prometheus//prometheus:defs.bzl", "prometheus", "promtool") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package(default_visibility = ["//visibility:public"]) diff --git a/deps.bzl b/deps.bzl index c21d115..15ca5a7 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1,5 +1,5 @@ load( - "@//prometheus:defs.bzl", + "@io_bazel_rules_prometheus//prometheus:defs.bzl", _prometheus_repositories = "prometheus_repositories", _prometheus_toolchains = "prometheus_toolchains", ) diff --git a/examples/BUILD b/examples/BUILD index 055903b..5f2e482 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -1,4 +1,4 @@ -load("@//prometheus:defs.bzl", "promtool_config_test", "promtool_rules_test", "promtool_unit_test") +load("@io_bazel_rules_prometheus//prometheus:defs.bzl", "promtool_config_test", "promtool_rules_test", "promtool_unit_test") promtool_unit_test( name = "unit_test_rules_yml", diff --git a/prometheus/BUILD b/prometheus/BUILD index 7dd5388..3caa7a4 100644 --- a/prometheus/BUILD +++ b/prometheus/BUILD @@ -15,19 +15,20 @@ exports_files([ bzl_library( name = "api", srcs = [ - "@//prometheus/internal:defaults", - "@//prometheus/internal:platforms", - "@//prometheus/internal:prom", - "@//prometheus/internal:promtool", - "@//prometheus/internal:providers", - "@//prometheus/internal:repositories", - "@//prometheus/internal:toolchain", + "@io_bazel_rules_prometheus//prometheus/internal:defaults", + "@io_bazel_rules_prometheus//prometheus/internal:platforms", + "@io_bazel_rules_prometheus//prometheus/internal:prom", + "@io_bazel_rules_prometheus//prometheus/internal:promtool", + "@io_bazel_rules_prometheus//prometheus/internal:providers", + "@io_bazel_rules_prometheus//prometheus/internal:repositories", + "@io_bazel_rules_prometheus//prometheus/internal:toolchain", ], ) bzl_library( name = "defs", srcs = ["defs.bzl"], + visibility = ["//visibility:public"], deps = [ ":api", ], diff --git a/prometheus/defs.bzl b/prometheus/defs.bzl index fb891fb..98f4567 100644 --- a/prometheus/defs.bzl +++ b/prometheus/defs.bzl @@ -1,20 +1,20 @@ load( - "@//prometheus/internal:repositories.bzl", + "@io_bazel_rules_prometheus//prometheus/internal:repositories.bzl", _prometheus_repositories = "prometheus_repositories", ) load( - "@//prometheus/internal:promtool.bzl", + "@io_bazel_rules_prometheus//prometheus/internal:promtool.bzl", _promtool = "promtool", _promtool_config_test = "promtool_config_test", _promtool_rules_test = "promtool_rules_test", _promtool_unit_test = "promtool_unit_test", ) load( - "@//prometheus/internal:prom.bzl", + "@io_bazel_rules_prometheus//prometheus/internal:prom.bzl", _prometheus = "prometheus", ) load( - "@//prometheus/internal:toolchain.bzl", + "@io_bazel_rules_prometheus//prometheus/internal:toolchain.bzl", _prometheus_toolchains = "prometheus_toolchains", ) diff --git a/prometheus/internal/BUILD b/prometheus/internal/BUILD index 210d0a1..11c3574 100644 --- a/prometheus/internal/BUILD +++ b/prometheus/internal/BUILD @@ -1,6 +1,6 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@//prometheus/internal:toolchain.bzl", "declare_toolchains") -load("@//prometheus/internal:platforms.bzl", "declare_platforms") +load("@io_bazel_rules_prometheus//prometheus/internal:toolchain.bzl", "declare_toolchains") +load("@io_bazel_rules_prometheus//prometheus/internal:platforms.bzl", "declare_platforms") package( default_visibility = [ diff --git a/prometheus/internal/defaults.bzl b/prometheus/internal/defaults.bzl index aa55b81..4a94b44 100644 --- a/prometheus/internal/defaults.bzl +++ b/prometheus/internal/defaults.bzl @@ -1,5 +1,5 @@ load( - "@//prometheus/internal:providers.bzl", + "@io_bazel_rules_prometheus//prometheus/internal:providers.bzl", "AlertmanagerBinaryInfo", "PrometheusBinaryInfo", "PrometheusPackageInfo", diff --git a/prometheus/internal/platforms.bzl b/prometheus/internal/platforms.bzl index 1e0a34f..662eceb 100644 --- a/prometheus/internal/platforms.bzl +++ b/prometheus/internal/platforms.bzl @@ -1,4 +1,4 @@ -load("@//prometheus/internal:defaults.bzl", "DEFAULT_PLATFORMS") +load("@io_bazel_rules_prometheus//prometheus/internal:defaults.bzl", "DEFAULT_PLATFORMS") load("@bazel_skylib//lib:structs.bzl", "structs") INCOMPATIBLE = "@platforms//:incompatible" diff --git a/prometheus/internal/prom.bzl b/prometheus/internal/prom.bzl index da9389b..9f45b69 100644 --- a/prometheus/internal/prom.bzl +++ b/prometheus/internal/prom.bzl @@ -37,7 +37,7 @@ scrape_configs: def _prometheus_impl(ctx): prom_info = ( - ctx.toolchains["@//prometheus:toolchain"] + ctx.toolchains["@io_bazel_rules_prometheus//prometheus:toolchain"] .prometheusToolchainInfo .prometheus ) @@ -63,12 +63,12 @@ _prometheus = rule( doc = """Private rule implemented for invocation in public prometheus() runner""", attrs = { "_template": attr.label( - default = Label("@//prometheus/internal:prom.manual_runner.sh.tpl"), + default = Label("@io_bazel_rules_prometheus//prometheus/internal:prom.manual_runner.sh.tpl"), allow_single_file = True, ), }, executable = True, - toolchains = ["@//prometheus:toolchain"], + toolchains = ["@io_bazel_rules_prometheus//prometheus:toolchain"], ) def prometheus(name, **kwargs): @@ -108,7 +108,7 @@ def prometheus(name, **kwargs): def _prometheus_server_impl(ctx): prom_info = ( - ctx.toolchains["@//prometheus:toolchain"] + ctx.toolchains["@io_bazel_rules_prometheus//prometheus:toolchain"] .prometheusToolchainInfo .prometheus ) @@ -172,5 +172,5 @@ prometheus_server = rule( "scrape_jobs": attr.string(default = ""), "additional_contents": attr.string(default = ""), }, - toolchains = ["@//prometheus:toolchain"], + toolchains = ["@io_bazel_rules_prometheus//prometheus:toolchain"], ) diff --git a/prometheus/internal/promtool.bzl b/prometheus/internal/promtool.bzl index d7f6839..6c18c4b 100644 --- a/prometheus/internal/promtool.bzl +++ b/prometheus/internal/promtool.bzl @@ -1,6 +1,6 @@ def _promtool_impl(ctx): promtool_info = ( - ctx.toolchains["@//prometheus:toolchain"] + ctx.toolchains["@io_bazel_rules_prometheus//prometheus:toolchain"] .prometheusToolchainInfo .promtool ) @@ -26,12 +26,12 @@ _promtool = rule( doc = """Private rule implemented for invocation in public promtool() runner""", attrs = { "_template": attr.label( - default = Label("@//prometheus/internal:promtool.manual_runner.sh.tpl"), + default = Label("@io_bazel_rules_prometheus//prometheus/internal:promtool.manual_runner.sh.tpl"), allow_single_file = True, ), }, executable = True, - toolchains = ["@//prometheus:toolchain"], + toolchains = ["@io_bazel_rules_prometheus//prometheus:toolchain"], ) def promtool(name, **kwargs): @@ -74,7 +74,7 @@ def _promtool_unit_test_impl(ctx): # To ensure the files needed by the script are available, we put them in # the runfiles. promtool_info = ( - ctx.toolchains["@//prometheus:toolchain"] + ctx.toolchains["@io_bazel_rules_prometheus//prometheus:toolchain"] .prometheusToolchainInfo .promtool ) @@ -140,7 +140,7 @@ bazel test //examples:unit_test_rules_yml doc = "List of Rules-under-Test file targets", ), }, - toolchains = ["@//prometheus:toolchain"], + toolchains = ["@io_bazel_rules_prometheus//prometheus:toolchain"], ) def _promtool_config_test_impl(ctx): @@ -150,7 +150,7 @@ def _promtool_config_test_impl(ctx): # the runfiles. promtool_info = ( - ctx.toolchains["@//prometheus:toolchain"] + ctx.toolchains["@io_bazel_rules_prometheus//prometheus:toolchain"] .prometheusToolchainInfo .promtool ) @@ -206,12 +206,12 @@ bazel test //examples:test_config_yml doc = "List of prometheus configuration targets", ), }, - toolchains = ["@//prometheus:toolchain"], + toolchains = ["@io_bazel_rules_prometheus//prometheus:toolchain"], ) def _promtool_rules_test_impl(ctx): promtool_info = ( - ctx.toolchains["@//prometheus:toolchain"] + ctx.toolchains["@io_bazel_rules_prometheus//prometheus:toolchain"] .prometheusToolchainInfo .promtool ) @@ -265,5 +265,5 @@ bazel test //examples:test_rules_yml doc = "List of Prometheus rules file targets", ), }, - toolchains = ["@//prometheus:toolchain"], + toolchains = ["@io_bazel_rules_prometheus//prometheus:toolchain"], ) diff --git a/prometheus/internal/repositories.bzl b/prometheus/internal/repositories.bzl index 0b58873..e691b47 100644 --- a/prometheus/internal/repositories.bzl +++ b/prometheus/internal/repositories.bzl @@ -1,5 +1,5 @@ -load("@//prometheus/internal:defaults.bzl", "DEFAULT_PROMETHEUS_PACKAGE_INFO") -load("@//prometheus/internal:providers.bzl", "HttpArchiveInfo") +load("@io_bazel_rules_prometheus//prometheus/internal:defaults.bzl", "DEFAULT_PROMETHEUS_PACKAGE_INFO") +load("@io_bazel_rules_prometheus//prometheus/internal:providers.bzl", "HttpArchiveInfo") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") diff --git a/prometheus/internal/toolchain.bzl b/prometheus/internal/toolchain.bzl index 7314aa4..93eb193 100644 --- a/prometheus/internal/toolchain.bzl +++ b/prometheus/internal/toolchain.bzl @@ -1,5 +1,5 @@ -load("@//prometheus/internal:providers.bzl", "AlertmanagerInfo", "AmtoolInfo", "PrometheusInfo", "PromtoolInfo") -load("@//prometheus/internal:defaults.bzl", "DEFAULT_PROMETHEUS_PACKAGE_INFO") +load("@io_bazel_rules_prometheus//prometheus/internal:providers.bzl", "AlertmanagerInfo", "AmtoolInfo", "PrometheusInfo", "PromtoolInfo") +load("@io_bazel_rules_prometheus//prometheus/internal:defaults.bzl", "DEFAULT_PROMETHEUS_PACKAGE_INFO") PrometheusToolchainInfo = provider( doc = "Prometheus Toolchain metadata, contains prometheus, alertmanager, promtool and amtool's necessary data", @@ -63,8 +63,8 @@ def declare_toolchains(name = "declare_toolchains", _prometheus_package_info = D name = "prometheus_{platform}".format(platform = platform), prometheus = "@prometheus_{platform}//:prometheus".format(platform = platform), promtool = "@prometheus_{platform}//:promtool".format(platform = platform), - promtool_executor_template = "@//prometheus/internal:promtool.sh.tpl", - prometheus_executor_template = "@//prometheus/internal:prometheus.sh.tpl", + promtool_executor_template = "@io_bazel_rules_prometheus//prometheus/internal:promtool.sh.tpl", + prometheus_executor_template = "@io_bazel_rules_prometheus//prometheus/internal:prometheus.sh.tpl", # https://docs.bazel.build/versions/main/be/common-definitions.html#common.tags # exclude toolchain from expanding on wildcard @@ -77,11 +77,11 @@ def declare_toolchains(name = "declare_toolchains", _prometheus_package_info = D target_compatible_with = platform_info.os_constraints + platform_info.cpu_constraints, exec_compatible_with = platform_info.os_constraints + platform_info.cpu_constraints, toolchain = ":prometheus_{platform}".format(platform = platform), - toolchain_type = "@//prometheus:toolchain", + toolchain_type = "@io_bazel_rules_prometheus//prometheus:toolchain", ) def _link_toolchain_to_prometheus_toolchain(arch): - return "@//prometheus/internal:prometheus_toolchain_%s" % arch + return "@io_bazel_rules_prometheus//prometheus/internal:prometheus_toolchain_%s" % arch def build_toolchains(architectures, toolchain_linker = _link_toolchain_to_prometheus_toolchain): return [