mirror of
https://github.com/apple/pkl.git
synced 2026-03-25 18:41:18 +01:00
Encode filepaths to be safe on Windows
This changes the file paths to use characters that are safe for Windows. Channges the output of the following: * Package cache directory * Generated pkl-doc files * Kotlin generated code Unsafe characters are encoded as (<hex>). For example, the colon character `:` is encoded as `(3a)`. Additionally, this changes the cache directory prefix (package-1 to package-2). Follows the design of https://github.com/apple/pkl-evolution/pull/3
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import org.pkl.config.java.InvalidMappingException;
|
||||
import org.pkl.core.PClassInfo;
|
||||
import org.pkl.core.util.IoUtils;
|
||||
import org.pkl.core.util.Nullable;
|
||||
|
||||
/**
|
||||
@@ -77,7 +78,7 @@ public class ClassRegistry {
|
||||
loadedModules.add(pklModuleName);
|
||||
var url =
|
||||
ClassRegistry.class.getResourceAsStream(
|
||||
CLASSES_DIRECTORY + "/" + pklModuleName + ".properties");
|
||||
CLASSES_DIRECTORY + "/" + IoUtils.encodePath(pklModuleName) + ".properties");
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user