forked from packagesdev/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_app.sh
executable file
·134 lines (69 loc) · 2.93 KB
/
build_app.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh
BASEDIR="$( dirname "$0" )"
cd "$BASEDIR"
ABSOLUTE_FOLDER_PATH=`pwd`
ABSOLUTE_BUILD_PATH="$ABSOLUTE_FOLDER_PATH"/distribution/build
echo "$ABSOLUTE_FOLDER_PATH"
## Create the build folder if needed
/bin/mkdir -p distribution/build
## Create the artifacts folder if needed
/bin/mkdir -p distribution/artifacts
# Retrieve the version
VERSION="1.0"
if [ -f distribution/Version ];
then
VERSION=`cat distribution/Version`
fi
# Get the current year
CURRENT_YEAR=`date "+%Y"`
## Build goldin
pushd tool_goldin
/usr/bin/xcodebuild clean build -configuration Release -scheme "goldin" -derivedDataPath "$ABSOLUTE_BUILD_PATH" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH"
popd
## Build packagesutil
pushd packagesutil
/usr/bin/xcodebuild clean build -configuration Release -scheme "packagesutil" -derivedDataPath "$ABSOLUTE_BUILD_PATH" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH"
popd
## Build packagesbuild
pushd packagesbuild
/usr/bin/xcodebuild clean build -configuration Release -scheme "packagesbuild" -derivedDataPath "$ABSOLUTE_BUILD_PATH" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH"
popd
## Build packages_dispatcher
pushd packages_dispatcher
/usr/bin/xcodebuild clean build -configuration Release -scheme "packages_dispatcher" -derivedDataPath "$ABSOLUTE_BUILD_PATH" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH"
popd
## Build packages_builder
pushd packages_builder
/usr/bin/xcrun agvtool next-version -all
/usr/bin/xcodebuild clean build -configuration Release -scheme "packages_builder" -derivedDataPath "$ABSOLUTE_BUILD_PATH" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH"
pushd
## Build the plugins
pushd plugins/requirements
requirements_plugins_list=("CPU" "DiskSpace" "Files" "JavaScript" "OS" "RAM" "Script")
for requirement_plugin in "${requirements_plugins_list[@]}"
do
pushd $requirement_plugin
/usr/bin/xcodebuild clean build -configuration Release -scheme "$requirement_plugin" -derivedDataPath "$ABSOLUTE_BUILD_PATH/requirements" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH/requirements"
popd
done
popd
pushd plugins/locators
locators_plugins_list=("JavaScript" "Standard")
for locator_plugin in "${locators_plugins_list[@]}"
do
pushd $locator_plugin
/usr/bin/xcodebuild clean build -configuration Release -scheme "$locator_plugin" -derivedDataPath "$ABSOLUTE_BUILD_PATH/locators" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH/locators"
popd
done
popd
## Build the application
pushd app_packages
/usr/bin/xcrun agvtool next-version -all
/usr/bin/xcrun agvtool new-marketing-version $VERSION
/usr/bin/xcodebuild -project "app_packages.xcodeproj" clean build -configuration Release -scheme "app_packages" -derivedDataPath "$ABSOLUTE_BUILD_PATH" CONFIGURATION_BUILD_DIR="$ABSOLUTE_BUILD_PATH"
popd
## Create the distribution
pushd distribution
/usr/local/bin/packagesbuild --verbose --project Packages.pkgproj DISTRIBUTION_PRODUCT_VERSION="${VERSION}" COPYRIGHT_END_YEAR="${CURRENT_YEAR}"
popd
exit 0