mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-19 01:56:33 +08:00
add ctags support
This commit is contained in:
7
data/bridgesupport-ctags.cfg
Normal file
7
data/bridgesupport-ctags.cfg
Normal 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/
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user