a/codesys-ide/scripts/build-bootapp.py | b/codesys-ide/scripts/build-bootapp.py | ||
---|---|---|---|
1 | import sys, os |
1 | import sys, os |
2 | import helper |
2 | import helper |
3 | 3 | ||
4 | # compile category GUID |
||
5 | CompileCategory = Guid("{97F48D64-A2A3-4856-B640-75C046E37EA9}") |
||
4 | 6 | ||
5 | class SearchBuildDo(helper.SearchBuild): |
7 | class SearchBuildDo(helper.SearchBuild): |
6 | # Build rules for: |
8 | # Build rules for: |
7 | # - *.project -> *.app (boot application) |
9 | # - *.project -> *.app (boot application) |
8 | def doit(self, filename): |
10 | def doit(self, filename): |
... |
... |
||
17 | print("%s -> %s\n" % (filename, destination)) |
19 | print("%s -> %s\n" % (filename, destination)) |
18 | 20 | ||
19 | proj = projects.open(filename) |
21 | proj = projects.open(filename) |
20 | helper.update_device(proj, device_repository) |
22 | helper.update_device(proj, device_repository) |
21 | helper.install_missing_libraries(proj, librarymanager) |
23 | helper.install_missing_libraries(proj, librarymanager) |
22 | proj.active_application.create_boot_application(destination) |
24 | try: |
25 | proj.active_application.create_boot_application(os.path.basename(destination)) |
||
26 | #proj.active_application.create_boot_application(destination) |
||
27 | except: |
||
28 | print("Error: Creation of bootapplication failed") |
||
29 | # Get message objects which contain all the data |
||
30 | severities = { |
||
31 | Severity.FatalError : "Fatal error", Severity.Error : "Error", |
||
32 | Severity.Warning : "Warning", Severity.Information : "Information", |
||
33 | Severity.Text : "Text" |
||
34 | } |
||
35 | msgs = system.get_message_objects(CompileCategory, Severity.FatalError|Severity.Error) |
||
36 | xError = False |
||
37 | for msg in msgs: |
||
38 | sev = severities[msg.severity] |
||
39 | if msg.severity == Severity.FatalError: |
||
40 | xError = True |
||
41 | print("%s %s%s: %s" % (sev, msg.prefix, msg.number, msg.text)) |
||
42 | if xError: |
||
43 | return None |
||
23 | proj.close() |
44 | proj.close() |
24 | 45 | ||
25 | return artifacts |
46 | return artifacts |
26 | 47 | ||
27 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
48 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
... |
... |
||
32 | 53 | ||
33 | 54 |