From be04f698fe78bf3be0bbfb5f2a8d07f0623447c7 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Mon, 3 Jul 2023 16:05:05 +0400 Subject: [PATCH] No more need in manually adding native library, Gradle does it correctly --- build.sh | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/build.sh b/build.sh index cb73481..fffd53c 100755 --- a/build.sh +++ b/build.sh @@ -54,43 +54,21 @@ cd_and_exec reqwest4j git apply ../reqwest4j.patch # --- export RUSTFLAGS="-C target-feature=-crt-static" -title 'Building reqwest-jni...' -cd_and_exec reqwest4j/reqwest-jni cargo build --release - title 'Building reqwest4j...' cd_and_exec reqwest4j ./gradlew shadowJar cd_and_exec reqwest4j ./gradlew --stop # --- -title 'Adding built reqwest-jni into reqwest4j...' +title 'Copying reqwest4j JAR...' -# Copy JAR into workdir REQ4J_NAME="reqwest4j.jar" REQ4J="$WORKDIR/$REQ4J_NAME" + cd_and_exec reqwest4j/build/libs \ find . -maxdepth 1 -name 'reqwest4j-*-all.jar' -exec \ cp {} "$REQ4J" \; -# Copy built reqwest-jni into workdir -REQJNI_NAME="libreqwest_jni.so" -REQJNI="$WORKDIR/$REQJNI_NAME" -cd_and_exec reqwest4j/reqwest-jni/target/release cp libreqwest_jni.so "$REQJNI" - -# Create JAR native libraries tree -NATIVES="META-INF/natives/linux/x86_64" -mkdir -p "$NATIVES" - -# Move reqwest-jni to native libraries directory -mv "$REQJNI" "$NATIVES/$REQJNI_NAME" - -# Add native libraries into JAR -7z u "$REQ4J" META-INF - -# Clean up -rm -rf META-INF -rm -f "$REQJNI" - # --- title 'Adding reqwest4j JAR into Piped...'