[16685e]: / codesys-ide / scripts / compile-library.py  Maximize  Restore  History

Download this file

28 lines (19 with data), 732 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
import sys, os
import helper


class SearchBuildDo(helper.SearchBuild):
    # Build rules for:
    # - *.library -> *.compiled-library
    def doit(self, filename):
        artifacts = list()
        
        if filename.endswith(".library"):
            destination = filename.replace(".library", ".compiled-library")
            artifacts.append(destination)

            print("%s -> %s\n" % (filename, destination))
            
            proj = projects.open(filename)
            proj.save_as_compiled_library(destination)
            proj.close()
        
        return artifacts

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

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