Skip to content

Commit

Permalink
get tests running
Browse files Browse the repository at this point in the history
  • Loading branch information
Mause committed Jul 3, 2024
1 parent 8b27d01 commit 2d3d7a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
- run: ./gradlew assembleDebug --info --scan
name: Build

- run: ./gradlew test

- uses: actions/upload-artifact@v3
with:
name: duckdb-android-aarch64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class DuckDBNative {
String os_arch;
String os_name_detect = System.getProperty("os.name").toLowerCase().trim();
String os_arch_detect = System.getProperty("os.arch").toLowerCase().trim();
String java_vendor = System.getProperty("java.vendor");
switch (os_arch_detect) {
case "x86_64":
case "amd64":
Expand All @@ -35,7 +36,9 @@ class DuckDBNative {
default:
throw new IllegalStateException("Unsupported system architecture");
}
if (os_name_detect.startsWith("windows")) {
if (java_vendor.equals("The Android Project")) {
os_name = "android";
} else if (os_name_detect.startsWith("windows")) {
os_name = "windows";
} else if (os_name_detect.startsWith("mac")) {
os_name = "osx";
Expand All @@ -49,7 +52,7 @@ class DuckDBNative {
Path lib_file = Files.createTempFile("libduckdb_java", ".so");
URL lib_res = DuckDBNative.class.getResource(lib_res_name);
if (lib_res == null) {
System.load(Paths.get("build/debug", lib_res_name).normalize().toAbsolutePath().toString());
System.load(Paths.get("../build/debug", lib_res_name).normalize().toAbsolutePath().toString());
} else {
try (final InputStream lib_res_input_stream = lib_res.openStream()) {
Files.copy(lib_res_input_stream, lib_file, StandardCopyOption.REPLACE_EXISTING);
Expand Down

0 comments on commit 2d3d7a5

Please sign in to comment.