-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
105 lines (87 loc) · 3.09 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright IBM Corporation 2016
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Makefile
# Customized from the original for this project - [email protected]
ifndef BUILD_SCRIPTS_DIR
BUILD_SCRIPTS_DIR = ./scripts
endif
UNAME = ${shell uname}
TEST_SERVER_PIDFILE = test-server/target/pidfile
GIT_TAG = ${shell git describe --abbrev=0 --tags}
ifeq ($(UNAME), Darwin)
SWIFTC_FLAGS =
LINKER_FLAGS =
endif
ifeq ($(UNAME), Linux)
SWIFTC_FLAGS = -Xcc -fblocks
LINKER_FLAGS = -Xlinker -rpath -Xlinker .build/debug
endif
all: build
build:
@echo --- Running build on $(UNAME)
@echo --- Build scripts directory: ${BUILD_SCRIPTS_DIR}
@echo --- Checking swift version
swift --version
@echo --- Checking swiftc version
swiftc --version
@echo --- Checking git revision and branch
-git rev-parse HEAD
-git rev-parse --abbrev-ref HEAD
ifeq ($(UNAME), Linux)
@echo --- Checking Linux release
-lsb_release -d
endif
@echo --- Invoking swift build
swift build $(SWIFTC_FLAGS) $(LINKER_FLAGS)
Tests/LinuxMain.swift:
ifeq ($(UNAME), Linux)
@echo --- Generating $@
bash ${BUILD_SCRIPTS_DIR}/generate_linux_main.sh
endif
test: build Tests/LinuxMain.swift test-server/target/test-server.jar
@echo --- Invoking tests
${BUILD_SCRIPTS_DIR}/run-tests.sh
refetch:
@echo --- Removing Packages directory
rm -rf Packages
@echo --- Fetching dependencies
swift package fetch
clean:
@echo --- Cleaning Swift and test-server builds
swift package clean
cd test-server && mvn clean
ifeq ($(UNAME), Linux)
rm -f Tests/LinuxMain.swift
endif
run: build
./.build/debug/VertxEventBus
test-server/target/test-server.jar:
cd test-server && mvn package
docs: build
@echo -- Generating docs for ${GIT_TAG}
@echo -- Checking sourcekitten version
sourcekitten version
@echo -- Checking jazzy version
jazzy --version
sourcekitten doc --spm-module VertxEventBus > /tmp/VertxEventBus.json
jazzy --sourcekitten-sourcefile /tmp/VertxEventBus.json \
--module VertxEventBus \
--author "Toby Crawley" \
--author_url http://tcrawley.org \
--root-url http://tobias.github.io/vertx-swift-eventbus/${GIT_TAG}/ \
--github_url https://github.com/tobias/vertx-swift-eventbus \
--github-file-prefix https://github.com/tobias/vertx-swift-eventbus/tree/${GIT_TAG} \
--module-version ${GIT_TAG} \
--output docs/${GIT_TAG}
.PHONY: clean build refetch run test