mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 19:45:00 +00:00
server: build: enforce ANDROID_PLATFORMS_PATH when no ANDROID_HOME
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
parent
f50d9dc23d
commit
3e0dfb1f32
1 changed files with 5 additions and 2 deletions
|
@ -17,14 +17,17 @@ SCRCPY_VERSION_NAME=1.16
|
|||
PLATFORM=${ANDROID_PLATFORM:-29}
|
||||
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-29.0.2}
|
||||
|
||||
if [ -z ${ANDROID_HOME+x} ]; then
|
||||
if [ "$ANDROID_HOME" != "" ]; then
|
||||
AIDL="$ANDROID_HOME/build-tools/$BUILD_TOOLS/aidl"
|
||||
DX="$ANDROID_HOME/build-tools/$BUILD_TOOLS/dx"
|
||||
ANDROID_PLATFORMS_PATH="$ANDROID_HOME/platforms"
|
||||
else
|
||||
[ -x "$(which dx)" ] && DX="dx" \
|
||||
|| (echo "Please provide \$ANDROID_HOME or set \$PATH to include 'dx' executable"; exit 1)
|
||||
[ -x "$(which aidl)" ] && AIDL="aidl" \
|
||||
|| (echo "Please provide \$ANDROID_HOME or set \$PATH to include 'aidl' executable"; exit 1)
|
||||
[ "$ANDROID_PLATFORMS_PATH" == "" ] && \
|
||||
(echo "Please provide \$ANDROID_HOME or set \$ANDROID_PLATFORMS_PATH"; exit 1)
|
||||
fi
|
||||
|
||||
BUILD_DIR="$(realpath ${BUILD_DIR:-build_manual})"
|
||||
|
@ -57,7 +60,7 @@ cd "$SERVER_DIR/src/main/aidl"
|
|||
|
||||
echo "Compiling java sources..."
|
||||
cd ../java
|
||||
javac -bootclasspath "$ANDROID_HOME/platforms/android-$PLATFORM/android.jar" \
|
||||
javac -bootclasspath "$ANDROID_PLATFORMS_PATH/android-$PLATFORM/android.jar" \
|
||||
-cp "$CLASSES_DIR" -d "$CLASSES_DIR" -source 1.8 -target 1.8 \
|
||||
com/genymobile/scrcpy/*.java \
|
||||
com/genymobile/scrcpy/wrappers/*.java
|
||||
|
|
Loading…
Add table
Reference in a new issue