From 80ca7b15e5f8df6d6940b0dce779fb73d3bad1c9 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 11 Jul 2024 22:34:58 +0200 Subject: [PATCH] Extract sources paths in build_without_gradle.sh This avoids duplication, and will be useful to add more packages. --- server/build_without_gradle.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/server/build_without_gradle.sh b/server/build_without_gradle.sh index 74bbd8ae..845b0104 100755 --- a/server/build_without_gradle.sh +++ b/server/build_without_gradle.sh @@ -50,14 +50,24 @@ cd "$SERVER_DIR/src/main/aidl" android/content/IOnPrimaryClipChangedListener.aidl "$BUILD_TOOLS_DIR/aidl" -o"$GEN_DIR" android/view/IDisplayFoldListener.aidl +SRC=( \ + com/genymobile/scrcpy/*.java \ + com/genymobile/scrcpy/wrappers/*.java \ +) + +CLASSES=() +for src in "${SRC[@]}" +do + CLASSES+=("${src%.java}.class") +done + echo "Compiling java sources..." cd ../java javac -bootclasspath "$ANDROID_JAR" \ -cp "$LAMBDA_JAR:$GEN_DIR" \ -d "$CLASSES_DIR" \ -source 1.8 -target 1.8 \ - com/genymobile/scrcpy/*.java \ - com/genymobile/scrcpy/wrappers/*.java + ${SRC[@]} echo "Dexing..." cd "$CLASSES_DIR" @@ -68,8 +78,7 @@ then "$BUILD_TOOLS_DIR/dx" --dex --output "$BUILD_DIR/classes.dex" \ android/view/*.class \ android/content/*.class \ - com/genymobile/scrcpy/*.class \ - com/genymobile/scrcpy/wrappers/*.class + ${CLASSES[@]} echo "Archiving..." cd "$BUILD_DIR" @@ -81,8 +90,7 @@ else --output "$BUILD_DIR/classes.zip" \ android/view/*.class \ android/content/*.class \ - com/genymobile/scrcpy/*.class \ - com/genymobile/scrcpy/wrappers/*.class + ${CLASSES[@]} cd "$BUILD_DIR" mv classes.zip "$SERVER_BINARY"