forked from DavBfr/flutter_about
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (56 loc) · 2.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (C) 2019, David PHAM-VAN <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FLUTTER?=$(realpath $(dir $(realpath $(dir $(shell which flutter)))))
FLUTTER_BIN=$(FLUTTER)/bin/flutter
DART_BIN=$(FLUTTER)/bin/dart
DART_SRC=$(shell find . -name '*.dart')
COV_PORT=9292
all: example/.metadata format
example/.metadata:
cd example; flutter create -t app --no-overwrite --org net.nfet --project-name example .
rm -rf example/test example/integration_test
format: $(DART_SRC)
$(DART_BIN) format --fix $^
.coverage:
$(DART_BIN) pub global activate coverage
touch $@
node_modules:
npm install lcov-summary
test/readme_test.dart: test/extract_readme.dart README.md pubspec.lock
$(DART_BIN) test/extract_readme.dart
test: .coverage test/readme_test.dart node_modules
$(FLUTTER_BIN) test --coverage --coverage-path lcov.info
cat lcov.info | node_modules/.bin/lcov-summary
update-golden:
$(FLUTTER_BIN) test --update-goldens
clean:
git clean -fdx -e .vscode
publish: format analyze clean
test -z "$(shell git status --porcelain)"
find . -name pubspec.yaml -exec sed -i -e 's/^dependency_overrides:/_dependency_overrides:/g' '{}' ';'
$(DART_BIN) pub publish -f
find . -name pubspec.yaml -exec sed -i -e 's/^_dependency_overrides:/dependency_overrides:/g' '{}' ';'
git tag $(shell grep version pubspec.yaml | sed 's/version\s*:\s*/about-/g')
.pana:
$(DART_BIN) pub global activate pana
touch $@
analyze: .pana
@find . -name pubspec.yaml -exec sed -i -e 's/^dependency_overrides:/_dependency_overrides:/g' '{}' ';'
$(DART_BIN) pub global run pana --no-warning --source path .
@find . -name pubspec.yaml -exec sed -i -e 's/^_dependency_overrides:/dependency_overrides:/g' '{}' ';'
pubspec.lock: pubspec.yaml
$(FLUTTER_BIN) pub get
fix: pubspec.lock
$(DART_BIN) pub global run dartfix:fix --overwrite .
.PHONY: test format clean publish analyze fix