2
0
mirror of https://github.com/inventree/inventree-app.git synced 2026-05-15 12:27:31 +00:00
Files
inventree-app/tasks.py
T
Asher Edwards 39b7b3ea09 fix: build environments with spaces can now be used (#816)
Small little fix that allows build environments with spaces. My space was giving errors of `bash: line 1: cd: too many arguments`
2026-05-10 14:23:27 +10:00

45 lines
1.0 KiB
Python

"""Invoke tasks for building the InvenTree mobile app."""
import os
import sys
from invoke import task
@task
def format(c):
"""Code formatting using dart format."""
c.run("fvm dart format lib")
@task
def clean(c):
"""Clean flutter build."""
c.run("fvm flutter clean")
@task
def update(c):
"""Update flutter dependencies."""
c.run("flutter pub get")
@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, update, translate])
def ios(c):
"""Build iOS app in release configuration."""
c.run("fvm flutter build ipa --release --no-tree-shake-icons")
@task(pre=[clean, update, translate])
def android(c):
"""Build Android app in release configuration."""
c.run("fvm flutter build appbundle --release --no-tree-shake-icons")