-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake_ev3lib.sh
More file actions
executable file
·95 lines (87 loc) · 3.2 KB
/
make_ev3lib.sh
File metadata and controls
executable file
·95 lines (87 loc) · 3.2 KB
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
#! /bin/bash
. copyapps.sh
echo
echo -------------------------------------------------------------------------------
echo Adding EV3 library and examples to SD card
echo -------------------------------------------------------------------------------
echo
currentDir=${PWD}
ev3LibDir=$currentDir"/ev3lib"
outputDir=$currentDir"/output"
doxygenOutput=$outputDir"/html"
dllName="MonoBrickFirmware.dll"
dllZipName=$outputDir/"MonoBrick.zip"
mdtoolExe="/Applications/Xamarin Studio.app/Contents/MacOS/mdtool"
solutionFile=$ev3LibDir"/MonoBrick.sln"
ev3Git=https://github.com/Larsjep/monoev3
branchName=$2
#-------------------------------------------
# If we using Linux change the path to mdtool
#-------------------------------------------
if [ ! -f "$mdtoolExe" ]; then
mdtoolExe="mdtool"
fi
#--------------------------------------------------------------
# Make sure that the input argument is either master or release
#--------------------------------------------------------------
if [ $branchName == "master" ];
then
echo "Building master"
else
if [ $branchName == "release" ];
then
echo "Building release"
else
echo "Input argument is invalid must be release or master"
exit 1
fi
fi
#-----------------------------------------------------
# Delte the output and fetch the MonoBrick EV3 library
#----------------------------------------------------
rm -fr $outputDir
cd $currentDir
echo "check dir"
if [ -d "$ev3LibDir" ]; then
cd $ev3LibDir
git pull
else
git clone $ev3Git $ev3LibDir
fi
#------------------------------------------------------------------------
#Make sure that repository is using the correct branch (master or release)
#-------------------------------------------------------------------------
cd $ev3LibDir
git checkout $branchName
#------------------------------------------------------------
# Create the output folder and generate doxygen documentation
#------------------------------------------------------------
mkdir $outputDir
mkdir $doxygenOutput
cd $ev3LibDir/Doxygen
sh createHTML.sh $outputDir
#-------------------------------------------------
# Update the nuget packages and build the solution
#-------------------------------------------------
cd $ev3LibDir
nuget restore $solutionFile
"$mdtoolExe" -v build "--configuration:Release" $solutionFile
#-------------------------------
# Copy the firmware DLL and mpack (Xamarin addin) to the output folder.
# Compress the DLL firmware file to a zip file
#---------------------------------------------
find . -name "$dllName" -type f -exec cp {} "$outputDir" \;
find . -name "*mpack" -type f -exec cp {} "$outputDir" \;
cd $outputDir
zip $dllZipName $dllName
mv *.mpack addin.mpack
#---------------------------------------------------------------------
# Create the StarupApp install package and copy it to the output folder
#----------------------------------------------------------------------
mv $ev3LibDir/InstallCreator/bin/Release/InstallCreator.exe $ev3LibDir/StartupApp/bin/Release/InstallCreator.exe
cd $ev3LibDir/StartupApp/bin/Release
sgen /a:MonoBrickFirmware.dll /t:MonoBrickFirmware.Settings.EV3FirmwareSettings /force
mono InstallCreator.exe
rm InstallCreator.exe
mkdir $outputDir/StartupApp
cp -r . $outputDir/StartupApp