Skip to content

Commit 8ea97fb

Browse files
committed
Okay now it works.
1 parent f0ce224 commit 8ea97fb

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

build_runner/lib/src/compiler/bootstrap_action.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ class BootstrapAction {
3333
final result = await run();
3434

3535
if (result._inputPaths != null) {
36-
File(_depsPath).writeAsStringSync(
37-
'$outputPath: '
38-
'${result._inputPaths.join(' ')}',
39-
);
36+
File(_depsPath)
37+
..createSync(recursive: true)
38+
..writeAsStringSync(
39+
'$outputPath: '
40+
'${result._inputPaths.join(' ')}',
41+
);
4042
}
4143
if (result._content != null) {
42-
File(outputPath).writeAsStringSync(result._content);
44+
File(outputPath)
45+
..createSync(recursive: true)
46+
..writeAsStringSync(result._content);
4347
}
4448
File(_digestsPath).writeAsStringSync(computeDigests());
4549
return result;

build_runner/lib/src/compiler/compiler.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,24 @@ import 'dart:io';
88
import 'bootstrap_action.dart';
99

1010
void main(List<String> arguments) async {
11-
await Compiler().compile(arguments[0]);
11+
await Compiler().compile();
1212
}
1313

1414
BootstrapAction compileToKernelBootstrapAction() => BootstrapAction(
15-
outputPath: '.dart_tool/build/entrypoint/build.dart',
16-
action: () => Compiler().compile('.dart_tool/build/entrypoint/build.dart'),
15+
outputPath: '.dart_tool/build/entrypoint/build.dart.dill',
16+
action: () => Compiler().compile(),
1717
);
1818

1919
class Compiler {
20-
Future<BootstrapActionResult> compile(String path) async {
20+
Future<BootstrapActionResult> compile() async {
2121
final result = await Process.run('dart', [
2222
'compile',
2323
'kernel',
24-
path,
24+
'.dart_tool/build/entrypoint/build.dart',
25+
'--output',
26+
'.dart_tool/build/entrypoint/build.dart.dill',
2527
'--depfile',
26-
'$path.deps',
28+
'.dart_tool/build/entrypoint/build.dart.dill.deps',
2729
]);
2830
if (result.exitCode != 0) {
2931
print('Compile failed: ${result.stdout} ${result.stderr}');

0 commit comments

Comments
 (0)