Skip to content

build: transform overview markdown files with bazel #14300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility=["//visibility:public"])

load("//tools/markdown-to-html:index.bzl", "markdown_to_html")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more clear to import the file directly instead of adding the layer of indirection.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think it's still clear that way. The big benefit is just that we don't need to change the import in hundreds of BUILD.bazel files. It's a pain keeping them in sync.

I'm okay switching to explicit paths, but personally don't think a layer of indirection is problematic here, since it helps reducing the boilerplate and makes it easier to sync the rule definitions across all build files.

load("//tools:defaults.bzl", "markdown_to_html")

markdown_to_html(
name = "guides",
Expand Down
8 changes: 7 additions & 1 deletion src/cdk/a11y/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "a11y",
Expand Down Expand Up @@ -49,3 +50,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":a11y_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":a11y.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/accordion/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ts_library", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ts_library", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "accordion",
Expand Down Expand Up @@ -28,3 +29,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":accordion_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [],
)
8 changes: 7 additions & 1 deletion src/cdk/bidi/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "bidi",
Expand All @@ -25,3 +26,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":bidi_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":bidi.md"],
)
7 changes: 6 additions & 1 deletion src/cdk/coercion/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ts_library", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library", "jasmine_node_test", "markdown_to_html")

ts_library(
name = "coercion",
Expand All @@ -22,3 +22,8 @@ jasmine_node_test(
name = "unit_tests",
deps = [":coercion_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":coercion.md"],
)
7 changes: 6 additions & 1 deletion src/cdk/collections/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ts_library", "jasmine_node_test")
load("//tools:defaults.bzl", "ng_module", "ts_library", "jasmine_node_test", "markdown_to_html")

ng_module(
name = "collections",
Expand All @@ -26,3 +26,8 @@ jasmine_node_test(
name = "unit_tests",
deps = [":collections_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":collections.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/drag-drop/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "drag-drop",
Expand Down Expand Up @@ -32,3 +33,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":drag-drop_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":drag-drop.md"],
)
7 changes: 6 additions & 1 deletion src/cdk/keycodes/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite", "markdown_to_html")

ts_library(
name = "keycodes",
Expand All @@ -23,3 +23,8 @@ ts_web_test_suite(
name = "unit_tests",
deps = [":keycodes_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":keycodes.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/layout/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "layout",
Expand Down Expand Up @@ -28,3 +29,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":layout_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":layout.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/observers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "observers",
Expand All @@ -24,3 +25,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":observers_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":observers.md"],
)
9 changes: 8 additions & 1 deletion src/cdk/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "overlay",
Expand Down Expand Up @@ -56,3 +57,9 @@ ng_web_test_suite(
deps = [":overlay_test_sources"],
static_css = ["overlay_prebuilt_scss"],
)

markdown_to_html(
name = "overview",
srcs = [":overlay.md"],
)

7 changes: 6 additions & 1 deletion src/cdk/platform/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "markdown_to_html")

ng_module(
name = "platform",
Expand All @@ -11,3 +11,8 @@ ng_module(
"@angular//packages/core",
]
)

markdown_to_html(
name = "overview",
srcs = [":platform.md"],
)
9 changes: 8 additions & 1 deletion src/cdk/portal/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "portal",
Expand All @@ -24,3 +25,9 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":portal_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":portal.md"],
)

8 changes: 7 additions & 1 deletion src/cdk/scrolling/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "scrolling",
Expand Down Expand Up @@ -40,3 +41,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":scrolling_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":scrolling.md"],
)
7 changes: 6 additions & 1 deletion src/cdk/stepper/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "markdown_to_html")

ng_module(
name = "stepper",
Expand All @@ -18,3 +18,8 @@ ng_module(
"//src/cdk/keycodes",
],
)

markdown_to_html(
name = "overview",
srcs = [":stepper.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/table/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "table",
Expand Down Expand Up @@ -34,3 +35,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":table_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":table.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/text-field/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "text-field",
Expand Down Expand Up @@ -46,3 +47,8 @@ ng_web_test_suite(
deps = [":text-field_test_sources"],
static_css = [":text_field_prebuilt_scss"]
)

markdown_to_html(
name = "overview",
srcs = [":text-field.md"],
)
8 changes: 7 additions & 1 deletion src/cdk/tree/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility=["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "tree",
Expand Down Expand Up @@ -33,3 +34,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":tree_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":tree.md"],
)
8 changes: 7 additions & 1 deletion src/lib/autocomplete/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "autocomplete",
Expand Down Expand Up @@ -66,3 +67,8 @@ ng_web_test_suite(
name = "unit_tests",
deps = [":autocomplete_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":autocomplete.md"],
)
7 changes: 6 additions & 1 deletion src/lib/badge/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "badge",
Expand Down Expand Up @@ -40,3 +41,7 @@ ng_web_test_suite(
deps = [":badge_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":badge.md"],
)
7 changes: 6 additions & 1 deletion src/lib/bottom-sheet/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "bottom-sheet",
Expand Down Expand Up @@ -59,3 +60,7 @@ ng_web_test_suite(
deps = [":bottom_sheet_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":bottom-sheet.md"],
)
7 changes: 6 additions & 1 deletion src/lib/button-toggle/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite",
"markdown_to_html")

ng_module(
name = "button-toggle",
Expand Down Expand Up @@ -49,3 +50,7 @@ ng_web_test_suite(
deps = [":button_toggle_test_sources"],
)

markdown_to_html(
name = "overview",
srcs = [":button-toggle.md"],
)
Loading