This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
44 lines (36 loc) · 1.59 KB
/
Makefile
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
all: clean build entitlements package clean
PROJECT = $(shell basename *.xcodeproj)
WORKING_LOCATION := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
TARGET = AppCommander
CONFIGURATION = Release
SDK = iphoneos
KEYFILE := ./APIKeys.swift
KEYVAR := ${TELEMETRYDECK_APPID}
build:
@if [ ! -f $(KEYFILE) ]; then \
echo "import Foundation\nlet telemetryDeckID = \"$(KEYVAR)\"" > $(KEYFILE); \
echo "App ID written to file."; \
else \
echo "App ID file already exists."; \
fi
echo "Building $(TARGET) for $(SDK)..."
xcodebuild -project $(PROJECT) -scheme $(TARGET) -configuration $(CONFIGURATION) -sdk $(SDK) CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO SYMROOT=$(PWD)/build clean
xcodebuild -project $(PROJECT) -scheme $(TARGET) -configuration $(CONFIGURATION) -sdk $(SDK) CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO SYMROOT=$(PWD)/build -resolvePackageDependencies
xcodebuild -project $(PROJECT) -scheme $(TARGET) -configuration $(CONFIGURATION) -sdk $(SDK) CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO SYMROOT=$(PWD)/build build
echo "Build finished!"
entitlements:
echo "Adding entitlements..."
chmod a+x $(WORKING_LOCATION)bin/ldid
$(WORKING_LOCATION)bin/ldid -S"$(WORKING_LOCATION)entitlements.plist" "build/$(CONFIGURATION)-$(SDK)/$(TARGET).app"
echo "Entitlements added!"
package:
echo "Packaging app..."
rm -rf Payload
mkdir Payload
cp -r build/$(CONFIGURATION)-$(SDK)/$(TARGET).app Payload
zip -r $(TARGET).ipa Payload
echo "Packaging finished!"
clean:
rm -rf Payload
rm -rf build
echo "All done!"