cardano-client-lib 0.1.0-pre6

Rust bindings for Cardano Client Lib (CCL) via GraalVM native library
def nativeLibTask = project.hasProperty('usePrebuilt') ? ':core:downloadNativeLib' : ':core:nativeCompile'

task copyNativeLib(type: Copy) {
    dependsOn nativeLibTask
    from project(':core').layout.buildDirectory.dir('native/nativeCompile')
    into layout.buildDirectory.dir('native')
    include 'libccl.*'
    include '*.h'
}

task test(type: Exec) {
    dependsOn copyNativeLib
    workingDir projectDir

    def nativeDir = layout.buildDirectory.dir('native').get().asFile.absolutePath
    environment 'CCL_LIB_PATH', nativeDir
    environment 'DYLD_LIBRARY_PATH', nativeDir
    environment 'LD_LIBRARY_PATH', nativeDir

    // Invoke `cargo` directly on Windows rather than via `bash` (a bare `bash` resolves to WSL on
    // Windows runners, which has no distro).
    if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
        commandLine 'cargo', 'test', '--features', 'providers', '--', '--test-threads=1'
    } else {
        commandLine 'bash', '-c', 'cargo test --features providers -- --test-threads=1'
    }
}