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