Added formatting check to makefile and ci (#17)
the build failed Details

This commit is contained in:
konrad 2018-10-15 17:16:47 +00:00 committed by Gitea
parent abf0196de3
commit 7755b9c812
2 changed files with 31 additions and 15 deletions

View File

@ -8,6 +8,18 @@ clone:
tags: true
pipeline:
build:
image: nathansamson/flutter-builder-docker:v0.6.0
pull: true
commands:
- flutter packages get
- make format-check
- make build-all
- mkdir apks
- mv build/app/outputs/apk/*/*/*.apk apks
when:
event: [ push, tag ]
test:
image: nathansamson/flutter-builder-docker:v0.6.0
pull: true
@ -16,17 +28,6 @@ pipeline:
when:
event: [ push, tag, pull_request ]
build:
image: nathansamson/flutter-builder-docker:v0.6.0
pull: true
commands:
- flutter packages get
- make build-all
- mkdir apks
- mv build/app/outputs/apk/*/*/*.apk apks
when:
event: [ push, tag ]
# Push the releases to our pseudo-s3-bucket
release:
image: plugins/s3:1

View File

@ -1,4 +1,5 @@
GIT_LAST_COMMIT := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
FLUTTER ?= flutter
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))-$(GIT_LAST_COMMIT)
@ -12,19 +13,33 @@ endif
.PHONY: test
test:
flutter test
$(FLUTTER) test
.PHONY: build-all
build-all: build-release build-debug build-profile
.PHONY: build-release
build-release:
flutter build apk --release --build-name=$(VERSION) --flavor main
$(FLUTTER) build apk --release --build-name=$(VERSION) --flavor main
.PHONY: build-debug
build-debug:
flutter build apk --debug --build-name=$(VERSION) --flavor unsigned
$(FLUTTER) build apk --debug --build-name=$(VERSION) --flavor unsigned
.PHONY: build-profile
build-profile:
flutter build apk --profile --build-name=$(VERSION) --flavor unsigned
$(FLUTTER) build apk --profile --build-name=$(VERSION) --flavor unsigned
.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;