build(bazel): avoid writing ngsw-config to the source tree

This was originally done before runfiles was enabled and the output
and source trees were not merged for architect targets.
This commit is contained in:
Derek Cormier
2022-09-12 10:28:19 -07:00
committed by Joey Perrott
parent b0c110ab3a
commit f183129eab
4 changed files with 13 additions and 23 deletions
-1
View File
@@ -5,7 +5,6 @@
/tmp
/out-tsc
/bazel-out
/src/generated
# Node
/node_modules
+1 -21
View File
@@ -6,10 +6,6 @@ load(":local_packages_util.bzl", "link_local_packages", "substitute_local_packag
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("//aio/scripts:local_server_test.bzl", "local_server_test")
# The write_source_files macro is used to write bazel outputs to the source tree and test that they are up to date.
# See: https://docs.aspect.build/aspect-build/bazel-lib/v0.5.0/docs/docs/write_source_files-docgen.html
load("@aspect_bazel_lib//lib:write_source_files.bzl", generated_files_test = "write_source_files")
exports_files([
"firebase.json",
"ngsw-config.json",
@@ -30,22 +26,6 @@ config_setting(
},
)
# Generate ngsw-config
npm_package_bin(
name = "ngsw-config",
outs = ["ngsw-config_generated.json"],
args = ["$@"],
tool = "//aio/scripts:build-ngsw-config",
)
# Write ngsw-config to the source directory and test that it's up to date
generated_files_test(
name = "write-ngsw-config",
files = {
"ngsw-config.json": ":ngsw-config",
},
)
# Run dgeni generation
npm_package_bin(
name = "dgeni",
@@ -88,7 +68,6 @@ copy_to_directory(
# All source and configuration files required to build the docs app
APPLICATION_FILES = [
"angular.json",
"ngsw-config.json",
"package.json",
"tsconfig.app.json",
"tsconfig.json",
@@ -112,6 +91,7 @@ APPLICATION_DEPS = [
":dgeni",
":stackblitz",
":example-zips",
"//aio/src/generated:ngsw-config",
"@aio_npm//@angular-devkit/build-angular",
"@aio_npm//@angular-eslint/builder",
"@aio_npm//@angular/animations",
+1 -1
View File
@@ -32,7 +32,7 @@
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"ngswConfigPath": "ngsw-config.json",
"ngswConfigPath": "src/generated/ngsw-config.json",
"tsConfig": "tsconfig.app.json",
"webWorkerTsConfig": "tsconfig.worker.json",
"optimization": {
+11
View File
@@ -0,0 +1,11 @@
load("@build_bazel_rules_nodejs//:index.bzl", "npm_package_bin")
package(default_visibility = ["//aio:__pkg__"])
# Generate ngsw-config
npm_package_bin(
name = "ngsw-config",
outs = ["ngsw-config.json"],
args = ["$@"],
tool = "//aio/scripts:build-ngsw-config",
)