@@ -77,9 +77,9 @@ end class <basic-main-command>;
77
77
78
78
define method execute-main-command
79
79
(context :: <server-context>, command :: <basic-main-command>)
80
- => (status -code :: <integer> )
81
- local method run
82
- ( class :: subclass(<command>), #rest arguments) => ()
80
+ => (exit -code :: <integer> )
81
+ local method run ( class :: subclass(<command>), #rest arguments)
82
+ => (#rest values )
83
83
let command = apply (make , class , server: context, arguments);
84
84
execute-command(command)
85
85
end method run;
@@ -96,21 +96,25 @@ define method execute-main-command
96
96
run(<open-project-command>, file: filename)
97
97
end ;
98
98
let build? = command.%build?;
99
+ let exit-code = #f ;
99
100
if (build? | command.%compile?)
100
- run(<build-project-command>,
101
- clean?: command.%clean?,
102
- link?: #f ,
103
- release?: command.%release?,
104
- verbose?: command.%verbose?,
105
- subprojects: command.%subprojects?,
106
- output: begin
107
- let output = make (<stretchy-object-vector>);
108
- if (command.%assemble?) add! (output, # "assembler" ) end ;
109
- if (command.%dfm?) add! (output, # "dfm" ) end ;
110
- if (command.%harp?) add! (output, # "harp" ) end ;
111
- output
112
- end ,
113
- dispatch-coloring: command.%dispatch-coloring)
101
+ // The build command returns an error status for serious warnings. This
102
+ // makes it possible for scripting to abort on serious warnings.
103
+ exit-code
104
+ := run(<build-project-command>,
105
+ clean?: command.%clean?,
106
+ link?: #f ,
107
+ release?: command.%release?,
108
+ verbose?: command.%verbose?,
109
+ subprojects: command.%subprojects?,
110
+ output: begin
111
+ let output = make (<stretchy-object-vector>);
112
+ if (command.%assemble?) add! (output, # "assembler" ) end ;
113
+ if (command.%dfm?) add! (output, # "dfm" ) end ;
114
+ if (command.%harp?) add! (output, # "harp" ) end ;
115
+ output
116
+ end ,
117
+ dispatch-coloring: command.%dispatch-coloring);
114
118
end ;
115
119
if (build? | command.%link?)
116
120
let target = command.%target;
@@ -123,7 +127,7 @@ define method execute-main-command
123
127
subprojects: command.%subprojects?,
124
128
unify?: command.%unify?)
125
129
end ;
126
- $success-exit-code;
130
+ exit-code | $success-exit-code
127
131
end method execute-main-command;
128
132
129
133
define method execute-main-loop
0 commit comments