]>
Commit | Line | Data |
---|---|---|
169297c8 BB |
1 | configuration = debug |
2 | build_path = .build | |
3 | ||
4 | # These are used to rename the executable to lrc without renaming the package | |
5 | source_binary_name = lyricli | |
6 | target_binary_name = lrc | |
7 | install_path = /usr/local/bin | |
8 | source_binary_path = $(build_path)/$(configuration)/$(source_binary_name) | |
9 | install_binary_path = $(install_path)/$(target_binary_name) | |
e4131bea RBR |
10 | swift_version = 5.8.0 |
11 | architecture = $(shell uname -m) | |
169297c8 BB |
12 | |
13 | # Default to release configuration on install | |
14 | install: configuration = release | |
15 | ||
16 | default: build | |
17 | ||
2a7cc524 | 18 | build: |
e4131bea | 19 | swift build --build-path $(build_path) --configuration $(configuration) --arch $(architecture) -Xswiftc -cross-module-optimization |
169297c8 BB |
20 | |
21 | install: build | |
3a398bc0 | 22 | sudo cp $(source_binary_path) $(install_binary_path) |
169297c8 BB |
23 | |
24 | test: build | |
25 | swift test | |
26 | ||
307993a0 BB |
27 | lint: |
28 | cd Sources && swiftlint | |
29 | ||
2a7cc524 | 30 | document: build |
0a349ded BB |
31 | sourcekitten doc --spm-module $(source_binary_name) > $(build_path)/$(source_binary_name).json |
32 | jazzy \ | |
33 | -s $(build_path)/$(source_binary_name).json \ | |
34 | --readme README.md \ | |
35 | --clean \ | |
36 | --author Lyricli \ | |
ffca0db7 BB |
37 | --author_url https://gitlab.com/lyricli \ |
38 | --github_url https://gitlab.com/lyricli/lyricli \ | |
101a6ecc | 39 | --module-version 1.0.0 \ |
0a349ded BB |
40 | --module Lyricli \ |
41 | ||
169297c8 | 42 | clean: |
c32d8723 | 43 | swift package clean |
169297c8 | 44 | |
6a628388 BB |
45 | docker-build: |
46 | docker build --force-rm --build-arg swift_version=$(swift_version) -t lyriclitest/swift:$(swift_version) . | |
47 | ||
48 | docker-push: docker-build | |
49 | docker push lyriclitest/swift:$(swift_version) | |
50 | ||
51 | .PHONY: build install test clean lint docker-build docker-push |