Files
immich/mobile/mise.toml
T

246 lines
6.5 KiB
TOML

[tools]
java = "21.0.2"
# RUSTUP_TOOLCHAIN makes rustup ignore the targets in rust-toolchain.toml, so the cross targets are listed here too.
rust = { version = "1.98.0", targets = "aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios" }
[tools."aqua:flutter/flutter"]
version = "3.47.2"
postinstall = "bash {{config_root}}/ios/scripts/xcode_flutter_patch.sh"
[tools."github:CQLabs/homebrew-dcm"]
version = "1.39.1"
bin = "dcm"
postinstall = "chmod +x \"$MISE_TOOL_INSTALL_PATH/dcm\" || true"
[tools."github:CQLabs/homebrew-dcm".platforms]
linux-x64 = { asset_pattern = "dcm-linux-x64-release.zip" }
linux-arm64 = { asset_pattern = "dcm-linux-arm-release.zip" }
macos-x64 = { asset_pattern = "dcm-macos-x64-release.zip" }
macos-arm64 = { asset_pattern = "dcm-macos-arm-release.zip" }
windows-x64 = { asset_pattern = "dcm-windows-release.zip" }
[tasks.clean]
description = "Clean all build/codegen artifacts"
run = [
"flutter clean",
"rm -rf generated lib/generated test/drift/main/generated ios/build ios/Pods android/.gradle",
"rm -f ios/Build.log lib/routing/router.gr.dart",
"find lib \\( -name '*.g.dart' -o -name '*.drift.dart' -o -name '*.freezed.dart' \\) -delete",
]
[tasks.codegen]
alias = "codegen"
description = "Generate all codegen artifacts"
depends = [
"//:open-api-dart",
"//native:codegen",
"codegen:dart",
"codegen:drift:migration",
"codegen:drift:schema",
"codegen:pigeon",
"codegen:translation",
]
[tasks."codegen:dart"]
description = "Execute build_runner to auto-generate dart code"
sources = [
"pubspec.yaml",
"build.yaml",
"lib/**/*.dart",
"lib/**/*.drift",
]
outputs = ["lib/**/*.g.dart", "lib/**/*.drift.dart", "lib/**/*.freezed.dart", "lib/routing/router.gr.dart"]
run = [
"dart run build_runner build",
"dart format lib/routing/router.gr.dart",
]
depends = ["//:open-api-dart"]
wait_for = ["codegen:drift:migration"]
[tasks."codegen:drift:migration"]
alias = "migration"
description = "Generate Drift migrations"
sources = [
"build.yaml",
"pubspec.yaml",
"drift_schemas/main/*.json",
"lib/data/db/**/*.dart",
]
outputs = ["lib/data/db/main/database.steps.dart"]
run = "dart run drift_dev make-migrations"
depends = ["//:open-api-dart"]
[tasks."codegen:drift:schema"]
description = "Generate Drift migration schema test code"
sources = ["drift_schemas/main/*.json"]
outputs = ["test/drift/main/generated/"]
run = "dart run drift_dev schema generate --data-classes --companions drift_schemas/main/ test/drift/main/generated/"
depends = ["//:open-api-dart"]
wait_for = ["codegen:drift:migration"]
[tasks."codegen:watch"]
alias = "watch"
description = "Watch and auto-generate dart code"
run = "dart run build_runner watch"
[tasks."codegen:native"]
description = "Generate ffigen bindings for the native core"
dir = "../native/immich_native_core"
run = [
"flutter pub get",
"dart run ffigen --config ffigen.yaml",
]
[tasks."codegen:pigeon"]
alias = "pigeon"
description = "Generate pigeon platform code"
run = [
"ls pigeon/*.dart | xargs -n1 -P4 -I{} dart run pigeon --input {}",
"dart format lib/platform/",
]
depends = ["//:open-api-dart"]
[tasks."codegen:translation"]
alias = "translation"
description = "Generate translations from i18n JSONs"
depends = ["//:i18n:format-fix", "i18n:loader", "i18n:keys"]
[tasks."codegen:app-icon"]
description = "Generate app icons"
run = "flutter pub run flutter_launcher_icons:main"
[tasks."codegen:splash"]
description = "Generate splash screen"
run = "flutter pub run flutter_native_splash:create"
[tasks.test]
description = "Run mobile tests"
run = "flutter test"
[tasks.analyze]
alias = "lint"
description = "Analyze Dart code"
usage = '''
flag "--full" help="Check for unused code" default=#false
'''
depends = ["analyze:dart", "analyze:dcm"]
run = '''
if [ "${usage_full}" = "true" ]; then
mise run analyze:unused
fi
'''
[tasks."analyze-fix"]
alias = "lint-fix"
description = "Auto-fix Dart code"
depends = ["analyze-fix:dart", "analyze-fix:dcm"]
[tasks.format]
description = "Format Dart code"
run = "dart format --set-exit-if-changed $(find lib -name '*.dart' -not \\( -name '*.g.dart' -o -name '*.drift.dart' -o -name '*.gr.dart' \\))"
[tasks."build:android"]
description = "Build Android release"
run = "flutter build appbundle"
[tasks.install]
alias = "install"
description = "Install flutter dependencies"
depends = ["//:open-api-dart"]
run = [
# This receives passed `--enforce-lockfile` args
"flutter pub get",
{ task = "install:ios" },
]
[tasks."install:ci"]
description = "Install flutter dependencies in CI"
run = [
{ task = "install", args = ["--enforce-lockfile"] },
]
[tasks.checkout]
description = "Bring a checkout up to date after switching branches"
run = [
{ task = "install" },
{ task = "checkout:ios" },
{ task = "codegen" },
]
[tasks."checkout:ios"]
description = "Bring the iOS project up to date after switching branches"
run = "bash ./scripts/checkout_ios.sh"
[tasks.start]
alias = "start"
description = "Start flutter app"
run = "flutter run"
# Internal tasks
[tasks."i18n:loader"]
description = "Generate i18n loader"
hide = true
run = [
"dart run easy_localization:generate -S ../i18n",
"dart format lib/generated/codegen_loader.g.dart",
]
depends = ["//:open-api-dart"]
wait_for = ["//:i18n:format-fix"]
[tasks."i18n:keys"]
description = "Generate i18n keys"
hide = true
run = [
"dart run bin/generate_keys.dart",
"dart format lib/generated/translations.g.dart",
]
wait_for = ["//:i18n:format-fix"]
[tasks."install:ios"]
description = "Install CocoaPods dependencies"
hide = true
sources = ["ios/Podfile", "ios/Podfile.lock", ".flutter-plugins-dependencies"]
outputs = ["ios/Pods/Manifest.lock"]
run = '''
echo "Running pod install"
if [ "$(uname)" != "Darwin" ]; then
exit 0
fi
cd ios && pod install
'''
[tasks."analyze:dart"]
description = "Run Dart analysis"
hide = true
run = "dart analyze --fatal-infos"
[tasks."analyze:dcm"]
description = "Run Dart Code Metrics"
hide = true
run = "dcm analyze lib --fatal-style --fatal-warnings"
[tasks."analyze:unused"]
description = "Find unused code"
run = "dcm check-unused-code lib test integration_test --concise"
[tasks."analyze-fix:dart"]
description = "Auto-fix Dart analysis"
hide = true
run = "dart fix --apply"
[tasks."analyze-fix:dcm"]
description = "Auto-fix Dart Code Metrics"
hide = true
run = "dcm fix lib"
[tasks.checklist]
run = [
{ task = "codegen:pigeon" },
{ task = "codegen:dart" },
{ task = "codegen:translation" },
{ task = "analyze" },
{ task = "format" },
{ task = "test" },
]