forked from TBD54566975/didpay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
87 lines (74 loc) · 1.7 KB
/
Justfile
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Run the Flutter app
run:
flutter run
# Get Flutter and Dart packages
get:
#!/bin/bash
echo "Getting dependencies for main project"
flutter pub get
echo "Getting dependencies for packages"
for dir in packages/*; do \
if [ -d $dir ]; then \
echo "Getting dependencies in $dir"; \
(cd $dir && flutter pub get || dart pub get); \
fi \
done
# Clean the project
clean:
flutter clean
# Build the app for release
build:
flutter build apk
# Run tests
test: test-app test-packages
# regenerate platform icons from assets/icon.jpg - if you replace the file run this:
icons:
flutter pub run flutter_launcher_icons
# Run Flutter tests
test-app:
flutter test
# Run package tests
test-packages:
#!/bin/bash
for dir in packages/*; do \
if [ -d $dir ]; then \
echo "Running tests in $dir"; \
(cd $dir && dart test); \
fi \
done
# Analyze the project's Dart code
analyze:
#!/bin/bash
dart fix --apply
flutter analyze
for dir in packages/*; do \
if [ -d $dir ]; then \
(cd $dir && dart analyze); \
fi \
done
# Generate code (localization, etc.)
generate:
flutter gen-l10n
# Coverage report
coverage:
#!/bin/bash
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
open coverage/html/index.html
# Set build number base on timestamp
set-build-number:
#!/bin/bash
export PATH="$PATH:$HOME/.pub-cache/bin"
if ! command -v cider &> /dev/null
then
flutter pub global activate cider
else
echo "Cider is already installed."
fi
cider bump build --build=$(date '+%s')
# Build android app bundle
android-app-bundle:
flutter build appbundle
# Build android apk
android-apk:
flutter build apk --release