|
|
@ -26,6 +26,7 @@ type build_system =
|
|
|
|
| BMake
|
|
|
|
| BMake
|
|
|
|
| BMvn
|
|
|
|
| BMvn
|
|
|
|
| BNdk
|
|
|
|
| BNdk
|
|
|
|
|
|
|
|
| BPython
|
|
|
|
| BXcode
|
|
|
|
| BXcode
|
|
|
|
[@@deriving compare]
|
|
|
|
[@@deriving compare]
|
|
|
|
|
|
|
|
|
|
|
@ -55,6 +56,7 @@ let build_system_exe_assoc =
|
|
|
|
; (BMvn, "mvn")
|
|
|
|
; (BMvn, "mvn")
|
|
|
|
; (BMvn, "mvnw")
|
|
|
|
; (BMvn, "mvnw")
|
|
|
|
; (BNdk, "ndk-build")
|
|
|
|
; (BNdk, "ndk-build")
|
|
|
|
|
|
|
|
; (BPython, "python")
|
|
|
|
; (BXcode, "xcodebuild") ]
|
|
|
|
; (BXcode, "xcodebuild") ]
|
|
|
|
|
|
|
|
|
|
|
|
let build_system_of_exe_name name =
|
|
|
|
let build_system_of_exe_name name =
|
|
|
@ -73,6 +75,7 @@ type mode =
|
|
|
|
| ClangCompilationDB of [`Escaped of string | `Raw of string] list
|
|
|
|
| ClangCompilationDB of [`Escaped of string | `Raw of string] list
|
|
|
|
| Javac of Javac.compiler * string * string list
|
|
|
|
| Javac of Javac.compiler * string * string list
|
|
|
|
| Maven of string * string list
|
|
|
|
| Maven of string * string list
|
|
|
|
|
|
|
|
| Python of string list
|
|
|
|
| PythonCapture of build_system * string list
|
|
|
|
| PythonCapture of build_system * string list
|
|
|
|
| XcodeXcpretty of string * string list
|
|
|
|
| XcodeXcpretty of string * string list
|
|
|
|
[@@deriving compare]
|
|
|
|
[@@deriving compare]
|
|
|
@ -92,6 +95,7 @@ let pp_mode fmt mode =
|
|
|
|
| BuckGenrule _
|
|
|
|
| BuckGenrule _
|
|
|
|
| BuckCompilationDB _
|
|
|
|
| BuckCompilationDB _
|
|
|
|
| ClangCompilationDB _
|
|
|
|
| ClangCompilationDB _
|
|
|
|
|
|
|
|
| Python _
|
|
|
|
| PythonCapture (_, _)
|
|
|
|
| PythonCapture (_, _)
|
|
|
|
| XcodeXcpretty _
|
|
|
|
| XcodeXcpretty _
|
|
|
|
-> (* these are pretty boring, do not log anything *)
|
|
|
|
-> (* these are pretty boring, do not log anything *)
|
|
|
@ -268,6 +272,9 @@ let capture ~changed_files = function
|
|
|
|
-> L.progress "Capturing in javac mode...@." ; Javac.capture compiler ~prog ~args
|
|
|
|
-> L.progress "Capturing in javac mode...@." ; Javac.capture compiler ~prog ~args
|
|
|
|
| Maven (prog, args)
|
|
|
|
| Maven (prog, args)
|
|
|
|
-> L.progress "Capturing in maven mode...@." ; Maven.capture ~prog ~args
|
|
|
|
-> L.progress "Capturing in maven mode...@." ; Maven.capture ~prog ~args
|
|
|
|
|
|
|
|
| Python args
|
|
|
|
|
|
|
|
-> (* pretend prog is the root directory of the project *)
|
|
|
|
|
|
|
|
PythonMain.go args
|
|
|
|
| PythonCapture (build_system, build_cmd)
|
|
|
|
| PythonCapture (build_system, build_cmd)
|
|
|
|
-> L.progress "Capturing in %s mode...@." (string_of_build_system build_system) ;
|
|
|
|
-> L.progress "Capturing in %s mode...@." (string_of_build_system build_system) ;
|
|
|
|
let in_buck_mode = equal_build_system build_system BBuck in
|
|
|
|
let in_buck_mode = equal_build_system build_system BBuck in
|
|
|
@ -461,6 +468,8 @@ let assert_supported_mode required_analyzer requested_mode_string =
|
|
|
|
-> Version.clang_enabled
|
|
|
|
-> Version.clang_enabled
|
|
|
|
| `Java
|
|
|
|
| `Java
|
|
|
|
-> Version.java_enabled
|
|
|
|
-> Version.java_enabled
|
|
|
|
|
|
|
|
| `Python
|
|
|
|
|
|
|
|
-> Version.python_enabled
|
|
|
|
| `Xcode
|
|
|
|
| `Xcode
|
|
|
|
-> Version.clang_enabled && Version.xcode_enabled
|
|
|
|
-> Version.clang_enabled && Version.xcode_enabled
|
|
|
|
in
|
|
|
|
in
|
|
|
@ -471,6 +480,8 @@ let assert_supported_mode required_analyzer requested_mode_string =
|
|
|
|
-> "clang"
|
|
|
|
-> "clang"
|
|
|
|
| `Java
|
|
|
|
| `Java
|
|
|
|
-> "java"
|
|
|
|
-> "java"
|
|
|
|
|
|
|
|
| `Python
|
|
|
|
|
|
|
|
-> "python"
|
|
|
|
| `Xcode
|
|
|
|
| `Xcode
|
|
|
|
-> "clang and xcode"
|
|
|
|
-> "clang and xcode"
|
|
|
|
in
|
|
|
|
in
|
|
|
@ -484,6 +495,8 @@ let assert_supported_build_system build_system =
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Java
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Java
|
|
|
|
| BClang | BMake | BNdk
|
|
|
|
| BClang | BMake | BNdk
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Clang
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Clang
|
|
|
|
|
|
|
|
| BPython
|
|
|
|
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Python
|
|
|
|
| BXcode
|
|
|
|
| BXcode
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Xcode
|
|
|
|
-> string_of_build_system build_system |> assert_supported_mode `Xcode
|
|
|
|
| BBuck
|
|
|
|
| BBuck
|
|
|
@ -528,6 +541,8 @@ let mode_of_build_command build_cmd =
|
|
|
|
-> Javac (Javac.Javac, prog, args)
|
|
|
|
-> Javac (Javac.Javac, prog, args)
|
|
|
|
| BMvn
|
|
|
|
| BMvn
|
|
|
|
-> Maven (prog, args)
|
|
|
|
-> Maven (prog, args)
|
|
|
|
|
|
|
|
| BPython
|
|
|
|
|
|
|
|
-> Python args
|
|
|
|
| BXcode when Config.xcpretty
|
|
|
|
| BXcode when Config.xcpretty
|
|
|
|
-> XcodeXcpretty (prog, args)
|
|
|
|
-> XcodeXcpretty (prog, args)
|
|
|
|
| BAnt | BBuck | BGradle | BNdk | BXcode as build_system
|
|
|
|
| BAnt | BBuck | BGradle | BNdk | BXcode as build_system
|
|
|
|