summaryrefslogtreecommitdiff
path: root/justfile
blob: 7a2d32efe329b8fe705bb9d5b3f04831b287488e (plain) (blame)
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
import? 'xcode.just'
import? 'environment.just'

target := 'Sora'
identifier := "me.fuwn." + target

alias fmt := format
alias b := build
alias gen := generate

fetch:
   curl https://raw.githubusercontent.com/Fuwn/justfiles/refs/heads/main/xcode.just > xcode.just

format:
	just _format {{target}}

build destination="platform=macOS":
  command -v xcbeautify >/dev/null 2>&1 \
    && xcodebuild -configuration Release -scheme {{target}} -destination '{{destination}}' build | xcbeautify \
    || just _build {{target}}

build_ios:
  just build "platform=iOS,arch=arm64,name={{device_name}}"

open:
	just _open {{target}}

install location="/Users/${USER}/Applications" derived_data='/Users/${USER}/Library/Developer/Xcode/DerivedData':
  cp -r {{derived_data}}/{{target}}-*/Build/Products/Release/{{target}}.app {{location}}

generate:
  mint run xcodegen@synced_folder generate

install_ios location="/Users/${USER}/Applications" derived_data='/Users/${USER}/Library/Developer/Xcode/DerivedData':
  xcrun devicectl device install app --device {{device_identifier}} {{derived_data}}/{{target}}-*/Build/Products/Release-iphoneos/{{target}}.app

run_ios:
  xcrun devicectl device process launch --device {{device_identifier}} {{identifier}}