-
Notifications
You must be signed in to change notification settings - Fork 440
Expand file tree
/
Copy pathmise.toml
More file actions
48 lines (40 loc) · 1.6 KB
/
Copy pathmise.toml
File metadata and controls
48 lines (40 loc) · 1.6 KB
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
[settings]
lockfile = true
[settings.ruby]
compile = false
[tools]
tuist = "4.48.2"
swiftlint = "0.62.2"
ruby = "3.2.0"
xcbeautify = "2.30.1"
[hooks]
postinstall = { task = "tuist-install" }
[tasks.tuist-install]
description = "Resolve Swift Package dependencies via Tuist"
run = "tuist install"
# Shell setup task (no automated test); verified manually via `mise run setup-worktree`.
[tasks.setup-worktree]
description = "Prepare a git worktree: link Local.xcconfig from the primary checkout and resolve deps. Run `tuist generate <Target>` afterwards."
depends = ["tuist-install"]
run = """
#!/usr/bin/env bash
set -euo pipefail
# The primary checkout is the parent of the shared .git directory.
primary="$(dirname "$(git rev-parse --git-common-dir)")"
current="$(git rev-parse --show-toplevel)"
# Local.xcconfig is gitignored and per-worktree. Link it from the primary
# checkout so every worktree shares one API key / config without hand-copying.
if [ "$current" != "$primary" ] && [ ! -e "Local.xcconfig" ]; then
# Clear a dangling symlink (e.g. the primary's Local.xcconfig moved) so ln/cp don't fail under set -e.
rm -f "Local.xcconfig"
if [ -f "$primary/Local.xcconfig" ]; then
ln -s "$primary/Local.xcconfig" "Local.xcconfig"
echo "Linked Local.xcconfig -> $primary/Local.xcconfig"
elif [ -f "Local.xcconfig.SAMPLE" ]; then
cp "Local.xcconfig.SAMPLE" "Local.xcconfig"
echo "WARNING: primary checkout has no Local.xcconfig; copied Local.xcconfig.SAMPLE. Fill in your API key."
else
echo "WARNING: no Local.xcconfig in the primary checkout and no Local.xcconfig.SAMPLE to copy."
fi
fi
"""