-
Notifications
You must be signed in to change notification settings - Fork 9
/
createsrc.sh
84 lines (68 loc) · 2.27 KB
/
createsrc.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
#! /bin/sh
echo ""
echo "==========================================================================="
echo "Script that generates the structure needed to create the NetBee Source Pack"
echo "All the files will be placed in the "release\\sources" folder"
echo "The source pack will be created in "release\\nbsources.zip" "
echo ""
echo "Script launch order:"
echo " 1. createbin.sh"
echo " 2. createdoc.sh"
echo " 3. createdevpack.sh"
echo " 4. createsrc.sh"
echo "==========================================================================="
echo ""
echo ""
echo "=================================="
echo "Making a clean copy of the sources"
echo "=================================="
echo ""
rm -rfd release/sources
mkdir release/sources
echo ""
echo "================================"
echo "Copying source files and samples"
echo "================================"
echo ""
# Copy source files
cp -rf bin release/sources/.
cp -rf contrib release/sources/.
cp -rf samples release/sources/.
cp -rf src release/sources/.
cp -rf tools release/sources/.
cp -rf include release/sources/.
mkdir release/sources/lib
cp *.sh release/sources/.
cp license.txt release/sources/.
echo ""
echo "======================================================"
echo "Deleting files which are not required for a clean copy"
echo "======================================================"
echo ""
# Please note that this portion of code does not work on my CygWin, but works on BSD
cd ./release/sources
find . -name .svn | xargs rm -frd
find . -name *.bak | xargs rm -frd
find . -name "*.BAK" | xargs rm -frd
find . -name *.pdb | xargs rm -frd
find . -name *.ncb | xargs rm -frd
find . -name *.suo | xargs rm -frd
find . -name *.user | xargs rm -frd
find . -name *.cmake | xargs rm -frd
find . -name CMakeCache.txt | xargs rm -frd
find . -name ALL_BUILD.* | xargs rm -frd
find . -name ZERO_CHECK.* | xargs rm -frd
find . -name *.dir | xargs rm -frd
find . -name debug | xargs rm -frd
find . -name release | xargs rm -frd
find . -name CMakeFiles | xargs rm -frd
find src/. -name *.sln | xargs rm -frd
find samples/. -name *.sln | xargs rm -frd
find tools/. -name *.sln | xargs rm -frd
# Remove binaries from 'bin' folder
rm bin/*.dll
cd ../..
# Create a ZIP file for the Source pack
cd ./release/sources
zip -r ../nbsources.zip *
cd ../..