-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmake_bin_release
executable file
·55 lines (42 loc) · 1.31 KB
/
make_bin_release
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
#!/bin/bash
# script to help with building a binary release package
#
# parameter 1 is the output directory
# parameter 2 is the version being released
function PrintUsage()
{
echo "example:";
echo " ./make_bin_release ~/sharppcap_releases 2.0.0";
}
if [ "$#" -ne 2 ]; then
PrintUsage
exit
fi
baseOutputDirectory=$1
releaseVersion=$2
binDirectory=${baseOutputDirectory}/bin
dirName=SharpPcap-${releaseVersion}
releaseDirectory=${binDirectory}/${dirName}
mkdir -p ${releaseDirectory}
debugDirectory=${releaseDirectory}/Debug
releaseDirectory=${releaseDirectory}/Release
mkdir ${debugDirectory}
mkdir ${releaseDirectory}
# remove any existing files
rm SharpPcap/bin/Debug/*
rm SharpPcap/bin/Release/*
rmdir SharpPcap/bin/Debug
rmdir SharpPcap/bin/Release
rmdir SharpPcap/bin
# build the code
mdtool build --buildfile:SharpPcap.sln --configuration:Debug
mdtool build --buildfile:SharpPcap.sln --configuration:Release
# copy the assembly files over
cp SharpPcap/bin/Debug/SharpPcap.dll ${debugDirectory}
cp SharpPcap/bin/Release/SharpPcap.dll ${releaseDirectory}
# copy the .config files over for Mono support
cp SharpPcap/SharpPcap.dll.config ${debugDirectory}
cp SharpPcap/SharpPcap.dll.config ${releaseDirectory}
# make a zip file of the binary files
cd ${binDirectory}
zip -r ${binDirectory}/${dirName}.bin.zip ${dirName}