maprule: hide it, not ready for public use. (#133)

Move maprule() to a private directory, to
discourage use of it. I (@laszlocsomor) am
planning breaking changes to it.

Also move private files (rule implementations) to
a subdirectory "rules/private/", to clean up the
"rules/" directory.
This commit is contained in:
László Csomor 2019-03-20 18:13:32 +01:00 committed by GitHub
parent aeefb6531a
commit 3721d32c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 44 additions and 47 deletions

View File

@ -99,13 +99,6 @@ stardoc(
deps = ["//rules:copy_file"],
)
stardoc(
name = "maprule_docs",
out = "maprule_doc_gen.md",
input = "//rules:maprule.bzl",
deps = ["//rules:maprule"],
)
stardoc(
name = "write_file_docs",
out = "write_file_doc_gen.md",

View File

@ -13,47 +13,13 @@ bzl_library(
bzl_library(
name = "copy_file",
srcs = ["copy_file.bzl"],
deps = [":copy_file_private"],
)
bzl_library(
name = "copy_file_private",
srcs = ["copy_file_private.bzl"],
visibility = ["//visibility:private"],
)
bzl_library(
name = "maprule",
srcs = ["maprule.bzl"],
deps = [":maprule_private"],
)
bzl_library(
name = "maprule_private",
srcs = ["maprule_private.bzl"],
visibility = ["//visibility:private"],
deps = [
":maprule_util",
"//lib:dicts",
"//lib:paths",
],
)
bzl_library(
name = "maprule_util",
srcs = ["maprule_util.bzl"],
deps = ["//rules/private:copy_file_private"],
)
bzl_library(
name = "write_file",
srcs = ["write_file.bzl"],
deps = [":write_file_private"],
)
bzl_library(
name = "write_file_private",
srcs = ["write_file_private.bzl"],
visibility = ["//visibility:private"],
deps = ["//rules/private:write_file_private"],
)
# Exported for build_test.bzl to make sure of, it is an implementation detail

View File

@ -22,7 +22,7 @@ on Windows (no Bash is required).
"""
load(
":copy_file_private.bzl",
"//rules/private:copy_file_private.bzl",
_copy_file = "copy_file",
)

35
rules/private/BUILD Normal file
View File

@ -0,0 +1,35 @@
load("//:bzl_library.bzl", "bzl_library")
bzl_library(
name = "copy_file_private",
srcs = ["copy_file_private.bzl"],
visibility = ["//rules:__pkg__"],
)
bzl_library(
name = "write_file_private",
srcs = ["write_file_private.bzl"],
visibility = ["//rules:__pkg__"],
)
bzl_library(
name = "maprule",
srcs = ["maprule.bzl"],
visibility = ["//tests:__pkg__"],
deps = [":maprule_private"],
)
bzl_library(
name = "maprule_private",
srcs = ["maprule_private.bzl"],
deps = [
":maprule_util",
"//lib:dicts",
"//lib:paths",
],
)
bzl_library(
name = "maprule_util",
srcs = ["maprule_util.bzl"],
)

View File

@ -23,7 +23,7 @@ file. Instead they use Starlark's built-in file writing action
"""
load(
":write_file_private.bzl",
"//rules/private:write_file_private.bzl",
_write_file = "write_file",
)

View File

@ -1,6 +1,9 @@
# This package aids testing the 'maprule' rule.
#
# ATTENTION: As of 2019-03-20, maprule is not ready for public use.
# @laszlocsomor is planning incompatible changes to the rule.
load("//rules:maprule.bzl", "bash_maprule")
load("//rules/private:maprule.bzl", "bash_maprule")
package(default_testonly = 1)

View File

@ -15,7 +15,7 @@
"""Unit tests for maprule.bzl."""
load("//lib:unittest.bzl", "asserts", "unittest")
load("//rules:maprule_testing.bzl", "maprule_testing")
load("//rules/private:maprule_testing.bzl", "maprule_testing")
def _dummy_generating_action(ctx, path):
ctx.actions.write(path, "hello")