mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add generated JNI detection, update samples
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user