Some improvements in output text

This commit is contained in:
DarkCat09 2023-07-04 13:56:10 +04:00
parent 85dc5aa2ea
commit c4cfcecb00

View file

@ -44,12 +44,18 @@ title 'Cloning repositories...'
[ -e reqwest4j ] || clone https://github.com/TeamPiped/reqwest4j reqwest4j [ -e reqwest4j ] || clone https://github.com/TeamPiped/reqwest4j reqwest4j
title 'Applying patches...' title 'Applying patches...'
echo "Hint: if you've already applied patches,"
echo "pass \"patched\" as the first argument to the script."
if [ "$1" != "patched" ] if [ "$1" != "patched" ]
then then
title 'Hint:'
echo "if you've already applied patches,"
echo "call this script specifying \"patched\" arg, i.e."
echo "./build.sh patched"
echo
cd_and_exec backend git apply ../backend.patch cd_and_exec backend git apply ../backend.patch
cd_and_exec reqwest4j git apply ../reqwest4j.patch cd_and_exec reqwest4j git apply ../reqwest4j.patch
else
echo 'Already applied, skipping'
fi fi
@ -67,6 +73,8 @@ cd_and_exec reqwest4j ./gradlew --stop
# --- # ---
title 'Adding built libreqwest_jni into reqwest4j JAR...' title 'Adding built libreqwest_jni into reqwest4j JAR...'
title '--Copying files'
# Copy JAR into workdir # Copy JAR into workdir
REQ4J_NAME="reqwest4j.jar" REQ4J_NAME="reqwest4j.jar"
REQ4J="$WORKDIR/$REQ4J_NAME" REQ4J="$WORKDIR/$REQ4J_NAME"
@ -78,20 +86,25 @@ cd_and_exec reqwest4j/build/libs \
# Copy built reqwest-jni into workdir # Copy built reqwest-jni into workdir
REQJNI_NAME="libreqwest.so" REQJNI_NAME="libreqwest.so"
REQJNI="$WORKDIR/$REQJNI_NAME" REQJNI="$WORKDIR/$REQJNI_NAME"
cd_and_exec reqwest4j/reqwest-jni/target/release \ cd_and_exec reqwest4j/reqwest-jni/target/release \
cp libreqwest_jni.so "$REQJNI" cp libreqwest_jni.so "$REQJNI"
# Create JAR native libraries tree # Create JAR native libraries tree
title '--Creating libraries directory tree'
NATIVES="META-INF/natives/linux/x86_64" NATIVES="META-INF/natives/linux/x86_64"
mkdir -p "$NATIVES" mkdir -p "$NATIVES"
# Move reqwest-jni to native libraries directory # Move reqwest-jni to native libraries directory
title '--Moving libreqwest'
mv "$REQJNI" "$NATIVES/$REQJNI_NAME" mv "$REQJNI" "$NATIVES/$REQJNI_NAME"
# Add native libraries into JAR # Add native libraries into JAR
title '--Injecting libraries directory into reqwest4j JAR'
7z u "$REQ4J" META-INF 7z u "$REQ4J" META-INF
# Clean up # Clean up
title '--Cleaning up'
rm -rf META-INF rm -rf META-INF
rm -f "$REQJNI" rm -f "$REQJNI"
@ -120,6 +133,7 @@ rm -rf backend reqwest4j
# --- # ---
echo
echo '*** ************** ***' echo '*** ************** ***'
echo '*** DONE ***' echo '*** DONE ***'
echo '*** ************** ***' echo '*** ************** ***'