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 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. +