build: migrate references and scripts that set to build with ivy via compile=aot to use config=ivy (#33983)
Since config=ivy now sets the define=compile flag and the define=angular_ivy_enabled flag to cause usage of Ivy, we can update all of the documentation and scripts that reference compile=aot to use config=ivy. PR Close #33983
This commit is contained in:
parent
f9def8cd30
commit
5e3f6d203d
|
@ -37,7 +37,7 @@
|
||||||
"program": "${workspaceFolder}/node_modules/.bin/bazel",
|
"program": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test/acceptance",
|
"packages/core/test/acceptance",
|
||||||
"--config=debug"
|
"--config=debug"
|
||||||
],
|
],
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
"program": "${workspaceFolder}/node_modules/.bin/bazel",
|
"program": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test/render3",
|
"packages/core/test/render3",
|
||||||
"--config=debug"
|
"--config=debug"
|
||||||
],
|
],
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
"program": "${workspaceFolder}/node_modules/.bin/bazel",
|
"program": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test",
|
"packages/core/test",
|
||||||
"--config=debug"
|
"--config=debug"
|
||||||
],
|
],
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test",
|
"packages/core/test",
|
||||||
"packages/core/test/acceptance",
|
"packages/core/test/acceptance",
|
||||||
"packages/core/test/render3",
|
"packages/core/test/render3",
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test/acceptance",
|
"packages/core/test/acceptance",
|
||||||
],
|
],
|
||||||
"group": "test",
|
"group": "test",
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test",
|
"packages/core/test",
|
||||||
],
|
],
|
||||||
"group": "test",
|
"group": "test",
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
"command": "${workspaceFolder}/node_modules/.bin/bazel",
|
||||||
"args": [
|
"args": [
|
||||||
"test",
|
"test",
|
||||||
"--define=compile=aot",
|
"--config=ivy",
|
||||||
"packages/core/test/render3",
|
"packages/core/test/render3",
|
||||||
],
|
],
|
||||||
"group": "test",
|
"group": "test",
|
||||||
|
|
|
@ -59,17 +59,16 @@ keeps the outputs up-to-date as you save sources.
|
||||||
|
|
||||||
If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular.
|
If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular.
|
||||||
|
|
||||||
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=compile=legacy` is defined as default.
|
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=angular_ivy_enabled=False` is defined as default.
|
||||||
|
|
||||||
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
|
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
|
||||||
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
|
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
|
||||||
- `--define=compile=<option>` Controls if ivy or legacy mode is enabled. This switches which compiler is used (ngc, ngtsc, or a tsc pass-through mode).
|
- `--config=ivy` Enables ivy mode if present, otherwise ViewEngine is used. This switches which compiler is used (ngc or ngtsc)
|
||||||
- `legacy`: (default behavior) compile against View Engine, e.g. `--define=compile=legacy`
|
- `--config=view-engine` Enables ViewEngine mode if present, currentl this the default mode. This switches which compiler is used (ngc or ngtsc)
|
||||||
- `aot`: Compile in ivy AOT mode, e.g. `--define=compile=aot`
|
|
||||||
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config of your rules in any given `BUILD.bazel`.
|
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config of your rules in any given `BUILD.bazel`.
|
||||||
- `no-ivy-aot`: Useful for excluding build and test targets that are not meant to be executed in Ivy AOT mode (`--define=compile=aot`).
|
- `no-ivy-aot`: Useful for excluding build and test targets that are not meant to be executed in Ivy AOT mode (`--config=ivy`).
|
||||||
- `ivy-only`: Useful for excluding all Ivy build and tests targets with `--define=compile=legacy`.
|
- `ivy-only`: Useful for excluding all Ivy build and tests targets with `--config=view-engine`.
|
||||||
- `fixme-ivy-aot`: Useful for including/excluding build and test targets that are currently broken in Ivy AOT mode (`--define=compile=aot`).
|
- `fixme-ivy-aot`: Useful for including/excluding build and test targets that are currently broken in Ivy AOT mode (`--config=ivy`).
|
||||||
|
|
||||||
|
|
||||||
### Debugging a Node Test
|
### Debugging a Node Test
|
||||||
|
|
|
@ -20,7 +20,7 @@ node ./scripts/ci/update-deps-to-dist-packages.js {COMPONENTS_REPO}/package.json
|
||||||
following command:
|
following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn test --deleted_packages=//src/dev-app --define=compile=aot
|
yarn test --deleted_packages=//src/dev-app --config=ivy
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running tests for individual entry-points
|
### Running tests for individual entry-points
|
||||||
|
@ -31,10 +31,10 @@ and entry-points. Running tests for an individual entry-point is possible by exp
|
||||||
selecting a given test target.
|
selecting a given test target.
|
||||||
|
|
||||||
Here is an example of commands that run individual test targets. Note that it is
|
Here is an example of commands that run individual test targets. Note that it is
|
||||||
**important** to specify the `--define=compile=aot` flag in order to run tests with Ivy.
|
**important** to specify the `--config=ivy` flag in order to run tests with Ivy.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn bazel test --define=compile=aot src/material/slider:unit_tests
|
yarn bazel test --config=ivy src/material/slider:unit_tests
|
||||||
yarn bazel test --define=compile=aot src/cdk/a11y:unit_tests
|
yarn bazel test --config=ivy src/cdk/a11y:unit_tests
|
||||||
yarn bazel test --define=compile=aot src/material/toolbar:unit_tests
|
yarn bazel test --config=ivy src/material/toolbar:unit_tests
|
||||||
```
|
```
|
||||||
|
|
|
@ -24,14 +24,14 @@
|
||||||
"update-webdriver": "webdriver-manager update --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
|
"update-webdriver": "webdriver-manager update --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
|
||||||
"check-env": "gulp check-env",
|
"check-env": "gulp check-env",
|
||||||
"commitmsg": "node ./scripts/git/commit-msg.js",
|
"commitmsg": "node ./scripts/git/commit-msg.js",
|
||||||
"test-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot",
|
"test-ivy-aot": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot",
|
||||||
"test-non-ivy": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only",
|
"test-non-ivy": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only",
|
||||||
"test-fixme-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot --test_tag_filters=-no-ivy-aot",
|
"test-fixme-ivy-aot": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot --test_tag_filters=-no-ivy-aot",
|
||||||
"list-fixme-ivy-targets": "bazel query --output=label 'attr(\"tags\", \"\\[.*fixme-ivy.*\\]\", //...) except kind(\"sh_binary\", //...) except kind(\"devmode_js_sources\", //...)' | sort",
|
"list-fixme-ivy-targets": "bazel query --output=label 'attr(\"tags\", \"\\[.*fixme-ivy.*\\]\", //...) except kind(\"sh_binary\", //...) except kind(\"devmode_js_sources\", //...)' | sort",
|
||||||
"bazel": "bazel",
|
"bazel": "bazel",
|
||||||
"//circleci-win-comment": "See the test-win circleci job for why these are needed. If they are not needed anymore, remove them.",
|
"//circleci-win-comment": "See the test-win circleci job for why these are needed. If they are not needed anymore, remove them.",
|
||||||
"circleci-win-ve": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-browser:chromium-local //packages/compiler-cli/...",
|
"circleci-win-ve": "bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-browser:chromium-local //packages/compiler-cli/...",
|
||||||
"circleci-win-ivy": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //packages/compiler-cli/..."
|
"circleci-win-ivy": "bazel test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //packages/compiler-cli/..."
|
||||||
},
|
},
|
||||||
"// 1": "dependencies are used locally and by bazel",
|
"// 1": "dependencies are used locally and by bazel",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Tests in this directory should be run with:
|
Tests in this directory should be run with:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn bazel test --define=compile=aot packages/compiler-cli/test/compliance:compliance
|
yarn bazel test --config=ivy packages/compiler-cli/test/compliance:compliance
|
||||||
```
|
```
|
|
@ -17,7 +17,7 @@ import {getComponent, getContext, getDebugNode, getDirectives, getHostElement, g
|
||||||
*
|
*
|
||||||
* To see this in action run the following command:
|
* To see this in action run the following command:
|
||||||
*
|
*
|
||||||
* bazel run --define=compile=aot
|
* bazel run --config=ivy
|
||||||
* //packages/core/test/bundling/todo:devserver
|
* //packages/core/test/bundling/todo:devserver
|
||||||
*
|
*
|
||||||
* Then load `localhost:5432` and start using the console tools.
|
* Then load `localhost:5432` and start using the console tools.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --define=compile=aot
|
yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --config=ivy
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
@ -72,9 +72,9 @@ The resulting output should look something like this:
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
To run the benchmark use `bazel run <benchmark_target>`, example:
|
To run the benchmark use `bazel run <benchmark_target>`, example:
|
||||||
- `yarn bazel run --define=compile=aot //packages/core/test/render3/perf:noop_change_detection`
|
- `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection`
|
||||||
|
|
||||||
To profile, append `_profile` to the target name and attach a debugger via chrome://inspect, example:
|
To profile, append `_profile` to the target name and attach a debugger via chrome://inspect, example:
|
||||||
- `yarn bazel run --define=compile=aot //packages/core/test/render3/perf:noop_change_detection_profile`
|
- `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection_profile`
|
||||||
|
|
||||||
To interactively edit/rerun benchmarks use `ibazel` instead of `bazel`.
|
To interactively edit/rerun benchmarks use `ibazel` instead of `bazel`.
|
||||||
|
|
|
@ -29,7 +29,7 @@ const profileTests =
|
||||||
|
|
||||||
// build tests
|
// build tests
|
||||||
shell.exec(
|
shell.exec(
|
||||||
`yarn bazel build --define=compile=aot ` +
|
`yarn bazel build --config=ivy ` +
|
||||||
profileTests.map((name) => `//packages/core/test/render3/perf:${name}_lib.min_debug.es2015.js`)
|
profileTests.map((name) => `//packages/core/test/render3/perf:${name}_lib.min_debug.es2015.js`)
|
||||||
.join(' '));
|
.join(' '));
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
</script>
|
</script>
|
||||||
<body>
|
<body>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Build the benchmark using <tt>yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --define=compile=aot</tt></li>
|
<li>Build the benchmark using <tt>yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}.min_debug.es2015.js --config=ivy</tt></li>
|
||||||
<li>Open this file using the <tt>file://</tt> protocol and add <tt>?benchmark=BENCHMARK</tt> to the URL.</li>
|
<li>Open this file using the <tt>file://</tt> protocol and add <tt>?benchmark=BENCHMARK</tt> to the URL.</li>
|
||||||
<li>Open debug console for details</li>
|
<li>Open debug console for details</li>
|
||||||
</ol>
|
</ol>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue