Skip to content

Commit

Permalink
refactor(utils): change naming of dcomment defines
Browse files Browse the repository at this point in the history
  • Loading branch information
mgred committed Jul 29, 2024
1 parent 475984d commit ef46618
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports_files([
"biome.json",
])

#ifndef _BZLPARTY_RELEASE_
#ifdef _BZLPARTY_RELEASE_PRIVATE_
formatter(
name = "format",
config = ":formatter.json",
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bazel_dep(name = "aspect_bazel_lib", version = "2.3.0")
bazel_dep(name = "rules_license", version = "0.0.8")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")

#ifndef _BZLPARTY_RELEASE_
#ifdef _BZLPARTY_RELEASE_PRIVATE_
bazel_dep(name = "rules_go", version = "0.49.0")

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package(default_visibility = ["//visibility:public"])

exports_files(glob(["*.md"]))

#ifndef _BZLPARTY_RELEASE_
#ifdef _BZLPARTY_RELEASE_PRIVATE_
stardoc_with_diff_test(
name = "utils",
bzl_library_target = "//docs/private:utils",
Expand Down
2 changes: 1 addition & 1 deletion docs/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dcomment(<a href="#dcomment-name">name</a>, <a href="#dcomment-defines">defines<
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="dcomment-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="dcomment-defines"></a>defines | - | String | optional | <code>""</code> |
| <a id="dcomment-defines"></a>defines | - | List of strings | optional | <code>[]</code> |
| <a id="dcomment-out"></a>out | - | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
| <a id="dcomment-src"></a>src | - | <a href="https://bazel.build/concepts/labels">Label</a> | required | |

Expand Down
4 changes: 2 additions & 2 deletions lib/private/utils/dcomment.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("//toolchains:external.bzl", "BUILDIFIER_TOOLCHAIN_TYPE")
def _dcomment_impl(ctx):
temp = ctx.actions.declare_file("{}_/{}.temp".format(ctx.label.name, ctx.label.name))
dcomment_args = ctx.actions.args()
dcomment_args.add("-d", ctx.attr.defines)
dcomment_args.add_all(ctx.attr.defines, format_each = "-d %s")
dcomment_args.add(ctx.file.src)
dcomment_args.add(temp)

Expand Down Expand Up @@ -37,7 +37,7 @@ _ATTRS = {
mandatory = True,
allow_single_file = True,
),
"defines": attr.string(),
"defines": attr.string_list(default = []),
"_dcomment": attr.label(
default = "@bzlparty_tools//vendor/dcomment",
allow_single_file = True,
Expand Down
8 changes: 4 additions & 4 deletions scripts/release/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,28 @@ dcomment(
name = "root_module_bazel",
src = ":versioned_module_bazel",
out = "root_MODULE.bazel",
defines = "_BZLPARTY_RELEASE_",
defines = ["_BZLPARTY_RELEASE_PUBLIC_"],
)

dcomment(
name = "docs_build_bazel",
src = "//docs:BUILD.bazel",
out = "docs_BUILD.bazel",
defines = "_BZLPARTY_RELEASE_",
defines = ["_BZLPARTY_RELEASE_PUBLIC_"],
)

dcomment(
name = "root_build_bazel",
src = "//:BUILD.bazel",
out = "root_BUILD.bazel",
defines = "_BZLPARTY_RELEASE_",
defines = ["_BZLPARTY_RELEASE_PUBLIC_"],
)

dcomment(
name = "toolchains_build_bazel",
src = "//toolchains:BUILD.bazel",
out = "toolchains_BUILD.bazel",
defines = "_BZLPARTY_RELEASE_",
defines = ["_BZLPARTY_RELEASE_PUBLIC_"],
)

git_archive(
Expand Down
2 changes: 1 addition & 1 deletion toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package(default_visibility = ["//visibility:public"])

bzlparty_toolchains()

#ifndef _BZLPARTY_RELEASE_
#ifdef _BZLPARTY_RELEASE_PRIVATE_
TOOLS = [
"biome",
"fd",
Expand Down

0 comments on commit ef46618

Please sign in to comment.