Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·59 lines (47 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
executable file
·59 lines (47 loc) · 1.45 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
48
49
50
51
52
53
54
55
56
57
58
59
NAME := BatSign
SCHEME := Feather
PLATFORMS := iphoneos maccatalyst
TMP := $(TMPDIR)/$(NAME)
CERT_JSON_URL := https://backloop.dev/pack.json
.PHONY: all clean deps $(PLATFORMS)
all: $(PLATFORMS)
clean:
rm -rf $(TMP)
rm -rf packages
rm -rf Payload
deps:
rm -rf deps || true
mkdir -p deps
-curl -fsSL "$(CERT_JSON_URL)" -o cert.json
@if [ -f cert.json ]; then \
jq -r '.cert' cert.json > deps/server.crt; \
jq -r '.key1, .key2' cert.json > deps/server.pem; \
jq -r '.info.domains.commonName' cert.json > deps/commonName.txt; \
fi
$(PLATFORMS): deps
rm -rf _build
@if [ "$@" = "iphoneos" ]; then \
DEST="generic/platform=iOS"; \
else \
DEST="generic/platform=macOS,variant=Mac Catalyst"; \
fi; \
xcodebuild \
-project Feather.xcodeproj \
-scheme $(SCHEME) \
-configuration Release \
-destination "$$DEST" \
-derivedDataPath $(TMP)/$@ \
-skipPackagePluginValidation \
CODE_SIGNING_ALLOWED=NO \
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO
mkdir -p _build/Payload
cp -R _build/Applications/*.app _build/Payload/BatSign.app
chmod -R 0755 _build/Payload/BatSign.app
codesign --force --sign - --timestamp=none _build/Payload/BatSign.app
cp deps/* _build/Payload/BatSign.app/ || true
mkdir -p packages
@if [ "$@" = "iphoneos" ]; then \
ditto -c -k --sequesterRsrc --keepParent _build/Payload "packages/BatSign.ipa"; \
else \
ditto -c -k --sequesterRsrc --keepParent _build/Payload/BatSign.app "packages/BatSign_Catalyst.zip"; \
fi