mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
This replaces usages of `llvm::fs` and string manipulation with `std::filesystem`, also replacing `std::string` with `std::filesystem::path` where it made sense. Moreover MD5 hashing used in macOS file remapping was replaced by SHA256 hashing using a small header-only SHA256 C++ library with an MIT license, https://github.com/okdshin/PicoSHA2. File contents hashing was relocated to the newly created `file` library for later planned reuse.
43 lines
1.6 KiB
C++
43 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <filesystem>
|
|
|
|
#include "swift/extractor/infra/file/TargetFile.h"
|
|
|
|
namespace codeql {
|
|
struct SwiftExtractorConfiguration {
|
|
// The location for storing TRAP files to be imported by CodeQL engine.
|
|
std::filesystem::path trapDir;
|
|
// The location for storing extracted source files.
|
|
std::filesystem::path sourceArchiveDir;
|
|
// A temporary directory that exists during database creation, but is deleted once the DB is
|
|
// finalized.
|
|
std::filesystem::path scratchDir;
|
|
|
|
// The original arguments passed to the extractor. Used for debugging.
|
|
std::vector<std::string> frontendOptions;
|
|
// The patched arguments passed to the swift::performFrontend/ Used for debugging.
|
|
std::vector<std::string> patchedFrontendOptions;
|
|
|
|
// A temporary directory that contains TRAP files before they are moved into their final
|
|
// destination.
|
|
std::filesystem::path getTempTrapDir() const { return scratchDir / "swift-trap-temp"; }
|
|
|
|
// VFS (virtual file system) support.
|
|
// A temporary directory that contains VFS files used during extraction.
|
|
std::filesystem::path getVFSDir() const { return scratchDir / "swift-vfs"; }
|
|
|
|
// A temporary directory that contains temp VFS files before they moved into VFSDir.
|
|
std::filesystem::path getTempVFSDir() const { return scratchDir / "swift-vfs-temp"; }
|
|
|
|
// A temporary directory that contains build artifacts generated by the extractor during the
|
|
// overall extraction process.
|
|
std::filesystem::path getTempArtifactDir() const {
|
|
return scratchDir / "swift-extraction-artifacts";
|
|
}
|
|
};
|
|
|
|
} // namespace codeql
|