Add generated JNI detection, update samples

This commit is contained in:
Ted Nyman
2013-11-04 19:14:34 -08:00
parent 6ee999617e
commit 81176f8dfa
4 changed files with 112 additions and 20 deletions

View File

@@ -58,7 +58,8 @@ module Linguist
generated_parser? ||
generated_net_docfile? ||
generated_net_designer_file? ||
generated_protocol_buffer?
generated_protocol_buffer? ||
generated_jni_header?
end
# Internal: Is the blob an XCode project file?
@@ -181,5 +182,16 @@ module Linguist
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
end
# Internal: Is the blob a C/C++ header generated by the Java JNI tool javah?
#
# Returns true of false.
def generated_jni_header?
return false unless extname == '.h'
return false unless lines.count > 2
return lines[0].include?("/* DO NOT EDIT THIS FILE - it is machine generated */")
return lines[1].include?("#include <jni.h>")
end
end
end