2018-02-04 19:17:34 +08:00
|
|
|
.PHONY: default release clean build build-app build-server run dist dist-zip sums test
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2018-02-06 00:47:32 +08:00
|
|
|
GRADLE ?= ./gradlew
|
2018-01-30 00:06:44 +08:00
|
|
|
|
|
|
|
APP_BUILD_DIR := app-build
|
2017-12-12 22:12:07 +08: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-30 00:06:44 +08:00
|
|
|
$(GRADLE) clean
|
|
|
|
rm -rf "$(APP_BUILD_DIR)" "$(DIST)"
|
2017-12-12 22:12:07 +08:00
|
|
|
|
|
|
|
build-app:
|
2018-01-30 00:06:44 +08:00
|
|
|
[ -d "$(APP_BUILD_DIR)" ] || ( mkdir "$(APP_BUILD_DIR)" && meson app "$(APP_BUILD_DIR)" --buildtype release )
|
|
|
|
ninja -C "$(APP_BUILD_DIR)"
|
2017-12-12 22:12:07 +08:00
|
|
|
|
|
|
|
build-server:
|
2018-01-30 00:06:44 +08:00
|
|
|
$(GRADLE) assembleRelease
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2018-02-04 19:17:34 +08: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 22:12:07 +08:00
|
|
|
mkdir -p "$(DIST)/$(TARGET_DIR)"
|
2018-02-02 16:31:44 +08: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-30 00:06:44 +08:00
|
|
|
cp $(APP_BUILD_DIR)/scrcpy "$(DIST)/$(TARGET_DIR)/"
|
2017-12-12 22:12:07 +08:00
|
|
|
|
|
|
|
dist-zip: dist
|
|
|
|
cd "$(DIST)"; \
|
|
|
|
zip -r "$(TARGET)" "$(TARGET_DIR)"
|
|
|
|
|
|
|
|
sums:
|
|
|
|
cd "$(DIST)"; \
|
|
|
|
sha256sum *.zip > SHA256SUM.txt
|
2017-12-14 18:38:44 +08:00
|
|
|
|
|
|
|
test:
|
2018-01-30 00:06:44 +08:00
|
|
|
$(GRADLE) test
|
|
|
|
ninja -C "$(APP_BUILD_DIR)" test
|