diff --git a/WORKSPACE b/WORKSPACE index 6b39b499aeaa..5a5ee3ebe2ee 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -227,7 +227,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") git_repository( name = "devinfra", - commit = "cc73dde52b557f831cc3b6e48daf8c3b542a33df", + commit = "b3b3466509babc50fd7f00b90e8bc607e7fe41aa", remote = "https://github.com/angular/dev-infra.git", ) diff --git a/material.angular.io/WORKSPACE.bazel b/material.angular.io/WORKSPACE.bazel index 5402335f9926..509559d918c1 100644 --- a/material.angular.io/WORKSPACE.bazel +++ b/material.angular.io/WORKSPACE.bazel @@ -1,4 +1,5 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") http_archive( name = "aspect_bazel_lib", @@ -44,17 +45,6 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz"], ) -http_archive( - name = "dev-infra", - strip_prefix = "dev-infra-8a438a3bdc519880d78b5ac92b62bfe688deb058", - sha256 = "2e75c26ba9f678de8496f05a10470d62a398bad05f6b64864bbed5dc304a6f4e", - url = "https://github.com/angular/dev-infra/archive/8a438a3bdc519880d78b5ac92b62bfe688deb058/8a438a3bdc519880d78b5ac92b62bfe688deb058.tar.gz", -) - -load("@dev-infra//bazel/browsers:browser_repositories.bzl", "browser_repositories") - -browser_repositories() - load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") web_test_repositories() @@ -76,3 +66,21 @@ npm_translate_lock( load("@npm//:repositories.bzl", "npm_repositories") npm_repositories() + +git_repository( + name = "devinfra", + commit = "b3b3466509babc50fd7f00b90e8bc607e7fe41aa", + remote = "https://github.com/angular/dev-infra.git", +) + +load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1") + +setup_dependencies_1() + +load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2") + +setup_dependencies_2() + +load("@devinfra//bazel/browsers:browser_repositories.bzl", "browser_repositories") + +browser_repositories() \ No newline at end of file diff --git a/material.angular.io/defs.bzl b/material.angular.io/defs.bzl index 3c6f3b68ba56..817fbfc00bfa 100644 --- a/material.angular.io/defs.bzl +++ b/material.angular.io/defs.bzl @@ -53,9 +53,8 @@ APPLICATION_CONFIG = COMMON_CONFIG + [ # Common dependencies of Angular CLI test suites TEST_CONFIG = COMMON_CONFIG + [ - "@dev-infra//bazel/browsers/chromium", - "@dev-infra//bazel/browsers/firefox", - + "@devinfra//bazel/browsers/chromium", + "@devinfra//bazel/browsers/firefox", "//:ng-base-test-config", ":ng-test-config", "//:node_modules/karma", @@ -74,9 +73,8 @@ TEST_DEPS = [ # Common dependencies of Angular CLI e2e tests E2E_CONFIG = COMMON_CONFIG + [ - "@dev-infra//bazel/browsers/chromium", - "@dev-infra//bazel/browsers/firefox", - + "@devinfra//bazel/browsers/chromium", + "@devinfra//bazel/browsers/firefox", "//:ng-base-test-config", ":ng-e2e-config", "//:node_modules/jasmine-spec-reporter", @@ -89,28 +87,28 @@ E2E_DEPS = [ ] LINT_CONFIG = COMMON_CONFIG + [ - # Lint uses the e2e config - "//:ng-base-test-config", - ":ng-e2e-config", - "//:ng-base-lint-config", - "//:node_modules/@angular-eslint/builder", - "//:node_modules/@angular-eslint/eslint-plugin", - "//:node_modules/@angular-eslint/eslint-plugin-template", - "//:node_modules/@angular-eslint/template-parser", - "//:node_modules/eslint-plugin-ban", - "//:node_modules/eslint-plugin-import", - "//:node_modules/eslint-plugin-jsdoc", - "//:node_modules/eslint-plugin-prefer-arrow", - "//:node_modules/@typescript-eslint/eslint-plugin", - "//:node_modules/@typescript-eslint/parser", - "//:node_modules/@stylistic/eslint-plugin", + # Lint uses the e2e config + "//:ng-base-test-config", + ":ng-e2e-config", + "//:ng-base-lint-config", + "//:node_modules/@angular-eslint/builder", + "//:node_modules/@angular-eslint/eslint-plugin", + "//:node_modules/@angular-eslint/eslint-plugin-template", + "//:node_modules/@angular-eslint/template-parser", + "//:node_modules/eslint-plugin-ban", + "//:node_modules/eslint-plugin-import", + "//:node_modules/eslint-plugin-jsdoc", + "//:node_modules/eslint-plugin-prefer-arrow", + "//:node_modules/@typescript-eslint/eslint-plugin", + "//:node_modules/@typescript-eslint/parser", + "//:node_modules/@stylistic/eslint-plugin", ] LINT_DEPS = [ - # TODO(bazel): this should be included as a transitive of @angular-devkit/architect-cli!? - "//:node_modules/@angular-devkit/architect", + # TODO(bazel): this should be included as a transitive of @angular-devkit/architect-cli!? + "//:node_modules/@angular-devkit/architect", ] - +# buildifier: disable=unused-variable def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [], **kwargs): """ Macro for Angular applications, creating various targets aligning with the Angular CLI. @@ -137,7 +135,7 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [], test_srcs = native.glob(["src/test.ts", "src/**/*.spec.ts"]) - e2e_srcs = native.glob(["e2e/src/**/*.ts"]) + e2e_srcs = native.glob(["e2e/src/**/*.ts"]) tags = kwargs.pop("tags", []) @@ -145,36 +143,36 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [], copy_to_bin( name = "ng-app-config", srcs = [ - "tsconfig.app.json", + "tsconfig.app.json", ], visibility = ["//visibility:private"], ) copy_to_bin( name = "ng-test-config", srcs = [ - "karma.conf.js", - "tsconfig.spec.json", + "karma.conf.js", + "tsconfig.spec.json", ], visibility = ["//visibility:private"], ) copy_to_bin( name = "ng-e2e-config", srcs = [ - "e2e/tsconfig.json", - "e2e/protractor.conf.js", + "e2e/tsconfig.json", + "e2e/protractor.conf.js", ], visibility = ["//visibility:private"], ) # Lint config files in addition to the root - if native.package_name() != '': - copy_to_bin( - name = "lint-config", - srcs = [ - ".eslintrc.json", - ], - visibility = ["//visibility:private"], - ) + if native.package_name() != "": + copy_to_bin( + name = "lint-config", + srcs = [ + ".eslintrc.json", + ], + visibility = ["//visibility:private"], + ) project_name = project_name if project_name else name @@ -239,7 +237,7 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [], _architect_test( project_name, "lint", - srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config"] if native.package_name() != '' else []), + srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config"] if native.package_name() != "" else []), tags = tags + ["lint"], **kwargs ) @@ -248,8 +246,9 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], * output_dir = "%s%s" % (project_name, ".%s" % configuration if configuration else "") args = [ - "%s:build%s" % (project_name, ":%s" % configuration if configuration else ""), - "--output-path", output_dir + "%s:build%s" % (project_name, ":%s" % configuration if configuration else ""), + "--output-path", + output_dir, ] + args architect_cli.architect( @@ -258,13 +257,13 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], * args = args, out_dirs = [output_dir], srcs = srcs, - **kwargs, + **kwargs ) def _architect_test(project_name, command, configuration = None, args = [], srcs = [], **kwargs): to_root = "" if native.package_name() != "": - to_root = "".join(["../" for _ in native.package_name().split("/")]) + to_root = "".join(["../" for _ in native.package_name().split("/")]) env = { "CHROME_BIN": to_root + "$(CHROMIUM)", @@ -275,15 +274,15 @@ def _architect_test(project_name, command, configuration = None, args = [], srcs name = "%s%s" % (command, ".%s" % configuration if configuration else ""), chdir = native.package_name(), args = [ - "%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else "") + "%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else ""), ] + args, data = srcs, env = env, toolchains = [ - "@dev-infra//bazel/browsers/chromium:toolchain_alias", - "@dev-infra//bazel/browsers/firefox:toolchain_alias", + "@devinfra//bazel/browsers/chromium:toolchain_alias", + "@devinfra//bazel/browsers/firefox:toolchain_alias", ], - **kwargs, + **kwargs ) def _architect_binary(project_name, command, configuration = None, args = [], srcs = [], **kwargs): @@ -291,9 +290,8 @@ def _architect_binary(project_name, command, configuration = None, args = [], sr name = "%s%s" % (command, ".%s" % configuration if configuration else ""), chdir = native.package_name(), args = [ - "%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else "") + "%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else ""), ] + args, data = srcs, - **kwargs, + **kwargs ) -