Skip to content

Commit 94f4ce1

Browse files
jelbournandrewseguin
authored andcommitted
build(bazel): switch to rules_sass 0.1.0 (#11683)
This brings us to the newest version of rules_sass, which I just released after work by Alex Eagle and Natalie Weizenbaum that switches over to the new cannonical Dart-based compiler and aligns the rule APIs with the ones we have inside Google. The good thing here is that this eliminates the need to have all of the genrules that rename the css output.
1 parent 6bd90e8 commit 94f4ce1

File tree

39 files changed

+61
-526
lines changed

39 files changed

+61
-526
lines changed

WORKSPACE

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ check_bazel_version("0.13.0")
1616
node_repositories(package_json = ["//:package.json"])
1717

1818
# Add sass rules
19-
git_repository(
19+
http_archive(
2020
name = "io_bazel_rules_sass",
21-
remote = "https://github.com/bazelbuild/rules_sass.git",
22-
tag = "0.0.3",
21+
url = "https://github.com/bazelbuild/rules_sass/archive/0.1.0.zip",
22+
strip_prefix = "rules_sass-0.1.0",
23+
sha256 = "b243c4d64f054c174051785862ab079050d90b37a1cef7da93821c6981cb9ad4",
2324
)
2425

25-
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")
26+
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
2627
sass_repositories()
2728

2829
# Add TypeScript rules

src/cdk-experimental/dialog/BUILD.bazel

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
name = "dialog",
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/cdk-experimental/dialog",
10-
assets = [":dialog_container_css"] + glob(["**/*.html"]),
10+
assets = [":dialog-container.css"] + glob(["**/*.html"]),
1111
deps = [
1212
"//src/cdk/a11y",
1313
"//src/cdk/bidi",
@@ -29,11 +29,3 @@ sass_binary(
2929
src = "dialog-container.scss",
3030
)
3131

32-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
33-
# Copy the output of the sass_binary such that the filename and path match what we expect.
34-
genrule(
35-
name = "dialog_container_css",
36-
srcs = [":dialog_container_scss.css"],
37-
outs = ["dialog-container.css"],
38-
cmd = "cp $< $@",
39-
)

src/cdk-experimental/scrolling/BUILD.bazel

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ng_module(
88
name = "scrolling",
99
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
1010
module_name = "@angular/cdk-experimental/scrolling",
11-
assets = [":virtual_scroll_viewport_css"] + glob(["**/*.html"]),
11+
assets = [":virtual-scroll-viewport.css"] + glob(["**/*.html"]),
1212
deps = [
1313
"//src/cdk/coercion",
1414
"//src/cdk/collections",
@@ -22,14 +22,6 @@ sass_binary(
2222
src = "virtual-scroll-viewport.scss",
2323
)
2424

25-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
26-
# Copy the output of the sass_binary such that the filename and path match what we expect.
27-
genrule(
28-
name = "virtual_scroll_viewport_css",
29-
srcs = [":virtual_scroll_viewport_scss.css"],
30-
outs = ["virtual-scroll-viewport.css"],
31-
cmd = "cp $< $@",
32-
)
3325

3426
ts_library(
3527
name = "scrolling_test_sources",

src/cdk/text-field/BUILD.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,3 @@ sass_binary(
3030
src = "text-field-prebuilt.scss",
3131
deps = [":text_field_scss_lib"],
3232
)
33-
34-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
35-
# Copy the output of the sass_binary such that the filename and path match what we expect.
36-
genrule(
37-
name = "text_field_prebuilt_css",
38-
srcs = [":text_field_prebuilt_scss.css"],
39-
outs = ["text-field-prebuilt.css"],
40-
cmd = "cp $< $@",
41-
)

src/lib/autocomplete/BUILD.bazel

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
name = "autocomplete",
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/material/autocomplete",
10-
assets = [":autocomplete_css"] + glob(["**/*.html"]),
10+
assets = [":autocomplete.css"] + glob(["**/*.html"]),
1111
deps = [
1212
"//src/lib/core",
1313
"//src/lib/form-field",
@@ -34,15 +34,6 @@ sass_binary(
3434
deps = ["//src/lib/core:core_scss_lib"],
3535
)
3636

37-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
38-
# Copy the output of the sass_binary such that the filename and path match what we expect.
39-
genrule(
40-
name = "autocomplete_css",
41-
srcs = [":autocomplete_scss.css"],
42-
outs = ["autocomplete.css"],
43-
cmd = "cp $< $@",
44-
)
45-
4637
sass_library(
4738
name = "theme",
4839
srcs = glob(["**/*-theme.scss"]),

src/lib/bottom-sheet/BUILD.bazel

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ng_module(
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/material/bottom-sheet",
1010
assets = [
11-
":bottom_sheet_container_css",
11+
":bottom-sheet-container.css",
1212
] + glob(["**/*.html"]),
1313
deps = [
1414
"//src/lib/core",
@@ -34,15 +34,6 @@ sass_binary(
3434
deps = ["//src/lib/core:core_scss_lib"],
3535
)
3636

37-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
38-
# Copy the output of the sass_binary such that the filename and path match what we expect.
39-
genrule(
40-
name = "bottom_sheet_container_css",
41-
srcs = [":bottom_sheet_container_scss.css"],
42-
outs = ["bottom-sheet-container.css"],
43-
cmd = "cp $< $@",
44-
)
45-
4637
sass_library(
4738
name = "theme",
4839
srcs = glob(["**/*-theme.scss"]),

src/lib/button-toggle/BUILD.bazel

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
name = "button-toggle",
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/material/button-toggle",
10-
assets = [":button_toggle_css"] + glob(["**/*.html"]),
10+
assets = [":button-toggle.css"] + glob(["**/*.html"]),
1111
deps = [
1212
"//src/lib/core",
1313
"//src/cdk/a11y",
@@ -29,15 +29,6 @@ sass_binary(
2929
deps = ["//src/lib/core:core_scss_lib"],
3030
)
3131

32-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
33-
# Copy the output of the sass_binary such that the filename and path match what we expect.
34-
genrule(
35-
name = "button_toggle_css",
36-
srcs = [":button_toggle_scss.css"],
37-
outs = ["button-toggle.css"],
38-
cmd = "cp $< $@",
39-
)
40-
4132
sass_library(
4233
name = "theme",
4334
srcs = glob(["**/*-theme.scss"]),

src/lib/button/BUILD.bazel

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
name = "button",
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/material/button",
10-
assets = [":button_css"] + glob(["**/*.html"]),
10+
assets = [":button.css"] + glob(["**/*.html"]),
1111
deps = [
1212
"//src/lib/core",
1313
"//src/cdk/a11y",
@@ -35,16 +35,6 @@ sass_binary(
3535
deps = [":button_scss_lib"],
3636
)
3737

38-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
39-
# Copy the output of the sass_binary such that the filename and path match what we expect.
40-
genrule(
41-
name = "button_css",
42-
srcs = [":button_scss.css"],
43-
outs = ["button.css"],
44-
cmd = "cp $< $@",
45-
)
46-
47-
4838
sass_library(
4939
name = "theme",
5040
srcs = glob(["**/*-theme.scss"]),

src/lib/card/BUILD.bazel

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
name = "card",
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/material/card",
10-
assets = [":card_css"] + glob(["**/*.html"]),
10+
assets = [":card.css"] + glob(["**/*.html"]),
1111
deps = [
1212
"//src/lib/core",
1313
],
@@ -26,15 +26,6 @@ sass_binary(
2626
deps = ["//src/lib/core:core_scss_lib"],
2727
)
2828

29-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
30-
# Copy the output of the sass_binary such that the filename and path match what we expect.
31-
genrule(
32-
name = "card_css",
33-
srcs = [":card_scss.css"],
34-
outs = ["card.css"],
35-
cmd = "cp $< $@",
36-
)
37-
3829
sass_library(
3930
name = "theme",
4031
srcs = glob(["**/*-theme.scss"]),

src/lib/checkbox/BUILD.bazel

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
name = "checkbox",
88
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
99
module_name = "@angular/material/checkbox",
10-
assets = [":checkbox_css"] + glob(["**/*.html"]),
10+
assets = [":checkbox.css"] + glob(["**/*.html"]),
1111
deps = [
1212
"//src/lib/core",
1313
"//src/cdk/a11y",
@@ -29,16 +29,6 @@ sass_binary(
2929
deps = ["//src/lib/core:core_scss_lib"],
3030
)
3131

32-
# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
33-
# Copy the output of the sass_binary such that the filename and path match what we expect.
34-
genrule(
35-
name = "checkbox_css",
36-
srcs = [":checkbox_scss.css"],
37-
outs = ["checkbox.css"],
38-
cmd = "cp $< $@",
39-
)
40-
41-
4232
sass_library(
4333
name = "theme",
4434
srcs = glob(["**/*-theme.scss"]),

0 commit comments

Comments
 (0)