Added native Bazel build to GUI2. Reduced a lot of the unused Angular CLI structures
Reviewers should look at the changes in WORKSPACE, BUILD, BUILD.bazel, README.md files
This is only possible now as rules_nodejs went to 1.0.0 on December 20
gui2 has now been made the entry point (rather than gui2-fw-lib)
No tests or linting are functional yet for Typescript
Each NgModule now has its own BUILD.bazel file with ng_module
gui2-fw-lib is all one module and has been refactored to simplify the directory structure
gui2-topo-lib is also all one module - its directory structure has had 3 layers removed
The big bash script in web/gui2/BUILD has been removed - all is done through ng_module rules
in web/gui2/src/main/webapp/BUILD.bazel and web/gui2/src/main/webapp/app/BUILD.bazel
Change-Id: Ifcfcc23a87be39fe6d6c8324046cc8ebadb90551
diff --git a/web/gui2-fw-lib/patches/@angular+bazel+9.0.0-rc.7.patch b/web/gui2-fw-lib/patches/@angular+bazel+9.0.0-rc.7.patch
new file mode 100644
index 0000000..89fa345
--- /dev/null
+++ b/web/gui2-fw-lib/patches/@angular+bazel+9.0.0-rc.7.patch
@@ -0,0 +1,51 @@
+diff --git a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
+index ccda5a5..00f1624 100755
+--- a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
++++ b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
+@@ -15,9 +15,9 @@ specification of this format at https://goo.gl/jB3GVv
+
+ load("@build_bazel_rules_nodejs//:providers.bzl", "JSEcmaScriptModuleInfo", "JSNamedModuleInfo", "NpmPackageInfo", "node_modules_aspect")
+ load(
+- "@build_bazel_rules_nodejs//internal/npm_package:npm_package.bzl",
+- "NPM_PACKAGE_ATTRS",
+- "NPM_PACKAGE_OUTPUTS",
++ "@build_bazel_rules_nodejs//internal/pkg_npm:pkg_npm.bzl",
++ "PKG_NPM_ATTRS",
++ "PKG_NPM_OUTPUTS",
+ "create_package",
+ )
+ load("//src:external.bzl", "FLAT_DTS_FILE_SUFFIX")
+@@ -619,7 +619,7 @@ def _ng_package_impl(ctx):
+ if JSNamedModuleInfo in dep:
+ devfiles = depset(transitive = [devfiles, dep[JSNamedModuleInfo].sources])
+
+- # Re-use the create_package function from the nodejs npm_package rule.
++ # Re-use the create_package function from the nodejs pkg_npm rule.
+ package_dir = create_package(
+ ctx,
+ devfiles.to_list(),
+@@ -631,7 +631,7 @@ def _ng_package_impl(ctx):
+
+ _NG_PACKAGE_DEPS_ASPECTS = [esm5_outputs_aspect, ng_package_module_mappings_aspect, node_modules_aspect]
+
+-_NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **{
++_NG_PACKAGE_ATTRS = dict(PKG_NPM_ATTRS, **{
+ "srcs": attr.label_list(
+ doc = """JavaScript source files from the workspace.
+ These can use ES2015 syntax and ES Modules (import/export)""",
+@@ -807,12 +807,12 @@ def _ng_package_outputs(name, entry_point, entry_point_name):
+ "umd": "%s.umd.js" % basename,
+ "umd_min": "%s.umd.min.js" % basename,
+ }
+- for key in NPM_PACKAGE_OUTPUTS:
+- # NPM_PACKAGE_OUTPUTS is a "normal" dict-valued outputs so it looks like
++ for key in PKG_NPM_OUTPUTS:
++ # PKG_NPM_OUTPUTS is a "normal" dict-valued outputs so it looks like
+ # "pack": "%{name}.pack",
+ # But this is a function-valued outputs.
+ # Bazel won't replace the %{name} token so we have to do it.
+- outputs[key] = NPM_PACKAGE_OUTPUTS[key].replace("%{name}", name)
++ outputs[key] = PKG_NPM_OUTPUTS[key].replace("%{name}", name)
+ return outputs
+
+ ng_package = rule(