diff --git a/docs/BUILD b/docs/BUILD index 752ae61..6fa677e 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -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", diff --git a/rules/BUILD b/rules/BUILD index 2f26c89..0d7d150 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -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 diff --git a/rules/copy_file.bzl b/rules/copy_file.bzl index e985b3f..c3bc5e6 100644 --- a/rules/copy_file.bzl +++ b/rules/copy_file.bzl @@ -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", ) diff --git a/rules/private/BUILD b/rules/private/BUILD new file mode 100644 index 0000000..df4dced --- /dev/null +++ b/rules/private/BUILD @@ -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"], +) diff --git a/rules/copy_file_private.bzl b/rules/private/copy_file_private.bzl similarity index 100% rename from rules/copy_file_private.bzl rename to rules/private/copy_file_private.bzl diff --git a/rules/maprule.bzl b/rules/private/maprule.bzl similarity index 100% rename from rules/maprule.bzl rename to rules/private/maprule.bzl diff --git a/rules/maprule_private.bzl b/rules/private/maprule_private.bzl similarity index 100% rename from rules/maprule_private.bzl rename to rules/private/maprule_private.bzl diff --git a/rules/maprule_testing.bzl b/rules/private/maprule_testing.bzl similarity index 100% rename from rules/maprule_testing.bzl rename to rules/private/maprule_testing.bzl diff --git a/rules/maprule_util.bzl b/rules/private/maprule_util.bzl similarity index 100% rename from rules/maprule_util.bzl rename to rules/private/maprule_util.bzl diff --git a/rules/write_file_private.bzl b/rules/private/write_file_private.bzl similarity index 100% rename from rules/write_file_private.bzl rename to rules/private/write_file_private.bzl diff --git a/rules/write_file.bzl b/rules/write_file.bzl index 5f09b33..908bbc6 100644 --- a/rules/write_file.bzl +++ b/rules/write_file.bzl @@ -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", ) diff --git a/tests/maprule/BUILD b/tests/maprule/BUILD index d33039e..390b96d 100644 --- a/tests/maprule/BUILD +++ b/tests/maprule/BUILD @@ -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) diff --git a/tests/maprule_tests.bzl b/tests/maprule_tests.bzl index ddb4418..0b63fbd 100644 --- a/tests/maprule_tests.bzl +++ b/tests/maprule_tests.bzl @@ -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")