add ctags support

This commit is contained in:
Laurent Sansonetti
2012-02-16 18:30:06 +01:00
parent 353a0af198
commit d8b15196a9
3 changed files with 19 additions and 0 deletions

BIN
bin/ctags Executable file

Binary file not shown.

View File

@@ -0,0 +1,7 @@
--langdef=bridgesupport
--langmap=bridgesupport:.bridgesupport
--regex-bridgesupport=/<constant +name='([A-Za-z0-9_]+)'/\1/c,constants/
--regex-bridgesupport=/<enum +name='([A-Za-z0-9_]+)'/\1/e,enumerations/
--regex-bridgesupport=/<function +name='([A-Za-z0-9_]+)'/\1/f,functions/
--regex-bridgesupport=/<class +name='([A-Za-z0-9_]+)'/\1/C,classes/
--regex-bridgesupport=/<method +selector='([A-Za-z0-9_:]+)'/\1/m,methods/

View File

@@ -121,3 +121,15 @@ task :config do
puts key.ljust(22) + " : #{map[key].inspect}"
end
end
desc "Generate ctags"
task :ctags do
tags_file = 'tags'
config = App.config
if !File.exist?(tags_file) or File.mtime(config.project_file) > File.mtime(tags_file)
bs_files = config.bridgesupport_files + config.vendor_projects.map { |p| Dir.glob(File.join(p.path, '*.bridgesupport')) }.flatten
ctags = File.join(config.bindir, 'ctags')
config = File.join(config.motiondir, 'data', 'bridgesupport-ctags.cfg')
sh "#{ctags} --options=\"#{config}\" #{bs_files.map { |x| '"' + x + '"' }.join(' ')}"
end
end