mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-01-12 22:51:55 +08:00
Support rake ctags for Android. Fixes RM-782
This commit is contained in:
5
data/bridgesupport-ctags-android.cfg
Normal file
5
data/bridgesupport-ctags-android.cfg
Normal file
@@ -0,0 +1,5 @@
|
||||
--langdef=bridgesupport
|
||||
--langmap=bridgesupport:.bridgesupport
|
||||
--regex-bridgesupport=/<class +name="([A-Za-z0-9_\/]+)"/\1/C,classes/
|
||||
--regex-bridgesupport=/<interface +name="([A-Za-z0-9_\/]+)"/\1/C,classes/
|
||||
--regex-bridgesupport=/<method +name="([A-Za-z0-9_:]+)"/\1/m,methods/
|
||||
@@ -72,10 +72,8 @@ task :ctags do
|
||||
tags_file = 'tags'
|
||||
config = App.config
|
||||
if !File.exist?(tags_file) or File.mtime(config.project_file) > File.mtime(tags_file)
|
||||
files = config.bridgesupport_files + config.vendor_projects.map { |p| Dir.glob(File.join(p.path, '*.bridgesupport')) }.flatten + config.files.flatten
|
||||
ctags = File.join(config.bindir, 'ctags')
|
||||
config = File.join(config.motiondir, 'data', 'bridgesupport-ctags.cfg')
|
||||
sh "#{ctags} --options=\"#{config}\" #{files.map { |x| '"' + x + '"' }.join(' ')}"
|
||||
sh "#{ctags} --options=\"#{config.ctags_config_file}\" #{config.ctags_files.map { |x| '"' + x + '"' }.join(' ')}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -414,6 +414,15 @@ module Motion; module Project;
|
||||
end
|
||||
end
|
||||
|
||||
def ctags_files
|
||||
ctags_files = vendored_bs_files + files.flatten
|
||||
ctags_files += Dir.glob(File.join(versioned_datadir, 'BridgeSupport/*.bridgesupport'))
|
||||
end
|
||||
|
||||
def ctags_config_file
|
||||
File.join(motiondir, 'data', 'bridgesupport-ctags-android.cfg')
|
||||
end
|
||||
|
||||
attr_reader :manifest_entries
|
||||
|
||||
def manifest_entry(toplevel_element=nil, element, attributes)
|
||||
|
||||
@@ -668,5 +668,15 @@ EOS
|
||||
|
||||
args
|
||||
end
|
||||
|
||||
def ctags_files
|
||||
ctags_files = bridgesupport_files
|
||||
ctags_files += config.vendor_projects.map { |p| Dir.glob(File.join(p.path, '*.bridgesupport')) }.flatten
|
||||
ctags_files += config.files.flatten
|
||||
end
|
||||
|
||||
def ctags_config_file
|
||||
File.join(motiondir, 'data', 'bridgesupport-ctags.cfg')
|
||||
end
|
||||
end
|
||||
end; end
|
||||
|
||||
Reference in New Issue
Block a user