From 08d7e41a2637e745212995213c9fc3e8aaa9f605 Mon Sep 17 00:00:00 2001 From: tison Date: Wed, 8 Nov 2023 18:20:30 +0800 Subject: [PATCH] chore(bindings/java): improve build.py script (#3529) Signed-off-by: tison --- bindings/java/tools/build.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bindings/java/tools/build.py b/bindings/java/tools/build.py index 30fcd216c864..45c744de663e 100755 --- a/bindings/java/tools/build.py +++ b/bindings/java/tools/build.py @@ -28,26 +28,22 @@ def classifier_to_target(classifier: str) -> str: return 'aarch64-apple-darwin' if classifier == 'osx-x86_64': return 'x86_64-apple-darwin' + if classifier == 'linux-aarch_64': + return 'aarch64-unknown-linux-gnu' if classifier == 'linux-x86_64': return 'x86_64-unknown-linux-gnu' if classifier == 'windows-x86_64': return 'x86_64-pc-windows-msvc' - if classifier == 'linux-aarch_64': - return 'aarch64-unknown-linux-gnu' raise Exception(f'Unsupported classifier: {classifier}') def get_cargo_artifact_name(classifier: str) -> str: - if classifier == 'osx-aarch_64': + if classifier.startswith('osx'): return 'libopendal_java.dylib' - if classifier == 'osx-x86_64': - return 'libopendal_java.dylib' - if classifier == 'linux-x86_64': + if classifier.startswith('linux'): return 'libopendal_java.so' - if classifier == 'windows-x86_64': + if classifier.startswith('windows'): return 'opendal_java.dll' - if classifier == 'linux-aarch_64': - return 'libopendal_java.so' raise Exception(f'Unsupported classifier: {classifier}')