2018-02-04 11:17:34 +00:00
|
|
|
.PHONY: default release clean build build-app build-server run dist dist-zip sums test
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2018-02-05 16:47:32 +00:00
|
|
|
GRADLE ?= ./gradlew
|
2018-01-29 16:06:44 +00:00
|
|
|
|
|
|
|
APP_BUILD_DIR := app-build
|
2018-02-07 10:47:10 +00:00
|
|
|
APP_BUILD_DEBUG_DIR := app-build-debug
|
2017-12-12 14:12:07 +00:00
|
|
|
DIST := dist
|
|
|
|
TARGET_DIR := scrcpy
|
|
|
|
|
|
|
|
VERSION := $(shell git describe --tags --always)
|
|
|
|
TARGET := $(TARGET_DIR)-$(VERSION).zip
|
|
|
|
|
|
|
|
default:
|
|
|
|
@echo 'You must specify a target. Try: make release'
|
|
|
|
|
|
|
|
release: clean dist-zip sums
|
|
|
|
|
|
|
|
clean:
|
2018-01-29 16:06:44 +00:00
|
|
|
$(GRADLE) clean
|
2018-02-07 10:47:10 +00:00
|
|
|
rm -rf "$(APP_BUILD_DIR)" "$(APP_BUILD_DEBUG_DIR)" "$(DIST)"
|
|
|
|
|
|
|
|
build-app-debug:
|
|
|
|
[ -d "$(APP_BUILD_DEBUG_DIR)" ] || ( mkdir "$(APP_BUILD_DEBUG_DIR)" && meson app "$(APP_BUILD_DEBUG_DIR)" --buildtype debug )
|
|
|
|
ninja -C "$(APP_BUILD_DEBUG_DIR)"
|
|
|
|
|
|
|
|
build-server-debug:
|
|
|
|
$(GRADLE) assembleDebug
|
|
|
|
|
|
|
|
build-debug: build-app-debug build-server-debug
|
|
|
|
|
|
|
|
run-debug:
|
|
|
|
SCRCPY_SERVER_JAR=server/build/outputs/apk/debug/server-debug.apk $(APP_BUILD_DEBUG_DIR)/scrcpy $(ARGS)
|
2017-12-12 14:12:07 +00:00
|
|
|
|
|
|
|
build-app:
|
2018-01-29 16:06:44 +00:00
|
|
|
[ -d "$(APP_BUILD_DIR)" ] || ( mkdir "$(APP_BUILD_DIR)" && meson app "$(APP_BUILD_DIR)" --buildtype release )
|
|
|
|
ninja -C "$(APP_BUILD_DIR)"
|
2017-12-12 14:12:07 +00:00
|
|
|
|
|
|
|
build-server:
|
2018-01-29 16:06:44 +00:00
|
|
|
$(GRADLE) assembleRelease
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2018-02-04 11:17:34 +00:00
|
|
|
build: build-app build-server
|
|
|
|
|
|
|
|
run:
|
|
|
|
SCRCPY_SERVER_JAR=server/build/outputs/apk/release/server-release-unsigned.apk $(APP_BUILD_DIR)/scrcpy $(ARGS)
|
|
|
|
|
|
|
|
dist: build
|
2017-12-12 14:12:07 +00:00
|
|
|
mkdir -p "$(DIST)/$(TARGET_DIR)"
|
2018-02-02 08:31:44 +00:00
|
|
|
# no need to sign the APK, we dont "install" it, this is in fact a simple jar
|
|
|
|
cp server/build/outputs/apk/release/server-release-unsigned.apk "$(DIST)/$(TARGET_DIR)/scrcpy-server.jar"
|
2018-01-29 16:06:44 +00:00
|
|
|
cp $(APP_BUILD_DIR)/scrcpy "$(DIST)/$(TARGET_DIR)/"
|
2017-12-12 14:12:07 +00:00
|
|
|
|
|
|
|
dist-zip: dist
|
|
|
|
cd "$(DIST)"; \
|
|
|
|
zip -r "$(TARGET)" "$(TARGET_DIR)"
|
|
|
|
|
|
|
|
sums:
|
|
|
|
cd "$(DIST)"; \
|
|
|
|
sha256sum *.zip > SHA256SUM.txt
|
2017-12-14 10:38:44 +00:00
|
|
|
|
|
|
|
test:
|
2018-01-29 16:06:44 +00:00
|
|
|
$(GRADLE) test
|
|
|
|
ninja -C "$(APP_BUILD_DIR)" test
|