@@ -28,12 +28,13 @@ def _typedast_impl(ctx):
28
28
fail ("name must end with _typedast" )
29
29
30
30
typedast_file = ctx .actions .declare_file (name [:- len ("_typedast" )] + ".typedast" )
31
+ typedast_gz_file = ctx .actions .declare_file (name [:- len ("_typedast" )] + ".typedast.gz" )
31
32
32
- outputs = []
33
- inputs = []
33
+ compiler_outputs = []
34
+ compiler_inputs = []
34
35
args = ctx .actions .args ()
35
36
36
- inputs .extend (ctx .files ._jdk )
37
+ compiler_inputs .extend (ctx .files ._jdk )
37
38
args .add_all ([
38
39
"--checks_only" ,
39
40
"--strict_mode_input" ,
@@ -43,22 +44,28 @@ def _typedast_impl(ctx):
43
44
"--jscomp_error=checkTypes" ,
44
45
"--jscomp_off=uselessCode" ,
45
46
])
46
- args .add (typedast_file , format = "--typed_ast_output_file__INTENRNAL_USE_ONLY=%s" )
47
- outputs .append (typedast_file )
47
+ args .add (typedast_gz_file , format = "--typed_ast_output_file__INTENRNAL_USE_ONLY=%s" )
48
+ compiler_outputs .append (typedast_gz_file )
48
49
args .add_all (ctx .files .srcs , format_each = "--js=%s" )
49
- inputs .extend (ctx .files .srcs )
50
+ compiler_inputs .extend (ctx .files .srcs )
50
51
51
52
ctx .actions .run (
52
- outputs = outputs ,
53
- inputs = inputs ,
53
+ outputs = compiler_outputs ,
54
+ inputs = compiler_inputs ,
54
55
executable = ctx .executable .compiler ,
55
56
arguments = [args ],
56
57
mnemonic = "TypedAST" ,
57
58
)
58
59
60
+ ctx .actions .run_shell (
61
+ outputs = [typedast_file ],
62
+ inputs = [typedast_gz_file ],
63
+ command = "gunzip -c '%s' > '%s'" % (typedast_gz_file .path , typedast_file .path ),
64
+ )
65
+
59
66
return [
60
67
DefaultInfo (
61
- files = depset (outputs ),
68
+ files = depset ([ typedast_file ] ),
62
69
),
63
70
]
64
71
0 commit comments