diff --git a/.circleci/config.yml b/.circleci/config.yml index 7eb84168a4..4ce1cfd6a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,8 @@ ## IMPORTANT # If you change the `docker_image` version, also change the `cache_key` suffix and the version of # `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file. -var_1: &docker_image angular/ngcontainer:0.3.1 -var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.3.1 +var_1: &docker_image angular/ngcontainer:0.3.0 +var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.3.0 # Define common ENV vars var_3: &define_env_vars diff --git a/WORKSPACE b/WORKSPACE index 290243dc3e..7fc3008e67 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ http_archive( load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install") -check_bazel_version("0.14.0") +check_bazel_version("0.13.0") node_repositories(package_json = ["//:package.json"]) load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") diff --git a/integration/bazel/WORKSPACE b/integration/bazel/WORKSPACE index ac95a4132e..4dd7f9fa78 100644 --- a/integration/bazel/WORKSPACE +++ b/integration/bazel/WORKSPACE @@ -44,7 +44,7 @@ http_archive( load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories") -check_bazel_version("0.14.0") +check_bazel_version("0.13.0") node_repositories(package_json = ["//:package.json"]) load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") diff --git a/packages/bazel/src/ng_package/ng_package.bzl b/packages/bazel/src/ng_package/ng_package.bzl index 875b3728e7..0e74959433 100644 --- a/packages/bazel/src/ng_package/ng_package.bzl +++ b/packages/bazel/src/ng_package/ng_package.bzl @@ -80,14 +80,14 @@ def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, for map_output = ctx.actions.declare_file(js_output.basename + ".map", sibling = js_output) args = ctx.actions.args() - args.add("--config", rollup_config) + args.add(["--config", rollup_config.path]) - args.add("--input", entry_point) - args.add("--output.file", js_output) - args.add("--output.format", format) + args.add(["--input", entry_point]) + args.add(["--output.file", js_output.path]) + args.add(["--output.format", format]) if package_name: - args.add("--output.name", _global_name(package_name)) - args.add("--amd.id", package_name) + args.add(["--output.name", _global_name(package_name)]) + args.add(["--amd.id", package_name]) # Note: if the input has external source maps then we need to also install and use # `rollup-plugin-sourcemaps`, which will require us to use rollup.config.js file instead @@ -95,15 +95,14 @@ def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, for args.add("--sourcemap") globals = dict(WELL_KNOWN_GLOBALS, **ctx.attr.globals) + args.add("--external") external = globals.keys() if not include_tslib: external.append("tslib") - args.add_joined("--external", external, join_with=",") + args.add(external, join_with=",") - args.add_joined( - "--globals", - ["%s:%s" % g for g in globals.items()], - join_with=",") + args.add("--globals") + args.add(["%s:%s" % g for g in globals.items()], join_with=",") args.add("--silent") @@ -252,8 +251,8 @@ def _ng_package_impl(ctx): # The order of arguments matters here, as they are read in order in packager.ts. packager_args.add(npm_package_directory.path) packager_args.add(ctx.label.package) - packager_args.add_joined([ctx.bin_dir.path, ctx.label.package], join_with="/") - packager_args.add_joined([ctx.genfiles_dir.path, ctx.label.package], join_with="/") + packager_args.add([ctx.bin_dir.path, ctx.label.package], join_with="/") + packager_args.add([ctx.genfiles_dir.path, ctx.label.package], join_with="/") # Marshal the metadata into a JSON string so we can parse the data structure # in the TypeScript program easily. @@ -274,19 +273,19 @@ def _ng_package_impl(ctx): # placeholder packager_args.add("") - packager_args.add_joined(_flatten_paths(fesm2015), join_with=",") - packager_args.add_joined(_flatten_paths(fesm5), join_with=",") - packager_args.add_joined(_flatten_paths(esm2015), join_with=",") - packager_args.add_joined(_flatten_paths(esm5), join_with=",") - packager_args.add_joined(_flatten_paths(bundles), join_with=",") - packager_args.add_joined([s.path for s in ctx.files.srcs], join_with=",") + packager_args.add(_flatten_paths(fesm2015), join_with=",") + packager_args.add(_flatten_paths(fesm5), join_with=",") + packager_args.add(_flatten_paths(esm2015), join_with=",") + packager_args.add(_flatten_paths(esm5), join_with=",") + packager_args.add(_flatten_paths(bundles), join_with=",") + packager_args.add([s.path for s in ctx.files.srcs], join_with=",") # TODO: figure out a better way to gather runfiles providers from the transitive closure. - packager_args.add_joined([d.path for d in ctx.files.data], join_with=",") + packager_args.add([d.path for d in ctx.files.data], join_with=",") if ctx.file.license_banner: packager_inputs.append(ctx.file.license_banner) - packager_args.add(ctx.file.license_banner) + packager_args.add(ctx.file.license_banner.path) else: # placeholder packager_args.add("") diff --git a/packages/bazel/src/ng_rollup_bundle.bzl b/packages/bazel/src/ng_rollup_bundle.bzl index 66603099d2..e4584d6133 100644 --- a/packages/bazel/src/ng_rollup_bundle.bzl +++ b/packages/bazel/src/ng_rollup_bundle.bzl @@ -48,7 +48,7 @@ def _use_plain_rollup(ctx): strategy = ctx.var['compile'] return strategy != 'legacy' - + def run_brotli(ctx, input, output): ctx.actions.run( @@ -61,10 +61,10 @@ def run_brotli(ctx, input, output): # Borrowed from bazelbuild/rules_nodejs def _run_tsc(ctx, input, output): args = ctx.actions.args() - args.add("--target", "es5") + args.add(["--target", "es5"]) args.add("--allowJS") - args.add(input) - args.add("--outFile", output) + args.add(input.path) + args.add(["--outFile", output.path]) ctx.action( executable = ctx.executable._tsc, diff --git a/tools/ngcontainer/Dockerfile b/tools/ngcontainer/Dockerfile index f5df95ce06..0c3f41421f 100644 --- a/tools/ngcontainer/Dockerfile +++ b/tools/ngcontainer/Dockerfile @@ -19,7 +19,7 @@ RUN JAVA_DEBIAN_VERSION="8u131-b11-1~bpo8+1" \ ### # Bazel install # See https://bazel.build/versions/master/docs/install-ubuntu.html#using-bazel-custom-apt-repository-recommended -RUN BAZEL_VERSION="0.14.0" \ +RUN BAZEL_VERSION="0.13.0" \ && wget -q -O - https://bazel.build/bazel-release.pub.gpg | apt-key add - \ && echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list \ && apt-get update \ diff --git a/tools/ngcontainer/README.md b/tools/ngcontainer/README.md index 468f8aa87f..0a9e0e9d9e 100644 --- a/tools/ngcontainer/README.md +++ b/tools/ngcontainer/README.md @@ -6,7 +6,7 @@ This docker container provides everything needed to build and test Angular appli - npm 5.5.1 - yarn 1.3.2 - Java 8 (for Closure Compiler and Bazel) -- Bazel build tool v0.14.0 - http://bazel.build +- Bazel build tool v0.13.0 - http://bazel.build - Google Chrome 63.0.3239.84 - Mozilla Firefox 47.0.1 - xvfb (virtual framebuffer) for headless testing