This repository was archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (40 loc) · 1.33 KB
/
Makefile
File metadata and controls
53 lines (40 loc) · 1.33 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
# Common vars
SWIFT := swift
XCODE := xcodebuild
BUILDPATH := ./.build
DOCSPATH := ./docs
# Build vars
SOURCES := $(shell find ./Sources -name '*.swift')
ARCHPATH := $(BUILDPATH)/artifacts
BUILDFLAGS := -scheme speechly-ios-client -sdk iphoneos -destination 'generic/platform=iOS'
# Test vars
TESTSOURCES := $(shell find ./Tests -name '*.swift')
TESTFLAGS := -scheme speechly-ios-client -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12'
# Build state vars
DEBUGBUILD := $(ARCHPATH)/debug.xcarchive
RELEASEBUILD := $(ARCHPATH)/release.xcarchive
# Common
.PHONY:
all: deps test release docs
.PHONY:
deps: Package.swift
$(SWIFT) package resolve
.PHONY:
test:
$(XCODE) test $(TESTFLAGS)
.PHONY:
debug: $(DEBUGBUILD)
.PHONY:
release: $(RELEASEBUILD)
.PHONY:
clean:
@$(SWIFT) package clean
@rm -rf $(BUILDPATH)
@rm -rf $(DOCSPATH)
$(DOCSPATH): $(SOURCES)
$(SWIFT) doc generate ./Sources/ --module-name Speechly --output $(DOCSPATH) --base-url ""
@sed -i.bak -E 's/(\[.+\])\((.+)\)/\1(\2.md)/g' docs/*.md && rm docs/*.md.bak
$(RELEASEBUILD): $(SOURCES) Package.swift
$(XCODE) archive $(BUILDFLAGS) -archivePath "$(ARCHPATH)/release" -configuration Release
$(DEBUGBUILD): $(SOURCES) Package.swift
$(XCODE) archive $(BUILDFLAGS) -archivePath "$(ARCHPATH)/debug" -configuration Debug