2018-09-22 20:56:16 +00:00
|
|
|
GIT_LAST_COMMIT := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
2018-10-15 17:16:47 +00:00
|
|
|
FLUTTER ?= flutter
|
2018-09-22 20:56:16 +00:00
|
|
|
|
2020-06-17 15:54:19 +00:00
|
|
|
ifneq ($(DRONE_BUILD_NUMBER),)
|
|
|
|
VERSION ?= $(DRONE_BUILD_NUMBER)
|
2018-09-22 20:56:16 +00:00
|
|
|
else
|
2020-06-17 15:54:19 +00:00
|
|
|
VERSION ?= 1
|
2018-09-22 20:56:16 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2018-10-15 17:16:47 +00:00
|
|
|
$(FLUTTER) test
|
2018-09-22 20:56:16 +00:00
|
|
|
|
|
|
|
.PHONY: build-all
|
|
|
|
build-all: build-release build-debug build-profile
|
|
|
|
|
|
|
|
.PHONY: build-release
|
|
|
|
build-release:
|
2020-06-17 15:54:19 +00:00
|
|
|
$(FLUTTER) build apk --release --build-number=$(VERSION) --flavor main
|
2018-09-22 20:56:16 +00:00
|
|
|
|
|
|
|
.PHONY: build-debug
|
|
|
|
build-debug:
|
2020-06-17 15:54:19 +00:00
|
|
|
$(FLUTTER) build apk --debug --build-number=$(VERSION) --flavor unsigned
|
2018-09-22 20:56:16 +00:00
|
|
|
|
|
|
|
.PHONY: build-profile
|
|
|
|
build-profile:
|
2020-06-17 15:54:19 +00:00
|
|
|
$(FLUTTER) build apk --profile --build-number=$(VERSION) --flavor unsigned
|
|
|
|
|
|
|
|
.PHONY: build-ios
|
|
|
|
build-ios:
|
|
|
|
$(FLUTTER) build ios --release --build-number=$(VERSION) --no-codesign
|
2018-10-15 17:16:47 +00:00
|
|
|
|
|
|
|
.PHONY: format
|
|
|
|
format:
|
|
|
|
$(FLUTTER) format lib
|
|
|
|
|
|
|
|
.PHONY: format-check
|
|
|
|
format-check:
|
|
|
|
@diff=$$(flutter format -n lib); \
|
|
|
|
if [ -n "$$diff" ]; then \
|
|
|
|
echo "The following files are not formatted correctly:"; \
|
|
|
|
echo "$${diff}"; \
|
|
|
|
echo "Please run 'make format' and commit the result."; \
|
|
|
|
exit 1; \
|
|
|
|
fi;
|