Fork of of the dirs-dev/directories-jvm project, with coursier-specific changes
Compared to the upstream project, this fork:
- still supports JDK 8
- offers to use JNI rather than shelling out to a PowerShell script to call Windows APIs with JDK < 23
- contains a number of fixes for Windows
def ivyDeps = Agg(
ivy"io.get-coursier.util:directories:0.1.2"
)
//> using dep io.get-coursier.util:directories:0.1.2
import dev.dirs.ProjectDirectories
val projDirs = ProjectDirectories.from(null, null, "MyApp")
projDirs.configDir // "/Users/name/Library/Application Support/MyApp"
projDirs.preferenceDir // "/Users/name/Library/Preferences/MyApp"
// ...
def ivyDeps = Agg(
ivy"io.get-coursier.util:directories-jni:0.1.2"
)
//> using dep io.get-coursier.util:directories-jni:0.1.2
import dev.dirs.ProjectDirectories
import dev.dirs.jni.WindowsJni
val projDirs = ProjectDirectories.from(null, null, "MyApp", WindowsJni.getJdkAwareSupplier())
projDirs.configDir // "/Users/name/Library/Application Support/MyApp"
projDirs.preferenceDir // "/Users/name/Library/Preferences/MyApp"
// ...