From dedb0cb11fdb11d115d2854431fc7b86619efe80 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 3 Jan 2025 15:58:31 +0000 Subject: [PATCH 1/2] Kotlin: Support CODEQL_PATH_TRANSFORMER --- .../src/main/java/com/semmle/util/process/Env.java | 1 + .../semmle/util/trap/pathtransformers/PathTransformer.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java b/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java index 564887f5fda1..4b0456e170cc 100644 --- a/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java +++ b/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java @@ -115,6 +115,7 @@ public enum Var { */ SEMMLE_TRAP_IMPORTER, SEMMLE_PRESERVE_SYMLINKS, + CODEQL_PATH_TRANSFORMER, SEMMLE_PATH_TRANSFORMER, /* diff --git a/java/kotlin-extractor/src/main/java/com/semmle/util/trap/pathtransformers/PathTransformer.java b/java/kotlin-extractor/src/main/java/com/semmle/util/trap/pathtransformers/PathTransformer.java index 434f882fae8d..9f6a420786d2 100644 --- a/java/kotlin-extractor/src/main/java/com/semmle/util/trap/pathtransformers/PathTransformer.java +++ b/java/kotlin-extractor/src/main/java/com/semmle/util/trap/pathtransformers/PathTransformer.java @@ -41,7 +41,10 @@ public File canonicalFile(String path) { private static final PathTransformer DEFAULT_TRANSFORMER; static { - String layout = Env.systemEnv().get(Var.SEMMLE_PATH_TRANSFORMER); + String layout = Env.systemEnv().get(Var.CODEQL_PATH_TRANSFORMER); + if (layout == null) { + layout = Env.systemEnv().get(Var.SEMMLE_PATH_TRANSFORMER); + } if (layout == null) DEFAULT_TRANSFORMER = new NoopTransformer(); else From 78b277b46f8b99e21597cc67b644024afa790483 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 3 Jan 2025 16:00:50 +0000 Subject: [PATCH 2/2] Java/Kotlin: Add a changenote for CODEQL_PATH_TRANSFORMER support. --- java/ql/lib/change-notes/2025-01-03-path-transformer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 java/ql/lib/change-notes/2025-01-03-path-transformer.md diff --git a/java/ql/lib/change-notes/2025-01-03-path-transformer.md b/java/ql/lib/change-notes/2025-01-03-path-transformer.md new file mode 100644 index 000000000000..919383bfb610 --- /dev/null +++ b/java/ql/lib/change-notes/2025-01-03-path-transformer.md @@ -0,0 +1,5 @@ +--- +category: feature +--- +* The Java and Kotlin extractors now support `CODEQL_PATH_TRANSFORMER`. `SEMMLE_PATH_TRANSFORMER` is still supported, but deprecated. +