-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (56 loc) · 1.99 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
52
53
54
55
56
57
58
59
60
.PHONY: open
open: fix
open:
xed Package.swift
.PHONY: fix
fix: XCSHAREDDATA = .swiftpm/xcode/package.xcworkspace/xcshareddata
fix:
@mkdir -p $(XCSHAREDDATA)
@/usr/libexec/PlistBuddy -c \
"Delete :FILEHEADER" \
"$(XCSHAREDDATA)/IDETemplateMacros.plist" >/dev/null 2>&1 || true
@header=$$'\n// All Contributions by Match Group\n//\n// Copyright © ___YEAR___ Tinder \(Match Group, LLC\)\n//\n// Licensed under the Match Group Modified 3-Clause BSD License.\n// See https://github.com/Tinder/CombineUI/blob/main/LICENSE for license information.\n//'; \
/usr/libexec/PlistBuddy -c \
"Add :FILEHEADER string $$header" \
"$(XCSHAREDDATA)/IDETemplateMacros.plist" >/dev/null 2>&1
.PHONY: lint
lint: format ?= emoji
lint:
@swift package plugin \
swiftlint lint --strict --progress --reporter "$(format)"
.PHONY: analyze
analyze: target ?= CombineUI
analyze: destination ?= generic/platform=iOS
analyze: format ?= emoji
analyze:
@DERIVED_DATA="$$(mktemp -d)"; \
XCODEBUILD_LOG="$$DERIVED_DATA/xcodebuild.log"; \
xcodebuild \
-scheme "$(target)" \
-destination "$(destination)" \
-derivedDataPath "$$DERIVED_DATA" \
-configuration "Debug" \
-skipPackagePluginValidation \
CODE_SIGNING_ALLOWED="NO" \
> "$$XCODEBUILD_LOG"; \
swift package plugin \
swiftlint analyze --strict --progress --reporter "$(format)" --compiler-log-path "$$XCODEBUILD_LOG"
.PHONY: docs
docs: target ?= CombineUI
docs: destination ?= generic/platform=iOS
docs: open ?= OPEN
docs: DERIVED_DATA_PATH = .build/documentation/data
docs: ARCHIVE_PATH = .build/documentation/archive
docs:
@mkdir -p "$(DERIVED_DATA_PATH)" "$(ARCHIVE_PATH)"
xcodebuild docbuild \
-scheme "$(target)" \
-destination "$(destination)" \
-derivedDataPath "$(DERIVED_DATA_PATH)" \
-skipPackagePluginValidation \
OTHER_DOCC_FLAGS="--warnings-as-errors"
@find "$(DERIVED_DATA_PATH)" \
-type d \
-name "$(target).doccarchive" \
-exec cp -R {} "$(ARCHIVE_PATH)/" \;
$(if $(filter $(open),OPEN),@open "$(ARCHIVE_PATH)/$(target).doccarchive",)