-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (28 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
33 lines (28 loc) · 1.47 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
PROJECT := OClock.xcodeproj
SCHEME := OClock
DESTINATION := platform=macOS
BUILD_DIR := build
APP_PATH := $(BUILD_DIR)/Build/Products/Release/OClock.app
DMG_STAGING := $(BUILD_DIR)/dmg-staging
DMG_PATH := OClock.dmg
.PHONY: lint test app dmg
# SwiftLint runs as an Xcode build tool plugin (see project.yml), so linting
# happens as a side effect of building. -skipPackagePluginValidation bypasses
# the one-time "enable this plugin" prompt Xcode would otherwise show in the GUI.
lint:
xcodebuild build -project $(PROJECT) -scheme $(SCHEME) -destination '$(DESTINATION)' -skipPackagePluginValidation
test:
xcodebuild test -project $(PROJECT) -scheme $(SCHEME) -destination '$(DESTINATION)' -skipPackagePluginValidation
# Builds an unsigned Release .app, useful for local distribution without an
# Apple Developer account. Output: build/Build/Products/Release/OClock.app
app:
xcodebuild build -project $(PROJECT) -scheme $(SCHEME) -configuration Release -derivedDataPath $(BUILD_DIR) -skipPackagePluginValidation CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=-
# Packages the unsigned .app into a distributable OClock.dmg with a symlink
# to /Applications, using the built-in hdiutil (no extra tools required).
dmg: app
rm -rf $(DMG_STAGING) $(DMG_PATH)
mkdir -p $(DMG_STAGING)
cp -R $(APP_PATH) $(DMG_STAGING)/
ln -s /Applications $(DMG_STAGING)/Applications
hdiutil create -volname OClock -srcfolder $(DMG_STAGING) -ov -format UDZO $(DMG_PATH)
rm -rf $(DMG_STAGING)