forked from jonreid/OCMockito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakeDistribution.sh
executable file
·49 lines (42 loc) · 1.27 KB
/
MakeDistribution.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
VERSION=4.0.1
DISTFILE=OCMockito-${VERSION}
DISTPATH=build/${DISTFILE}
PROJECTROOT=..
echo Preparing clean build
rm -rf build
mkdir build
echo Building OCMockito - Release
xcodebuild -configuration Release -target OCMockito
OUT=$?
if [ "${OUT}" -ne "0" ]; then
echo OCMockito release build failed
exit ${OUT}
fi
echo Building OCMockitoIOS - Release
source MakeIOSFramework.sh
OUT=$?
if [ "${OUT}" -ne "0" ]; then
echo OCMockitoIOS release build failed
exit ${OUT}
fi
echo Assembling Distribution
rm -rf "${DISTPATH}"
mkdir "${DISTPATH}"
cp -R "build/Release/OCMockito.framework" "${DISTPATH}"
cp -R "build/Release/OCMockitoIOS.framework" "${DISTPATH}"
cp "${PROJECTROOT}/README.md" "${DISTPATH}"
cp "${PROJECTROOT}/CHANGES.md" "${DISTPATH}"
cp "${PROJECTROOT}/LICENSE.txt" "${DISTPATH}"
cp -R "${PROJECTROOT}/Examples" "${DISTPATH}"
find "${DISTPATH}/Examples" -type d \( -name 'build' -or -name 'xcuserdata' -or -name '.svn' -or -name '.git' \) | while read DIR
do
rm -R "${DIR}";
done
find "${DISTPATH}/Examples" -type f \( -name '*.pbxuser' -or -name '*.perspectivev3' -or -name '*.mode1v3' -or -name '.DS_Store' -or -name '.gitignore' \) | while read FILE
do
rm "${FILE}";
done
pushd build
zip --recurse-paths --symlinks ${DISTFILE}.zip ${DISTFILE}
open .
popd