This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
53 lines (52 loc) · 2.13 KB
/
.travis.yml
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
language: swift
osx_image: xcode9.3
env:
global:
- SDK=macosx
- TARGET=x86_64-apple-darwin17.5.0
matrix:
- PLAYGROUND_DIR="Chapter 1/Floating Point Approximates.playground"
- PLAYGROUND_DIR="Chapter 1/Floating Point Environment.playground"
- PLAYGROUND_DIR="Chapter 2/Cardinal Numbers.playground"
- PLAYGROUND_DIR="Chapter 2/Currencies.playground"
- PLAYGROUND_DIR="Chapter 2/Custom Formats.playground"
- PLAYGROUND_DIR="Chapter 2/Decimal Numbers.playground"
- PLAYGROUND_DIR="Chapter 2/Integer and Fraction Digits.playground"
- PLAYGROUND_DIR="Chapter 2/Ordinal Numbers.playground"
- PLAYGROUND_DIR="Chapter 2/Percentages.playground"
- PLAYGROUND_DIR="Chapter 2/Rounding Modes.playground"
- PLAYGROUND_DIR="Chapter 2/Scientific Notation.playground"
- PLAYGROUND_DIR="Chapter 2/Significant Digits.playground"
- PLAYGROUND_DIR="Chapter 3/Currency Converter.playground"
- PLAYGROUND_DIR="Chapter 3/Money.playground"
- PLAYGROUND_DIR="Chapter 4/Configuring Precision.playground"
- PLAYGROUND_DIR="Chapter 4/Natural Scale.playground"
- PLAYGROUND_DIR="Chapter 4/Provided Units.playground"
- PLAYGROUND_DIR="Chapter 4/Temperature Formatting.playground"
- PLAYGROUND_DIR="Chapter 4/Units Interoperability.playground"
- PLAYGROUND_DIR="Chapter 5/Agricultural Flight Planner.playground"
script:
xcrun swift --version &&
cd "${PLAYGROUND_DIR}" &&
if ! xcrun swiftc -emit-imported-modules Contents.swift |
grep -q "PlaygroundSupport";
then
if [[ -n $(find . -name "Sources") ]];
then
echo "import AuxiliarySources" | cat - Contents.swift > main.swift &&
xcrun -sdk "${SDK}"
swiftc -target "${TARGET}"
-emit-library -emit-module -module-name AuxiliarySources
Sources/*.swift &&
xcrun -sdk "${SDK}"
swiftc -target "${TARGET}"
-I "." -L "."
-lAuxiliarySources
-module-link-name AuxiliarySources
-o Playground main.swift;
else
xcrun -sdk "${SDK}"
swiftc -target "${TARGET}"
-o Playground Contents.swift;
fi;
fi;