-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneratectags.py
50 lines (49 loc) · 1.52 KB
/
generatectags.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from subprocess import call
import sys
import os
if __name__ == '__main__':
targets = sys.argv[1:]
if len( targets ) == 0:
targets=['External', 'Applications', 'Components', 'Libraries']
generalParams = [
'--exclude=*win32*',
'--exclude=*win64*',
'--exclude=*.dll',
'--exclude=*.lib',
'--exclude=*.man',
'--exclude=*.syn',
'--exclude=*.ui',
'--exclude=*.in',
'--exclude=*/jam*',
'--exclude=*/res*',
'--exclude=*CVS*',
'--exclude=*IDESupport*',
'--exclude=*~',
'--exclude=*.dep',
'--exclude=*.swp',
'--exclude=*.xml',
'--exclude=*.exe',
'--exclude=*.rc',
'--exclude=*.txt',
'--exclude=Jamfile',
'--exclude=itestresult',
'--exclude=*.conf',
'--exclude=*.chm',
'--languages=c++',
'-h', '.h.hpp',
'--fields=+l',
'-R' ]
wdBackup = os.getcwd()
os.chdir( os.path.join( os.getenv('REPOSITORY_BASE'), 'source/cpp' ) )
print "Working in: " + os.getcwd()
for target in targets:
print """Generating tags for """ + target + """ direcotry ..."""
tagsFile = target + '.ctags'
newTagsFile = tagsFile + '.tmp'
params = ['C:\\Users\\tma\\vimfiles\\ctags', '-f', newTagsFile ] + generalParams
params.append( './' + target )
call( params )
if os.path.exists( tagsFile ):
os.remove( tagsFile )
os.rename( newTagsFile, tagsFile )
os.chdir( wdBackup )