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