File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed
build_runner/lib/src/compiler Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,17 @@ class BootstrapAction {
33
33
final result = await run ();
34
34
35
35
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
+ );
40
42
}
41
43
if (result._content != null ) {
42
- File (outputPath).writeAsStringSync (result._content);
44
+ File (outputPath)
45
+ ..createSync (recursive: true )
46
+ ..writeAsStringSync (result._content);
43
47
}
44
48
File (_digestsPath).writeAsStringSync (computeDigests ());
45
49
return result;
Original file line number Diff line number Diff line change @@ -8,22 +8,24 @@ import 'dart:io';
8
8
import 'bootstrap_action.dart' ;
9
9
10
10
void main (List <String > arguments) async {
11
- await Compiler ().compile (arguments[ 0 ] );
11
+ await Compiler ().compile ();
12
12
}
13
13
14
14
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 (),
17
17
);
18
18
19
19
class Compiler {
20
- Future <BootstrapActionResult > compile (String path ) async {
20
+ Future <BootstrapActionResult > compile () async {
21
21
final result = await Process .run ('dart' , [
22
22
'compile' ,
23
23
'kernel' ,
24
- path,
24
+ '.dart_tool/build/entrypoint/build.dart' ,
25
+ '--output' ,
26
+ '.dart_tool/build/entrypoint/build.dart.dill' ,
25
27
'--depfile' ,
26
- '$ path .deps' ,
28
+ '.dart_tool/build/entrypoint/build.dart.dill .deps' ,
27
29
]);
28
30
if (result.exitCode != 0 ) {
29
31
print ('Compile failed: ${result .stdout } ${result .stderr }' );
You can’t perform that action at this time.
0 commit comments