--- a/codesys-ide/scripts/build-bootapp.py +++ b/codesys-ide/scripts/build-bootapp.py @@ -1,6 +1,8 @@ import sys, os import helper +# compile category GUID +CompileCategory = Guid("{97F48D64-A2A3-4856-B640-75C046E37EA9}") class SearchBuildDo(helper.SearchBuild): # Build rules for: @@ -19,7 +21,26 @@ proj = projects.open(filename) helper.update_device(proj, device_repository) helper.install_missing_libraries(proj, librarymanager) - proj.active_application.create_boot_application(destination) + try: + proj.active_application.create_boot_application(os.path.basename(destination)) + #proj.active_application.create_boot_application(destination) + except: + print("Error: Creation of bootapplication failed") + # Get message objects which contain all the data + severities = { + Severity.FatalError : "Fatal error", Severity.Error : "Error", + Severity.Warning : "Warning", Severity.Information : "Information", + Severity.Text : "Text" + } + msgs = system.get_message_objects(CompileCategory, Severity.FatalError|Severity.Error) + xError = False + for msg in msgs: + sev = severities[msg.severity] + if msg.severity == Severity.FatalError: + xError = True + print("%s %s%s: %s" % (sev, msg.prefix, msg.number, msg.text)) + if xError: + return None proj.close() return artifacts