forked from inventree/inventree-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
35 lines (24 loc) · 764 Bytes
/
tasks.py
File metadata and controls
35 lines (24 loc) · 764 Bytes
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
"""Invoke tasks for building the app"""
import os
import sys
from invoke import task
@task
def clean(c):
"""Clean flutter build"""
c.run("flutter clean")
@task
def translate(c):
"""Update translation files"""
here = os.path.dirname(__file__)
l10_dir = os.path.join(here, 'lib', 'l10n')
l10_dir = os.path.abspath(l10_dir)
python = 'python3' if sys.platform.lower() == 'darwin' else 'python'
c.run(f"cd {l10_dir} && {python} collect_translations.py")
@task(pre=[clean, translate])
def ios(c):
"""Build iOS app"""
c.run("flutter build ipa --release --no-tree-shake-icons")
@task(pre=[clean, translate])
def android(c):
"""Build Android app"""
c.run("flutter build appbundle --release --no-tree-shake-icons")