Skip to content

Commit e6bdbf2

Browse files
committed
Stop execution if create nuget failed.
1 parent 8d5cdcb commit e6bdbf2

File tree

2 files changed

+38
-14
lines changed

2 files changed

+38
-14
lines changed

run.py

+25-14
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,19 @@ def actionPublishNuget():
144144
PublishNuget.init()
145145
for target in Settings.targets:
146146
for platform in Settings.targetPlatforms:
147-
Logger.printStartActionMessage("Publish Nuget for " + target + ' ' + platform)
148-
result = PublishNuget.run()
149-
if result != NO_ERROR:
150-
Logger.printEndActionMessage('Failed to publish NuGet package ' + target + ' ' + platform,ColoredFormatter.RED)
151-
#Terminate script execution if stopExecutionOnError is set to True in userdef
152-
shouldEndOnError(result)
147+
if not Summary.checkIfCreateNugetFailed(target, platform):
148+
Logger.printStartActionMessage("Publish Nuget for " + target + ' ' + platform)
149+
result = PublishNuget.run()
150+
if result != NO_ERROR:
151+
Logger.printEndActionMessage('Failed to publish NuGet package ' + target + ' ' + platform,ColoredFormatter.RED)
152+
#Terminate script execution if stopExecutionOnError is set to True in userdef
153+
shouldEndOnError(result)
154+
else:
155+
Logger.printEndActionMessage('Publish Nuget for ' + target + ' ' + platform)
153156
else:
154-
Logger.printEndActionMessage('Publish Nuget for ' + target + ' ' + platform)
157+
Logger.printColorMessage('Publish Nuget cannot run because Create Nuget has failed for ' + target + ' ' + platform,ColoredFormatter.YELLOW)
158+
Logger.printEndActionMessage('Publish Nuget not run for ' + target + ' ' + platform,ColoredFormatter.YELLOW)
159+
155160

156161
def actionReleaseNotes():
157162
ReleaseNotes.select_input()
@@ -174,14 +179,20 @@ def actionUploadBackup():
174179

175180
def actionUpdatePublishedSample():
176181
UpdateSample.init()
177-
Logger.printStartActionMessage("Update published sample")
178-
result = UpdateSample.run()
179-
if result != NO_ERROR:
180-
Logger.printEndActionMessage('Failed to update sample!')
181-
#Terminate script execution if stopExecutionOnError is set to True in userdef
182-
shouldEndOnError(result)
182+
if not Summary.checkIfCreateNugetFailed('webrtc', 'winuwp'):
183+
Logger.printStartActionMessage("Update published sample")
184+
result = UpdateSample.run()
185+
if result != NO_ERROR:
186+
Logger.printEndActionMessage('Failed to update sample!')
187+
#Terminate script execution if stopExecutionOnError is set to True in userdef
188+
shouldEndOnError(result)
189+
else:
190+
Logger.printEndActionMessage('Update published sample')
183191
else:
184-
Logger.printEndActionMessage('Update published sample')
192+
Logger.printColorMessage('Update published sample cannot run because Create Nuget has failed',ColoredFormatter.YELLOW)
193+
Logger.printEndActionMessage('Update published sample not run',ColoredFormatter.YELLOW)
194+
195+
185196

186197
def shouldEndOnError(error):
187198
"""

summary.py

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ def addNugetSummary(cls, target, platform, result, time = 0):
3232

3333
cls.action_results['createNuget'] = resultActionDict
3434

35+
@classmethod
36+
def checkIfCreateNugetFailed(cls, target, platform):
37+
ret = False
38+
actionDict = cls.action_results.get('createNuget',None)
39+
if actionDict != None:
40+
key = target + '___' + platform
41+
resultDict = actionDict.get(key,None)
42+
if resultDict != None:
43+
if resultDict['result'] != NO_ERROR:
44+
ret = True
45+
46+
return ret
47+
3548
@classmethod
3649
def printSummary(cls, executionTime = 0):
3750
Logger.printColorMessage('\n========================================= SUMMARY ========================================= \n', ColoredFormatter.YELLOW)

0 commit comments

Comments
 (0)