@@ -135,6 +135,7 @@ public boolean invokeBuild(int kind, String targetName, IAutoBuildConfigurationD
135
135
epm .deferDeDuplication ();
136
136
int sequenceID = -1 ;
137
137
boolean lastSequenceID = true ;
138
+ myHasBuildError = false ;
138
139
139
140
// Run preBuildStep if existing
140
141
LinkedHashMap <String ,String > preBuildSteps = autoData .getPrebuildSteps ();
@@ -147,13 +148,14 @@ public boolean invokeBuild(int kind, String targetName, IAutoBuildConfigurationD
147
148
}
148
149
buildRunnerHelper .toConsole (command );
149
150
if (launchCommand (command , autoData , monitor , buildRunnerHelper ) != 0 ) {
151
+ myHasBuildError = true ;
150
152
if (autoData .stopOnFirstBuildError ()) {
151
153
return false ;
152
154
}
153
155
}
154
156
}
155
157
156
- myHasBuildError = false ;
158
+
157
159
do {
158
160
sequenceID ++;
159
161
lastSequenceID = true ;
@@ -218,35 +220,36 @@ public boolean invokeBuild(int kind, String targetName, IAutoBuildConfigurationD
218
220
lastSequenceID = true ;
219
221
}
220
222
} while (!(lastSequenceID || myHasBuildError ));
221
- // Run postBuildStep if existing
222
223
223
- LinkedHashMap <String ,String > postBuildSteps = autoData .getPostbuildSteps ();
224
- for (Entry <String , String > step :postBuildSteps .entrySet ()) {
225
- String announcement = step .getKey ();
226
- String command = step .getValue ();
224
+ // Run postBuildStep if existing and no error
225
+ if (!myHasBuildError ) {
226
+ LinkedHashMap <String , String > postBuildSteps = autoData .getPostbuildSteps ();
227
+ for (Entry <String , String > step : postBuildSteps .entrySet ()) {
228
+ String announcement = step .getKey ();
229
+ String command = step .getValue ();
227
230
228
- if (!announcement .isEmpty ()) {
229
- buildRunnerHelper .toConsole (announcement );
230
- }
231
- buildRunnerHelper .toConsole (command );
232
- if (launchCommand (command , autoData , monitor , buildRunnerHelper ) != 0 ) {
233
- if (autoData .stopOnFirstBuildError ()) {
234
- return false ;
231
+ if (!announcement .isEmpty ()) {
232
+ buildRunnerHelper .toConsole (announcement );
233
+ }
234
+ buildRunnerHelper .toConsole (command );
235
+ if (launchCommand (command , autoData , monitor , buildRunnerHelper ) != 0 ) {
236
+ if (autoData .stopOnFirstBuildError ()) {
237
+ return false ;
238
+ }
235
239
}
236
240
}
237
- }
238
241
239
-
240
- String postBuildStep = autoData . getPostbuildStep ( );
241
- postBuildStep = resolve ( postBuildStep , EMPTY_STRING , WHITESPACE , autoData );
242
- if (! postBuildStep . isEmpty ()) {
243
- String announcement = autoData . getPostBuildAnouncement ();
244
- if (! announcement . isEmpty ()) {
245
- buildRunnerHelper . toConsole ( announcement );
246
- }
247
- buildRunnerHelper . toConsole ( postBuildStep );
248
- if ( launchCommand ( postBuildStep , autoData , monitor , buildRunnerHelper ) != 0 ) {
249
- return false ;
242
+ String postBuildStep = autoData . getPostbuildStep ();
243
+ postBuildStep = resolve ( postBuildStep , EMPTY_STRING , WHITESPACE , autoData );
244
+ if (! postBuildStep . isEmpty ()) {
245
+ String announcement = autoData . getPostBuildAnouncement ();
246
+ if (! announcement . isEmpty ()) {
247
+ buildRunnerHelper . toConsole ( announcement );
248
+ }
249
+ buildRunnerHelper . toConsole ( postBuildStep );
250
+ if ( launchCommand ( postBuildStep , autoData , monitor , buildRunnerHelper ) != 0 ) {
251
+ return false ;
252
+ }
250
253
}
251
254
}
252
255
}
0 commit comments