-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (72 loc) · 3.4 KB
/
Copy pathMakefile
File metadata and controls
91 lines (72 loc) · 3.4 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
BUNDLE=rbenv exec bundle
LANG_VAR=LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
FASTLANE=$(LANG_VAR) $(BUNDLE) exec fastlane
# Explicit --config prevents SwiftLint from picking up nested configs in
# BuildTools/.build/checkouts/ (e.g., SwiftGenPlugin's .swiftlint.yml).
SWIFTLINT_FROM_BUILDTOOLS=swiftlint lint --working-directory .. --config .swiftlint.yml --quiet
# Parse the human-readable output of simctl
SIMULATOR_NAME = $(shell xcrun simctl list devices available \
| grep "iPhone" \
| tail -1 | sed 's/^[[:space:]]*//' | sed 's/ *(.*) *$$//')
.PHONY: help build clean test lint lint_lenient format install_dependencies
define run_in_buildtools
@pushd BuildTools && \
export SDKROOT=$$(xcrun --sdk macosx --show-sdk-path) && \
swift package plugin \
--allow-writing-to-directory .. \
--allow-writing-to-package-directory \
$(1) && \
popd
endef
help: ## Show this list of commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
swift_percentage: ## Swift and Obj-C percentage on the project
./scripts/count.rb
generate_colors: ## Generate colors and themes based on themes.csv
ruby scripts/themes/generate_themes.rb scripts/themes/theme.csv
generate_code:
$(call run_in_buildtools,generate-code-for-resources --config ../swiftgen.yml)
lint: ## Lint the codebase
$(call run_in_buildtools,$(SWIFTLINT_FROM_BUILDTOOLS))
lint_lenient:
$(call run_in_buildtools,$(SWIFTLINT_FROM_BUILDTOOLS) --lenient)
build: ## Builds the Debug configuration using Xcode
xcodebuild -project podcasts.xcodeproj \
-scheme pocketcasts \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
build
clean: ## Cleans the build artifacts
xcodebuild -project podcasts.xcodeproj \
-scheme pocketcasts \
-configuration Debug \
clean
ONLY_TESTING ?= PocketCastsTests
test: ## Build and run the PocketCastsTests target with Unit Tests using Xcode
xcodebuild test -project podcasts.xcodeproj \
-scheme pocketcasts \
-only-testing:$(ONLY_TESTING) \
-destination 'platform=iOS Simulator,name=$(SIMULATOR_NAME),OS=latest'
build_staging: ## Builds using the StagingDebug configuration
xcodebuild -project podcasts.xcodeproj \
-scheme "Pocket Casts Staging" \
-configuration StagingDebug \
-destination 'generic/platform=iOS Simulator' \
build
test_staging: ## Build and run Unit Tests using the StagingDebug configuration
xcodebuild test -project podcasts.xcodeproj \
-scheme "Pocket Casts Staging" \
-only-testing:$(ONLY_TESTING) \
-destination 'platform=iOS Simulator,name=$(SIMULATOR_NAME),OS=latest'
format: ## Lint and autocorrect linter errors
$(call run_in_buildtools,$(SWIFTLINT_FROM_BUILDTOOLS) --autocorrect)
upload_dsyms: ## Upload dSYMs
./scripts/upload-symbols -gsp $(HOME)/.configure/pocketcasts-ios/secrets/GoogleService-Info.plist -p ios ./podcasts.app.dSYM.zip
install_dependencies: ## Install dependencies to run this project
bundle install
update_proto: ## Generates the protobuffer Swift files
./scripts/update_proto.sh $(API_PATH)
external_contributor: ## Generates an empty ApiCredentials.swift so the app builds
@cp podcasts/Credentials/ApiCredentials.tpl podcasts/Credentials/LocalApiCredentials.swift
@sed -i '' 's/%{.*}//' "podcasts/Credentials/LocalApiCredentials.swift"
$(info You're ready to build the app, go ahead! 🎙)