Skip to content

Commit 0043682

Browse files
authored
Merge pull request github#12883 from github/redsun82/swift-default-output-dir
Swift: aggregate default output directories
2 parents 94e0828 + c7378a1 commit 0043682

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

swift/extractor/infra/log/SwiftLogging.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ void Log::configure() {
9494
// as we are configuring logging right now, we collect problems and log them at the end
9595
auto problems = collectSeverityRulesAndReturnProblems("CODEQL_EXTRACTOR_SWIFT_LOG_LEVELS");
9696
if (text || binary) {
97-
std::filesystem::path logFile = getEnvOr("CODEQL_EXTRACTOR_SWIFT_LOG_DIR", ".");
97+
std::filesystem::path logFile = getEnvOr("CODEQL_EXTRACTOR_SWIFT_LOG_DIR", "extractor-out/log");
98+
logFile /= "swift";
9899
logFile /= logRootName;
99100
logFile /= std::to_string(std::chrono::system_clock::now().time_since_epoch().count());
100101
std::error_code ec;

swift/extractor/main.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ codeql::TrapDomain invocationTrapDomain(codeql::SwiftExtractorState& state) {
177177

178178
codeql::SwiftExtractorConfiguration configure(int argc, char** argv) {
179179
codeql::SwiftExtractorConfiguration configuration{};
180-
configuration.trapDir = getenv_or("CODEQL_EXTRACTOR_SWIFT_TRAP_DIR", ".");
181-
configuration.sourceArchiveDir = getenv_or("CODEQL_EXTRACTOR_SWIFT_SOURCE_ARCHIVE_DIR", ".");
182-
configuration.scratchDir = getenv_or("CODEQL_EXTRACTOR_SWIFT_SCRATCH_DIR", ".");
180+
configuration.trapDir = getenv_or("CODEQL_EXTRACTOR_SWIFT_TRAP_DIR", "extractor-out/trap/swift");
181+
configuration.sourceArchiveDir =
182+
getenv_or("CODEQL_EXTRACTOR_SWIFT_SOURCE_ARCHIVE_DIR", "extractor-out/src");
183+
configuration.scratchDir =
184+
getenv_or("CODEQL_EXTRACTOR_SWIFT_SCRATCH_DIR", "extractor-out/working");
183185
configuration.frontendOptions.assign(argv + 1, argv + argc);
184186
return configuration;
185187
}

0 commit comments

Comments
 (0)