Library with common primitives for Python_ programming language
Revision | c99ed6de035765057f05a5b8a3bcd23d47256b0c (tree) |
---|---|
Zeit | 2023-02-26 04:49:26 |
Autor | Sergey Gusarov <laborer2008@gmai...> |
Commiter | Sergey Gusarov |
gen_build_info: generate from the template .rc file on windows
@@ -9,6 +9,7 @@ | ||
9 | 9 | import fsys |
10 | 10 | import os |
11 | 11 | import subprocess |
12 | +import sys | |
12 | 13 | |
13 | 14 | |
14 | 15 | def kScriptDir(): |
@@ -231,6 +232,16 @@ | ||
231 | 232 | fsys.replaceStringsInFile(inputFile, outputFile, ['{prefix}'], [projectPrefix]) |
232 | 233 | |
233 | 234 | |
235 | +def generateRcBuildInfoFile(projectPrefix, workDirectory = kDefaultPath()): | |
236 | + if projectPrefix == '': | |
237 | + raise Exception('Invalid projectPrefix') | |
238 | + | |
239 | + inputFile = os.path.join(workDirectory, 'file_property.rc.template') | |
240 | + outputFile = os.path.join(workDirectory, 'file_property.rc') | |
241 | + | |
242 | + fsys.replaceStringsInFile(inputFile, outputFile, ['{prefix}'], [projectPrefix]) | |
243 | + | |
244 | + | |
234 | 245 | def generateBuildInfoFile(inputFile, outputFile, vcs = kDefaultVcs(), vcsDir = kScriptDir()): |
235 | 246 | revision, isInternal = getVcsInfo(vcs, vcsDir) |
236 | 247 | fsys.replaceStringsInFile(inputFile, outputFile, ['{rev}', '{is_internal}'], [revision, isInternal]) |
@@ -258,5 +269,7 @@ | ||
258 | 269 | if args.cpp: |
259 | 270 | generateHppBuildInfoFile(args.project_prefix, args.work_directory) |
260 | 271 | |
272 | + if sys.platform == 'win32': | |
273 | + generateRcBuildInfoFile(args.project_prefix, os.path.join(args.vcs_dir, 'build_info')) | |
261 | 274 | |
262 | 275 | main() |