From 6d85ac486546bde6f68f48d0c90d5eb854883573 Mon Sep 17 00:00:00 2001 From: lukellmann Date: Wed, 30 Aug 2023 18:52:38 +0200 Subject: [PATCH] Use jextract to generate bindings --- .github/workflows/ci.yml | 10 + .idea/gradle.xml | 1 + app/desktop/build.gradle.kts | 11 +- .../tonbrett/app/desktop/NativeUtil.java | 74 ---- app/desktop/src/main/kotlin/ConfigFile.kt | 12 +- app/desktop/src/main/kotlin/NativeUtil.kt | 37 ++ app/desktop/src/main/kotlin/URIUtil.kt | 2 +- app/desktop/uwp_helper/Cargo.lock | 357 ++++++++++++++++-- app/desktop/uwp_helper/Cargo.toml | 9 +- app/desktop/uwp_helper/build.gradle.kts | 47 +++ app/desktop/uwp_helper/build.rs | 35 ++ app/desktop/uwp_helper/src/lib.rs | 50 +-- build.gradle.kts | 8 +- settings.gradle.kts | 2 +- 14 files changed, 504 insertions(+), 151 deletions(-) delete mode 100644 app/desktop/src/main/java/dev/schlaubi/tonbrett/app/desktop/NativeUtil.java create mode 100644 app/desktop/src/main/kotlin/NativeUtil.kt create mode 100644 app/desktop/uwp_helper/build.gradle.kts create mode 100644 app/desktop/uwp_helper/build.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ab71ac..0305375 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,16 @@ jobs: if: matrix.os == 'windows-latest' with: toolchain: 'stable' + - name: Setup jextract + if: matrix.os == 'windows-latest' + shell: powershell + run: | + Invoke-WebRequest https://download.java.net/java/early_access/jextract/1/openjdk-20-jextract+1-2_windows-x64_bin.tar.gz -OutFile jextract.tar.gz + + tar xzvf jextract.tar.gz + + $path = (Resolve-Path jextract-20\bin).Path + echo $path | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Setup MacOS signing if: matrix.os == 'macos-latest' env: diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 5a9c276..73f8aed 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -14,6 +14,7 @@