forked from mczachurski/wallpapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·78 lines (58 loc) · 1.69 KB
/
build.sh
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
#!/bin/bash
OUTPUT_DIR="output"
WALLPAPPER_DIR="Wallpapper.Objects"
WALLPAPPER_EXIF_DIR="WallpapperExif.Objects"
WALLPAPPER_LIB_DIR="WallpapperLib.Objects"
SRC_PATH="../../Sources"
if [ -d $OUTPUT_DIR ]; then
echo "Remove output directory"
rm -rf $OUTPUT_DIR
fi
echo "Create output directory [$OUTPUT_DIR]"
mkdir $OUTPUT_DIR
echo "Create wallpapper directory [$OUTPUT_DIR/$WALLPAPPER_DIR]"
mkdir $OUTPUT_DIR/$WALLPAPPER_DIR
echo "Create wallpapper exit directory [$OUTPUT_DIR/$WALLPAPPER_EXIF_DIR]"
mkdir $OUTPUT_DIR/$WALLPAPPER_EXIF_DIR
echo "Create wallpapper lib directory [$OUTPUT_DIR/$WALLPAPPER_LIB_DIR]"
mkdir $OUTPUT_DIR/$WALLPAPPER_LIB_DIR
cd $OUTPUT_DIR/$WALLPAPPER_LIB_DIR
echo "Compile WallpapperLib"
swiftc -c \
$SRC_PATH/WallpapperLib/*.swift \
$SRC_PATH/WallpapperLib/*/*.swift \
$SRC_PATH/WallpapperLib/*/*/*.swift \
-parse-as-library \
-module-name WallpapperLib
swiftc \
${SRC_PATH}/WallpapperLib/*.swift \
${SRC_PATH}/WallpapperLib/*/*.swift \
${SRC_PATH}/WallpapperLib/*/*/*.swift \
-emit-module \
-module-name WallpapperLib
# compile Wallpapper
cd ../$WALLPAPPER_DIR
echo "Compile Wallpapper"
swiftc -c \
${SRC_PATH}/Wallpapper/*.swift \
-I../$WALLPAPPER_LIB_DIR \
-module-name wallpapper
cd ..
swiftc -emit-executable \
$WALLPAPPER_LIB_DIR/*.o \
$WALLPAPPER_DIR/*.o \
-o wallpapper
# compile WallpapperExif
cd $WALLPAPPER_EXIF_DIR
echo "Compile WallpapperExif"
swiftc -c \
${SRC_PATH}/WallpapperExif/*.swift \
-I../$WALLPAPPER_LIB_DIR \
-module-name wallpapper_exif
cd ..
swiftc -emit-executable \
$WALLPAPPER_LIB_DIR/*.o \
$WALLPAPPER_EXIF_DIR/*.o \
-o wallpapper-exif
cd ..
echo "All done"