a | b/codesys-ide/scripts/build-bootapp.py | ||
---|---|---|---|
1 | import sys, os |
||
2 | import helper |
||
3 | |||
4 | |||
5 | class SearchBuildDo(helper.SearchBuild): |
||
6 | # Build rules for: |
||
7 | # - *.project -> *.app (boot application) |
||
8 | def doit(self, filename): |
||
9 | artifacts = list() |
||
10 | |||
11 | if filename.endswith(".project"): |
||
12 | destination = filename.replace(".project", ".app") |
||
13 | crcfile = filename.replace(".project", ".crc") |
||
14 | artifacts.append(destination) |
||
15 | artifacts.append(crcfile) |
||
16 | |||
17 | print("%s -> %s\n" % (filename, destination)) |
||
18 | |||
19 | proj = projects.open(filename) |
||
20 | proj.create_boot_application(destination) |
||
21 | proj.close() |
||
22 | |||
23 | return artifacts |
||
24 | |||
25 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
||
26 | |||
27 | sb = SearchBuildDo() |
||
28 | sb.search(".project", ".") |
||
29 | sb.save(".drone-artifacts") |
||
30 | |||
31 |