mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
This adds a first dummy extractor for swift. Running `bazel run //swift:install` will create an `extractor_pack` directory in `swift`. From that moment providing `--search-path=swift` will pick up the extractor.
15 lines
324 B
C++
15 lines
324 B
C++
#include <fstream>
|
|
#include <iomanip>
|
|
#include <stdlib.h>
|
|
|
|
int main() {
|
|
if (auto trapDir = getenv("CODEQL_EXTRACTOR_SWIFT_TRAP_DIR")) {
|
|
std::string file = trapDir;
|
|
file += "/my_first.trap";
|
|
if (std::ofstream out{file}) {
|
|
out << "answer_to_life_the_universe_and_everything(42)\n";
|
|
}
|
|
}
|
|
return 0;
|
|
}
|