Skip to content

Improve consistency of GetCacheDirectory API #446

@oleg-shilo

Description

@oleg-shilo

Triggered by #441

Let me add a caching related question/issue. Feel free to extract into a separate issue if you think it doesn't belong here.

Runtime.cs restricts "does not support the cache directory for class library projects", resulting in a host application not being able to retrieve CacheDir. While it can replicate CacheDir = GetScriptTempDir().PathJoin("cache"), this obviously is something different than GetCacheDir(). I am not really getting this piece of code.

Or stated differently, could Runtime provide...

public static string GetCacheDir() => CacheDir;

...on #if class_lib?

Or is CSExecutor.GetCacheDirectory() something that could be made public?

Note the differences among naming of SetScriptCacheDir() vs. GetCacheDirectory(). Should probably be better aligned.

Also, note that with my host app CS-Script creates two differently named directories in "\Temp":

"C:\Users<USER>\AppData\Local\Temp\CSSCRIPT\cache" which contains build info of the scripts.
"C:\Users<USER>\AppData\Local\Temp\csscript.core" which remains empty.

Background: My host app outputs verbose information on compiling and loading a script, just like CS-Script -verbose does. But currently there is no method to retrieve the cache dir.

Originally posted by @maettu-this in #441

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions