Skip to content

build(material): add bazel rules for all components #8457

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
Dec 20, 2017

Conversation

jelbourn
Copy link
Member

Part of #8369
cc @devversion

The genrules for transforming the css output are unfortunate but should be able to be removed without a ton of effort.

@jelbourn jelbourn requested a review from alexeagle November 15, 2017 20:09
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 15, 2017
@jelbourn jelbourn force-pushed the bazel-material-rules branch 2 times, most recently from 18628c2 to c12ba80 Compare November 16, 2017 00:46
@jelbourn
Copy link
Member Author

Updated now with CircleCI config to build everything

Copy link
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

comments apply to all BUILD.bazel files

@@ -34,7 +34,7 @@ jobs:
# For some reason, circleci needs the postinstall to be run explicitly.
# This may be unnecessary once ngcontainer uses nodejs 8
Copy link
Contributor

Choose a reason for hiding this comment

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

it's rules_nodejs that needs to switch, not ngcontainer

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

package(default_visibility=["//visibility:public"])
load("@angular//:index.bzl", "ng_module")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
Copy link
Contributor

Choose a reason for hiding this comment

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

you can load these two symbols in one load statement

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

tsconfig = ":tsconfig-build.json",
)


Copy link
Contributor

Choose a reason for hiding this comment

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

buildozer is available externally, you could format all your BUILD files

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack, I'll pursue that in a follow-up.

name = "autocomplete_css",
srcs = [":autocomplete_scss"],
outs = ["autocomplete.css"],
cmd = "cat $(locations :autocomplete_scss) > $@",
Copy link
Contributor

Choose a reason for hiding this comment

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

since you have a single src you can
cmd = "cp $< $@"

Copy link
Contributor

Choose a reason for hiding this comment

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

also, you do this enough that you might want to make a macro around sass_binary...

Copy link
Member Author

@jelbourn jelbourn Nov 16, 2017

Choose a reason for hiding this comment

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

The sass_binary rule claims that it has multiple sources even though there is just one

deps = ["//src/lib/core:core_scss_lib"],
)

# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe file an issue for that on rules_sass?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jelbourn jelbourn mentioned this pull request Nov 16, 2017
17 tasks
@jelbourn jelbourn force-pushed the bazel-material-rules branch from c12ba80 to 56aea99 Compare November 16, 2017 01:17
@alexeagle
Copy link
Contributor

alexeagle commented Nov 16, 2017 via email

@jelbourn
Copy link
Member Author

jelbourn commented Nov 16, 2017

@alexeagle

ERROR: /usr/local/google/home/jelbourn/material2/src/lib/button/BUILD.bazel:39:9:
in cmd attribute of genrule rule //src/lib/button:button_css: variable '$<' : more than one input file

@jelbourn jelbourn force-pushed the bazel-material-rules branch 2 times, most recently from 2a6516b to a640b83 Compare November 16, 2017 20:14
@jelbourn jelbourn force-pushed the bazel-material-rules branch 2 times, most recently from b795252 to 407eb09 Compare December 5, 2017 20:58
@jelbourn jelbourn force-pushed the bazel-material-rules branch 3 times, most recently from ced197c to 34e3363 Compare December 7, 2017 23:39
Copy link
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

we should make sure tazel can re-generate all your BUILD files

@@ -11,7 +11,7 @@
anchor_1: &job_defaults
working_directory: ~/ng
docker:
- image: angular/ngcontainer:0.0.4
- image: angular/ngcontainer:0.0.7
Copy link
Contributor

Choose a reason for hiding this comment

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

consider adding buildifier lint

@@ -32,9 +32,11 @@ jobs:

- run: bazel run @nodejs//:npm install
# For some reason, circleci needs the postinstall to be run explicitly.
# This may be unnecessary once ngcontainer uses nodejs 8
# This may be unnecessary once rules_nodejs uses nodejs 8
Copy link
Contributor

Choose a reason for hiding this comment

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

it does now, upgrade to 0.3.1

- run: bazel run @nodejs//:npm run postinstall
- run: bazel build src/cdk/...
- run: bazel build src/lib/datepicker
- run: cat /root/.cache/bazel/_bazel_root/049ed6f058a98cba95753eee774cab7a/server/jvm.out
Copy link
Contributor

Choose a reason for hiding this comment

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

debugging?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I'm in the middle of debugging now

@jelbourn jelbourn force-pushed the bazel-material-rules branch 2 times, most recently from 8e17141 to 3ad8d6e Compare December 8, 2017 00:00
@jelbourn jelbourn force-pushed the bazel-material-rules branch from 3ad8d6e to 700250d Compare December 20, 2017 00:35
@googlebot googlebot added cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Dec 20, 2017
@jelbourn jelbourn force-pushed the bazel-material-rules branch from 700250d to e18736e Compare December 20, 2017 00:49
@angular angular deleted a comment from googlebot Dec 20, 2017
@jelbourn jelbourn added cla: yes PR author has agreed to Google's Contributor License Agreement and removed cla: no PR author must sign Google's Contributor License Agreement: https://opensource.google.com/docs/cla labels Dec 20, 2017
@jelbourn
Copy link
Member Author

CircleCI issues are now resolved

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@josephperrott josephperrott added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Dec 20, 2017
@josephperrott josephperrott merged commit 444784b into angular:master Dec 20, 2017
CaerusKaru added a commit to CaerusKaru/components that referenced this pull request Dec 22, 2017
josephperrott pushed a commit to josephperrott/components that referenced this pull request Jan 2, 2018
@jelbourn jelbourn deleted the bazel-material-rules branch April 2, 2018 22:31
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants