Skip to content
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
6 changes: 5 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ test:saucelabs --define=KARMA_WEB_TEST_MODE=SL_REQUIRED
# Releases should always be stamped with version control info
# This command assumes node on the path and is a workaround for
# https://github.com/bazelbuild/bazel/issues/4802
build:release --workspace_status_command="yarn -s ng-dev release build-env-stamp"
build:release --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
build:release --stamp

build:snapshot --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=snapshot"
build:snapshot --stamp

###############################
# Output #
Expand Down
6 changes: 6 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ exports_files([
"tsconfig-test.json", # @external
"tsconfig-build.json", # @external
])

# Detect if the build is running under --stamp
config_setting(
name = "stamp",
values = {"stamp": "true"},
)
10 changes: 10 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.6/rules_nodejs-4.4.6.tar.gz"],
)

http_archive(
name = "rules_pkg",
sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d",
urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz"],
)

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

# Check the bazel version and download npm dependencies
load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "check_rules_nodejs_version", "node_repositories", "yarn_install")

Expand Down
32 changes: 15 additions & 17 deletions packages/angular/cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:ts_json_schema.bzl", "ts_json_schema")
load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema")
load("//tools:defaults.bzl", "ts_library")

# @external_begin
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
# @external_end
load("//tools:defaults.bzl", "pkg_npm", "ts_library")

licenses(["notice"]) # MIT

Expand Down Expand Up @@ -61,7 +56,7 @@ ts_library(
exclude = [
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
"node_modules/**",
"cli/lib/config/workspace-schema.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

@alan-agius4 This path was wrong so lib/config/workspace-schema.json was not actually being excluded. this dates back to your March commit 4b0223b. Is it correct to exclude it from this ts_library?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this file gets converted to schema.json which is included.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah it should be excluded.

"lib/config/workspace-schema.json",
],
) + [
"//packages/angular/cli:lib/config/schema.json",
Expand Down Expand Up @@ -312,19 +307,22 @@ jasmine_node_test(
srcs = [":angular-cli_test_lib"],
)

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)
Comment on lines +310 to +315
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pkg_npm requires that included files be in the same directory, so this just copies the LICENSE file from the root.


pkg_npm(
name = "npm_package",
srcs = [":package.json"],
deps = [
":README.md",
":angular-cli",
":license",
":src/commands/update/schematic/collection.json",
":src/commands/update/schematic/schema.json",
":utilities/INITIAL_COMMIT_MESSAGE.txt",
],
)

pkg_tar(
name = "npm_package_archive",
srcs = [":npm_package"],
extension = "tar.gz",
strip_prefix = "./npm_package",
tags = ["manual"],
)
# @external_end
23 changes: 11 additions & 12 deletions packages/angular/pwa/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
# found in the LICENSE file at https://angular.io/license

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:ts_json_schema.bzl", "ts_json_schema")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")

licenses(["notice"]) # MIT

Expand Down Expand Up @@ -35,7 +33,6 @@ ts_library(
data = glob(
include = [
"collection.json",
"package.json",
"pwa/schema.json",
"pwa/files/**/*",
],
Expand Down Expand Up @@ -70,17 +67,19 @@ jasmine_node_test(
srcs = [":pwa_test_lib"],
)

genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)

pkg_npm(
name = "npm_package",
srcs = [":package.json"],
deps = [
":README.md",
":license",
":pwa",
],
)

pkg_tar(
name = "npm_package_archive",
srcs = [":npm_package"],
extension = "tar.gz",
strip_prefix = "./npm_package",
tags = ["manual"],
)
40 changes: 21 additions & 19 deletions packages/angular_devkit/architect/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
# found in the LICENSE file at https://angular.io/license

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:ts_json_schema.bzl", "ts_json_schema")

# @external_begin
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@npm//@angular/dev-infra-private/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
# @external_end

licenses(["notice"]) # MIT

Expand All @@ -37,20 +32,27 @@ ts_json_schema(
src = "src/progress-schema.json",
)

ts_json_schema(
name = "operator_schema",
src = "builders/operator-schema.json",
)

ts_library(
name = "architect",
package_name = "@angular-devkit/architect",
srcs = glob(
include = ["src/**/*.ts"],
include = [
"src/**/*.ts",
"builders/*.ts",
],
exclude = ["**/*_spec.ts"],
) + [
# @external_begin
# These files are generated from the JSON schema
"//packages/angular_devkit/architect:src/input-schema.ts",
"//packages/angular_devkit/architect:src/output-schema.ts",
"//packages/angular_devkit/architect:src/builders-schema.ts",
"//packages/angular_devkit/architect:src/progress-schema.ts",
# @external_end
"//packages/angular_devkit/architect:builders/operator-schema.ts",
],
# strict_checks = False,
data = glob(
Expand Down Expand Up @@ -88,24 +90,25 @@ jasmine_node_test(
srcs = [":architect_test_lib"],
)

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)

pkg_npm(
name = "npm_package",
srcs = [":package.json"],
deps = [
":README.md",
":architect",
":license",
"//packages/angular_devkit/architect/node",
"//packages/angular_devkit/architect/testing",
],
)

pkg_tar(
name = "npm_package_archive",
srcs = [":npm_package"],
extension = "tar.gz",
strip_prefix = "./npm_package",
tags = ["manual"],
)

api_golden_test_npm_package(
name = "architect_api",
data = [
Expand All @@ -115,4 +118,3 @@ api_golden_test_npm_package(
golden_dir = "angular_cli/goldens/public-api/angular_devkit/architect",
npm_package = "angular_cli/packages/angular_devkit/architect/npm_package",
)
# @external_end
22 changes: 11 additions & 11 deletions packages/angular_devkit/architect_cli/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
load("//tools:defaults.bzl", "ts_library")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")

# Copyright Google Inc. All Rights Reserved.
#
Expand Down Expand Up @@ -30,17 +28,19 @@ ts_library(
],
)

genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)

pkg_npm(
name = "npm_package",
srcs = [":package.json"],
deps = [
":README.md",
":architect_cli",
":license",
],
)

pkg_tar(
name = "npm_package_archive",
srcs = [":npm_package"],
extension = "tar.gz",
strip_prefix = "./npm_package",
tags = ["manual"],
)
33 changes: 17 additions & 16 deletions packages/angular_devkit/benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
# found in the LICENSE file at https://angular.io/license

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library")

# @external_begin
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
# @external_end
load("//tools:defaults.bzl", "pkg_npm", "ts_library")

licenses(["notice"]) # MIT

Expand Down Expand Up @@ -74,19 +69,25 @@ jasmine_node_test(
],
)

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)

pkg_npm(
name = "npm_package",
srcs = [":package.json"],
deps = [
"src/test/exit-code-one.js",
"src/test/fibonacci.js",
"src/test/test-script.js",
"src/test/watch-test-cmd.js",
"src/test/watch-test-file.txt",
"src/test/watch-test-script.js",
":README.md",
":benchmark",
":license",
],
)

pkg_tar(
name = "npm_package_archive",
srcs = [":npm_package"],
extension = "tar.gz",
strip_prefix = "./npm_package",
tags = ["manual"],
)
# @external_end
28 changes: 12 additions & 16 deletions packages/angular_devkit/build_angular/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
# found in the LICENSE file at https://angular.io/license

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "ts_library")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:ts_json_schema.bzl", "ts_json_schema")

# @external_begin
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@npm//@angular/dev-infra-private/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
# @external_end

licenses(["notice"]) # MIT

Expand Down Expand Up @@ -217,22 +212,23 @@ jasmine_node_test(
srcs = [":build_angular_test_lib"],
)

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)

pkg_npm(
name = "npm_package",
srcs = [":package.json"],
deps = [
":README.md",
":build_angular",
":license",
],
)

pkg_tar(
name = "npm_package_archive",
srcs = [":npm_package"],
extension = "tar.gz",
strip_prefix = "./npm_package",
tags = ["manual"],
)

api_golden_test_npm_package(
name = "build_angular_api",
data = [
Expand All @@ -242,7 +238,7 @@ api_golden_test_npm_package(
golden_dir = "angular_cli/goldens/public-api/angular_devkit/build_angular",
npm_package = "angular_cli/packages/angular_devkit/build_angular/npm_package",
)
# @external_end

# Large build_angular specs

ts_library(
Expand Down
Loading