Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(file_types): Add classification for Android file types #1321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/info/filetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub enum FileType {
/// Mapping from full filenames to file type.
const FILENAME_TYPES: Map<&'static str, FileType> = phf_map! {
/* Immediate file - kick off the build of a project */
"Android.bp" => FileType::Build,
"Brewfile" => FileType::Build,
"bsconfig.json" => FileType::Build,
"BUILD" => FileType::Build,
Expand Down Expand Up @@ -278,12 +279,16 @@ const EXTENSION_TYPES: Map<&'static str, FileType> = phf_map! {
"tmp" => FileType::Temp,
/* Compiler output files */
"a" => FileType::Compiled, // Unix static library
"aab" => FileType::Compiled, // Android App Bundle
"aar" => FileType::Compiled, // Android Archive
"apk" => FileType::Compiled, // Android PacKage
"bundle" => FileType::Compiled, // macOS application bundle
"class" => FileType::Compiled, // Java class file
"cma" => FileType::Compiled, // OCaml bytecode library
"cmi" => FileType::Compiled, // OCaml interface
"cmo" => FileType::Compiled, // OCaml bytecode object
"cmx" => FileType::Compiled, // OCaml bytecode object for inlining
"dex" => FileType::Compiled, // Dalvik bytecode object, for Android apps
"dll" => FileType::Compiled, // Windows dynamic link library
"dylib" => FileType::Compiled, // Mach-O dynamic library
"elc" => FileType::Compiled, // Emacs compiled lisp
Expand All @@ -292,12 +297,14 @@ const EXTENSION_TYPES: Map<&'static str, FileType> = phf_map! {
"lib" => FileType::Compiled, // Windows static library
"o" => FileType::Compiled, // Compiled object file
"obj" => FileType::Compiled, // Compiled object file
"odex" => FileType::Compiled, // Optimized DEX bytecode, for Android apps
"pyc" => FileType::Compiled, // Python compiled code
"pyd" => FileType::Compiled, // Python dynamic module
"pyo" => FileType::Compiled, // Python optimized code
"so" => FileType::Compiled, // Unix shared library
"zwc" => FileType::Compiled, // zsh compiled file
/* Source code files */
"aidl" => FileType::Source, // Android Interface Definition Language
"applescript"=> FileType::Source, // Apple script
"as" => FileType::Source, // Action script
"asa" => FileType::Source, // asp
Expand Down Expand Up @@ -347,6 +354,7 @@ const EXTENSION_TYPES: Map<&'static str, FileType> = phf_map! {
"h" => FileType::Source, // C/C++ header
"h++" => FileType::Source, // C/C++ header
"hh" => FileType::Source, // C/C++ header
"hidl" => FileType::Source, // Android Hardware Interface Definition
"hpp" => FileType::Source, // C/C++ header
"hc" => FileType::Source, // HolyC
"hs" => FileType::Source, // Haskell
Expand Down Expand Up @@ -408,6 +416,7 @@ const EXTENSION_TYPES: Map<&'static str, FileType> = phf_map! {
"v" => FileType::Source, // V
"vb" => FileType::Source, // Visual Basic
"vsh" => FileType::Source, // Vertex shader
"xml" => FileType::Source, // eXtensible Markup Language
"zig" => FileType::Source, // Zig
};

Expand Down
Loading