build: update to nodejs rules 0.34.0 and bazel 0.28.1 (#31824)

nodejs rules 0.34.0 now includes protractor_web_test_suite rule (via new @bazel/protractor rule) so we switch to that location for that rule in this PR so that /packages/bazel/src/protractor can be removed in a future PR

this PR also brings in node toolchain support which was released in nodejs rules 0.33.0. this is a prerequisite for RBE for mac & windows users

bazel schematics also updated with the same. @bazel/bazel 0.28.1 npm package includes transitive dep on hide-bazel-files so we're able to remove an explicit dep on that as well.

PR Close #31824
This commit is contained in:
Greg Magolan
2019-07-24 08:52:26 -07:00
committed by Andrew Kushnir
parent 5296c04f61
commit 5f0d5e9ccf
31 changed files with 243 additions and 282 deletions

View File

@ -11,9 +11,28 @@ const shx = require('shelljs');
const os = require('os');
const {runCommand, setupTestDirectory} = require('./test_helpers');
// Nodejs toolchains were included in nodejs rules 0.33.0 so the
// repository name for the nodejs toolchain now depends on the platform
// being run on. The following function returns the nodejs repository
// name of the runtime platform platform. These come from
// https://github.com/bazelbuild/rules_nodejs/blob/2a0be492c5d506665798f04673ab1a646c883626/internal/node/node_repositories.bzl#L598.
function nodejs_repository() {
switch (os.platform()) {
case 'darwin':
return 'nodejs_darwin_amd64';
case 'linux':
return 'nodejs_linux_amd64';
case 'win32':
return 'nodejs_windows_amd64';
default:
throw 'Platform not supported';
}
}
const ngcBin = require.resolve('./ngc_bin');
const xi18nBin = require.resolve('./ng_xi18n');
const nodeBin = require.resolve(`nodejs/bin/node${(os.platform() === 'win32' ? '.cmd' : '')}`);
const nodeBin =
require.resolve(`${nodejs_repository()}/bin/node${(os.platform() === 'win32' ? '.cmd' : '')}`);
const jasmineBin = require.resolve('npm/node_modules/jasmine/bin/jasmine.js');
// Prepare the test directory before building the integration test output. This ensures that