-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathMakefile
51 lines (36 loc) · 1.34 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
45
46
47
48
49
50
51
BUILD_DIR = $(CURDIR)/build
ARCHIVE_PATH = $(CURDIR)/build/LinearMouse.xcarchive
_target_DIR = $(CURDIR)/build/_target
_target_DMG = $(CURDIR)/build/LinearMouse.dmg
all: configure clean lint test package
configure: Signing.xcconfig Version.xcconfig .git/hooks/pre-commit
configure-release: configure Release.xcconfig
Signing.xcconfig:
@./Scripts/configure-code-signing
Version.xcconfig:
@./Scripts/configure-version
Release.xcconfig:
@./Scripts/configure-release
.git/hooks/pre-commit:
cp ./Scripts/pre-commit $@
clean:
rm -fr build
lint:
swiftformat --lint .
swiftlint .
test:
xcodebuild test -project LinearMouse.xcodeproj -scheme LinearMouse
package: $(_target_DMG)
$(BUILD_DIR)/Release/LinearMouse.app:
xcodebuild archive -project LinearMouse.xcodeproj -scheme LinearMouse -archivePath '$(ARCHIVE_PATH)'
xcodebuild -exportArchive -archivePath '$(ARCHIVE_PATH)' -exportOptionsPlist ExportOptions.plist -exportPath '$(BUILD_DIR)/Release'
$(_target_DMG): $(BUILD_DIR)/Release/LinearMouse.app
rm -rf '$(_target_DIR)'
rm -f '$(_target_DMG)'
mkdir '$(_target_DIR)'
cp -a '$(BUILD_DIR)/Release/LinearMouse.app' '$(_target_DIR)'
ln -s /Applications '$(_target_DIR)/'
hdiutil create -format UDBZ -srcfolder '$(_target_DIR)/' -volname LinearMouse '$(_target_DMG)'
prepublish: package
@./Scripts/sign-and-notarize
.PHONY: all configure test build clean package