Skip to content

Commit

Permalink
refactor(scripts): align naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mgred committed Jul 26, 2024
1 parent b9821c5 commit 095a915
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
16 changes: 7 additions & 9 deletions scripts/release/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ versioned_module_bazel(
)

dcomment(
name = "uncomment_module_bazel",
name = "root_module_bazel",
src = ":versioned_module_bazel",
out = "root_MODULE.bazel",
defines = "_BZLPARTY_RELEASE_",
Expand All @@ -67,20 +67,18 @@ dcomment(
tags = ["manual"],
)

root_build_file(name = "root_BUILD")
root_build_file(name = "root_build_bazel")

toolchains_build_file(name = "toolchains_BUILD")
toolchains_build_file(name = "toolchains_build_bazel")

git_archive(
name = "git_archive",
package_name = "tools",
tags = ["manual"],
virtual_files = {
# these files come from `dist_files` macro
":root_BUILD.bazel": "BUILD.bazel",
":root_MODULE.bazel": "MODULE.bazel",
":docs_BUILD.bazel": "docs/BUILD.bazel",
":toolchains_BUILD.bazel": "toolchains/BUILD.bazel",
":root_build_bazel": "BUILD.bazel",
":root_module_bazel": "MODULE.bazel",
":docs_build_bazel": "docs/BUILD.bazel",
":toolchains_build_bazel": "toolchains/BUILD.bazel",
":sha_assets": "toolchains/sha/assets.bzl",
":templ_assets": "toolchains/templ/assets.bzl",
},
Expand Down
19 changes: 13 additions & 6 deletions scripts/release/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,23 @@ bzl_library(
)
"""

def root_build_file(name):
def _write_build_file(name, prefix, content):
write_file(
name = "%s_bazel" % name.lower(),
out = "%s.bazel" % name,
name = name,
out = "%s_BUILD.bazel" % prefix,
content = content,
)

def root_build_file(name):
_write_build_file(
name = name,
prefix = "root",
content = [_ROOT_BUILD_FILE],
)

def toolchains_build_file(name):
write_file(
name = "%s_bazel" % name.lower(),
out = "%s.bazel" % name,
_write_build_file(
name = name,
prefix = "toolchains",
content = [_TOOLCHAINS_BUILD_FILE],
)

0 comments on commit 095a915

Please sign in to comment.