Skip to content

build: dev-app with bazel #14162

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 3 commits into from
Nov 19, 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 src/a11y-demo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sass_generate_binaries("a11y_demo_scss", glob(["**/*.scss"]))

ng_module(
name = "a11y-demo",
srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
srcs = glob(["**/*.ts"]),
assets = glob(["**/*.html"]) + [":a11y_demo_scss"],
deps = [
"@angular//packages/core",
Expand Down
41 changes: 41 additions & 0 deletions src/dev-app/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("//:packages.bzl", "MATERIAL_TARGETS", "CDK_TARGETS")
load("//tools:defaults.bzl", "ng_module")
load("//tools:sass_generate_binaries.bzl", "sass_generate_binaries")

# Generate sass binaries for all nested SCSS files.
sass_generate_binaries("dev_app_scss", glob(["**/*.scss"], exclude = ["theme.scss"]), [
# Needed for the input-demo sass file that uses CDK text-field mixins.
"//src/cdk/text-field:text_field_scss_lib"
])

ng_module(
name = "dev-app",
srcs = glob(["**/*.ts"], exclude = ["system-config.ts"]),
assets = glob(["**/*.html"]) + [":dev_app_scss", ":theme"],
deps = [
"@angular//packages/common",
"@angular//packages/common/http",
"@angular//packages/core",
"@angular//packages/elements",
"@angular//packages/forms",
"@angular//packages/platform-browser",
"@angular//packages/platform-browser-dynamic",
"@angular//packages/platform-browser/animations",
"@angular//packages/router",
"@rxjs",
"@rxjs//operators",
"//src/cdk-experimental",
"//src/material-examples:examples",
] + CDK_TARGETS + MATERIAL_TARGETS
)

sass_binary(
name = "theme",
src = "theme.scss",
deps = [
"//src/lib/core:all_themes"
]
)
2 changes: 0 additions & 2 deletions src/dev-app/ripple/ripple-demo.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import '../../lib/core/style/vendor-prefixes';

.demo-ripple {
button, a {
margin: 8px;
Expand Down
3 changes: 2 additions & 1 deletion tools/sass_generate_binaries.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
# Generates multiple sass binaries based on a specified list of source files.
# All generated sass binaries will be exposed as a filegroup that has all the
# CSS outputs from the specified source files.
def sass_generate_binaries(filegroup_name, source_files):
def sass_generate_binaries(filegroup_name, source_files, sass_deps = []):
for source_file in source_files:
sass_binary(
name = source_file.replace('.scss', '_scss'),
src = source_file,
deps = sass_deps,
)

native.filegroup(
Expand Down