[7c4eb7]: / codesys-ide / scripts / save-projectarchive.py  Maximize  Restore  History

Download this file

29 lines (21 with data), 812 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys, os
import helper

class SearchBuildDo(helper.SearchBuild):
    # Build rules for:
    # - *.project -> *.projectarchive
    def doit(self, filename):
        artifacts = list()

        if filename.endswith(".project"):
            destination = filename.replace(".project", ".projectarchive")
            artifacts.append(destination)

            print("%s -> %s\n" % (filename, destination))

            proj = projects.open(filename)
            helper.update_device(proj, device_repository)
            helper.install_missing_libraries(proj, librarymanager)
            proj.save_archive(destination)
            proj.close()

        return artifacts

scriptpath = os.path.abspath(os.path.dirname(sys.argv[0]))

sb = SearchBuildDo()
sb.search(".project", ".")
sb.save(".", ".drone-artifacts")