• Igor Demin's avatar
    System property to extract binaries to a different folder (#891) · a7763616
    Igor Demin authored
    Skiko extracts binaries to `~/.skiko` by default, but it is not always
    possible. This PR adds a way to override the folder where to extract
    binaries:
    ```
    System.setProperty("skiko.data.path", File(System.getProperty("java.io.tmpdir")).resolve(".skiko").toString())
    ```
    
    Fixes https://github.com/JetBrains/skiko/issues/885
    
    The case seems rare - we only have a crash in tests reported. If we have
    reports from real users, we have to change the default `~/.skiko` to
    something else.
    
    ## Testing 1 (manual)
    1. Run
    ```
    import org.jetbrains.skia.Bitmap
    import java.io.File
    
    fun main() {
        val path = File(System.getProperty("java.io.tmpdir")).resolve(".skiko").toString()
        println(path)
        System.setProperty("skiko.data.path", path)
        Bitmap() // loads the library
    }
    ```
    2. See that `path` is created
    ## Testing 2 (manual)
    The default way works:
    ```
    import org.jetbrains.skia.Bitmap
    
    fun main() {
        Bitmap() // loads the library
    }
    ```
    a7763616
Name
Last commit
Last update
.github/workflows Loading commit data...
.run Loading commit data...
gradle/wrapper Loading commit data...
samples Loading commit data...
skiko Loading commit data...
.gitignore Loading commit data...
DEVELOPMENT.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle.kts Loading commit data...