Commit 9ca20749 authored by Jan Včelák's avatar Jan Včelák 🚀

add script to generate QtCreator project file list

parent 44438a90
This diff is collapsed.
#!/usr/bin/python -Es
# vim: et:sw=4:ts=4:sts=4
#
# Script regenerates project file list from the list of files tracked by Git.
#
SOURCES = [
# documentation
"README", "KNOWN_ISSUES", "CodingStyle",
"Doxyfile*", "Doxy.file.h", "doc/*.texi",
# build-system
"*.ac", "*.am", "Makefile",
# sources
"src/*.c", "src/*.h",
]
OUTPUT_FILE = "Knot.files"
# ----------------------------------------------------------------------------
from subprocess import Popen, PIPE
import os
import sys
def run(command):
p = Popen(command, stdout=PIPE, stderr=PIPE)
(out, errout) = p.communicate()
if p.returncode != 0:
raise Exception("Command %s failed.", command)
return out
print >>sys.stderr, "Updating %s." % OUTPUT_FILE
git_root = run(["git", "rev-parse", "--show-toplevel"]).strip()
os.chdir(git_root)
command = ["git", "ls-files"] + SOURCES
files = run(command).splitlines()
with open(OUTPUT_FILE, "w") as output:
output.write("\n".join(sorted(files)))
output.write("\n")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment