fixed: compile issue
[opensg.git] / Tools / set_source_default_svnprops.py
blob1428de674bffe29215614060ec9998c6467ab5d8
2 # Run in source directory to change all file eol-style's
5 import os, sys, os.path
6 pj = os.path.join
8 def isSourceFile(fname):
9 if fname in ["SConstruct","SConscript","build.info"]:
10 return True
11 ext = os.path.splitext(fname)[1]
12 return ext in [".c",".cpp",".h",".inl",".ins",".fcd",".yy",".ll",".py"]
14 def isWindowsFile(fname):
15 ext = os.path.splitext(fname)[1]
16 return ext in [".dsp",".dsw"]
18 source_files = []
19 msvs_files = []
21 for root, dirs, files in os.walk('.'):
22 source_files.extend([pj(root,f) for f in files if isSourceFile(f)])
23 msvs_files.extend([pj(root,f) for f in files if isWindowsFile(f)])
25 print "Source files: "
27 for f in source_files:
28 print f
30 print "Windows files: "
31 for f in msvs_files:
32 print f
34 print "Setting eol-styles"
35 for f in source_files:
36 cmd = "svn propset svn:eol-style native %s"%f
37 print "cmd: %s ..."%cmd,
38 os.system(cmd)
39 print "[OK]"
41 print "Setting keywords=Id"
42 for f in source_files:
43 cmd = "svn propset svn:keywords Id %s"%f
44 print "cmd: %s ..."%cmd,
45 os.system(cmd)
46 print "[OK]"