Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ jobs:
- job_007
- job_008
job_013:
name: "unit_test; linux; Dart dev; PKG: _test; `pub run build_runner test -- -p chrome --test-randomize-ordering-seed=random`, `pub run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random`"
name: "unit_test; linux; Dart dev; PKG: _test; `dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random`, `dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -589,14 +589,14 @@ jobs:
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test
run: dart pub upgrade
- name: "_test; pub run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
- name: "_test; dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
if: "always() && steps._test_pub_upgrade.conclusion == 'success'"
working-directory: _test
run: "pub run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
- name: "_test; pub run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
- name: "_test; dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
if: "always() && steps._test_pub_upgrade.conclusion == 'success'"
working-directory: _test
run: "pub run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
needs:
- job_001
- job_002
Expand Down Expand Up @@ -1122,7 +1122,7 @@ jobs:
- job_007
- job_008
job_029:
name: "unit_test; windows; Dart dev; PKG: _test; `pub run build_runner test -- -p chrome --test-randomize-ordering-seed=random`, `pub run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random`"
name: "unit_test; windows; Dart dev; PKG: _test; `dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random`, `dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
- uses: dart-lang/[email protected]
Expand All @@ -1135,14 +1135,14 @@ jobs:
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test
run: dart pub upgrade
- name: "_test; pub run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
- name: "_test; dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
if: "always() && steps._test_pub_upgrade.conclusion == 'success'"
working-directory: _test
run: "pub.bat run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
- name: "_test; pub run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random"
- name: "_test; dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
if: "always() && steps._test_pub_upgrade.conclusion == 'success'"
working-directory: _test
run: "pub.bat run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random"
needs:
- job_001
- job_002
Expand Down Expand Up @@ -1627,7 +1627,7 @@ jobs:
- job_038
- job_039
job_043:
name: "e2e_test; linux; Dart dev; PKG: _test_null_safety; `pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
name: "e2e_test; linux; Dart dev; PKG: _test_null_safety; `dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -1650,14 +1650,14 @@ jobs:
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_null_safety
run: dart pub upgrade
- name: "_test_null_safety; pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
needs:
- job_001
- job_002
Expand Down Expand Up @@ -2213,7 +2213,7 @@ jobs:
- job_038
- job_039
job_052:
name: "e2e_test; windows; Dart dev; PKG: _test_null_safety; `pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
name: "e2e_test; windows; Dart dev; PKG: _test_null_safety; `dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
- uses: dart-lang/[email protected]
Expand All @@ -2226,14 +2226,14 @@ jobs:
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_null_safety
run: dart pub upgrade
- name: "_test_null_safety; pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub.bat run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub.bat run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
needs:
- job_001
- job_002
Expand Down Expand Up @@ -2357,7 +2357,7 @@ jobs:
- job_051
- job_052
job_054:
name: "e2e_test_cron; linux; Dart main; PKG: _test_null_safety; `pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
name: "e2e_test_cron; linux; Dart main; PKG: _test_null_safety; `dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -2380,14 +2380,14 @@ jobs:
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_null_safety
run: dart pub upgrade
- name: "_test_null_safety; pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
if: "github.event_name == 'schedule'"
needs:
- job_001
Expand Down Expand Up @@ -2515,7 +2515,7 @@ jobs:
- job_051
- job_052
job_056:
name: "e2e_test_cron; windows; Dart main; PKG: _test_null_safety; `pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
name: "e2e_test_cron; windows; Dart main; PKG: _test_null_safety; `dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random`, `dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random`"
runs-on: windows-latest
steps:
- uses: dart-lang/[email protected]
Expand All @@ -2528,14 +2528,14 @@ jobs:
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_null_safety
run: dart pub upgrade
- name: "_test_null_safety; pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub.bat run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; pub run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random"
- name: "_test_null_safety; dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
if: "always() && steps._test_null_safety_pub_upgrade.conclusion == 'success'"
working-directory: _test_null_safety
run: "pub.bat run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
run: "dart run build_runner test --define=\"build_web_compilers:entrypoint=compiler=dart2js\" -- -p chrome --test-randomize-ordering-seed=random"
if: "github.event_name == 'schedule'"
needs:
- job_001
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ TODO: scratch_space
The [example](https://github.com/dart-lang/build/tree/master/example)
directory has an example of a build with custom builders which generate outputs
into both the source tree and a hidden generated directory. Try a build with
`pub run build_runner build -o web:deploy` to see what the output looks like.
`dart run build_runner build -o web:deploy` to see what the output looks like.

Most projects should not need custom builders.
4 changes: 2 additions & 2 deletions _test/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ stages:
os: linux
- unit_test:
- group:
- command: pub run build_runner test -- -p chrome --test-randomize-ordering-seed=random
- command: pub run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random
- command: dart run build_runner test -- -p chrome --test-randomize-ordering-seed=random
- command: dart run build_runner test -- -p vm test/configurable_uri_test.dart --test-randomize-ordering-seed=random
- e2e_test:
- test: --total-shards 3 --shard-index 0 --test-randomize-ordering-seed=random
os: linux
Expand Down
16 changes: 7 additions & 9 deletions _test/test/common/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ Process? _process;
Stream<String>? _stdOutLines;
Stream<String>? get stdOutLines => _stdOutLines;

final String _pubBinary = Platform.isWindows ? 'pub.bat' : 'pub';

/// Runs a single build using `pub run build_runner build`, and returns the
/// Runs a single build using `dart run build_runner build`, and returns the
/// [ProcessResult].
Future<ProcessResult> runBuild({List<String> trailingArgs = const []}) =>
_runBuild(_pubBinary, ['run', 'build_runner', 'build', ...trailingArgs]);
_runBuild('dart', ['run', 'build_runner', 'build', ...trailingArgs]);

/// Runs `pub run build_runner <args>`, and returns the [ProcessResult].
/// Runs `dart run build_runner <args>`, and returns the [ProcessResult].
Future<ProcessResult> runCommand(List<String> args) =>
_runBuild(_pubBinary, ['run', 'build_runner', ...args]);
_runBuild('dart', ['run', 'build_runner', ...args]);

/// Runs `pub run build_runner serve` in this package, and waits for the first
/// Runs `dart run build_runner serve` in this package, and waits for the first
/// build to complete.
///
/// To ensure a clean build, set [ensureCleanBuild] to `true`.
Expand Down Expand Up @@ -163,7 +161,7 @@ Future<TestProcess> runTests(
{bool? usePrecompiled,
List<String>? buildArgs,
List<String>? testArgs}) async {
return _runTests(_pubBinary, ['run', 'build_runner'],
return _runTests('dart', ['run', 'build_runner'],
usePrecompiled: usePrecompiled, buildArgs: buildArgs, testArgs: testArgs);
}

Expand All @@ -184,7 +182,7 @@ Future<TestProcess> _runTests(String executable, List<String> scriptArgs,
return TestProcess.start(executable, args);
} else {
var args = ['run', 'test', '--pub-serve', '8081', ...testArgs];
return TestProcess.start(_pubBinary, args);
return TestProcess.start('dart', args);
}
}

Expand Down
10 changes: 5 additions & 5 deletions _test/test/help_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ import 'package:test/test.dart';
import 'common/utils.dart';

void main() {
test('pub run build_runner help', () async {
test('dart run build_runner help', () async {
await _testHelpCommand(['help'],
checkContent: 'Unified interface for running Dart builds.');
await _testHelpCommand(['--help'],
checkContent: 'Unified interface for running Dart builds.');
});

test('pub run build_runner build --help', () async {
test('dart run build_runner build --help', () async {
await _testHelpCommand(['build', '--help'],
checkContent: 'Performs a single build on the specified targets');
await _testHelpCommand(['help', 'build'],
checkContent: 'Performs a single build on the specified targets');
});

test('pub run build_runner serve --help', () async {
test('dart run build_runner serve --help', () async {
await _testHelpCommand(['serve', '--help'],
checkContent: 'Runs a development server');
await _testHelpCommand(['help', 'serve'],
checkContent: 'Runs a development server');
});

test('pub run build_runner test --help', () async {
test('dart run build_runner test --help', () async {
await _testHelpCommand(['test', '--help'],
checkContent: 'and then runs tests using');
await _testHelpCommand(['help', 'test'],
checkContent: 'and then runs tests using');
});

test('pub run build_runner watch --help', () async {
test('dart run build_runner watch --help', () async {
await _testHelpCommand(['watch', '--help'],
checkContent: 'watching the file system for updates');
await _testHelpCommand(['help', 'watch'],
Expand Down
8 changes: 4 additions & 4 deletions _test_null_safety/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ stages:
dart: dev
- e2e_test:
- group:
- command: pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random
- command: pub run build_runner test --define="build_web_compilers:entrypoint=compiler=dart2js" -- -p chrome --test-randomize-ordering-seed=random
- command: dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random
- command: dart run build_runner test --define="build_web_compilers:entrypoint=compiler=dart2js" -- -p chrome --test-randomize-ordering-seed=random
# This stage is configured to only run for scheduled builds (see mono_repo.yaml)
- e2e_test_cron:
- group:
- command: pub run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random
- command: pub run build_runner test --define="build_web_compilers:entrypoint=compiler=dart2js" -- -p chrome --test-randomize-ordering-seed=random
- command: dart run build_runner test -- -p chrome,vm --test-randomize-ordering-seed=random
- command: dart run build_runner test --define="build_web_compilers:entrypoint=compiler=dart2js" -- -p chrome --test-randomize-ordering-seed=random
dart:
- be/raw/latest
2 changes: 2 additions & 0 deletions build_runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 2.1.2-dev

## 2.1.1

- Don't rethrow file watcher errors - instead log at severe level and continue
Expand Down
Loading