This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate-mds.sh
executable file
·87 lines (66 loc) · 2.29 KB
/
generate-mds.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
#!/bin/bash
# written by Albert Gnandt (http://www.gnandt.com/)
# $Id: $
BEAGLE="opendicom-beagle"
LIB="opendicom-sharp"
GDK="opendicom-sharp-gdk"
UTILS="opendicom-utils"
NAVI="opendicom-navigator"
BEAGLE_HOME="/usr/lib/beagle"
MDP_TEMPLATE="opendicom.mdp.template"
MDS_TEMPLATE="opendicom.mds.template"
generate_mdp()
{
FILES=`find $1/src -name *.cs | \
sed 's#^'"$1"'/##' | \
awk '{ print "<File name=\"" $0 "\" subtype=\"Code\" buildaction=\"Compile\" />" }'`
# replace file list seperators
FILES=`echo $FILES | sed 's/ / /'`
REFS=""
for NAME in $3; do
if [ -e "$NAME/$NAME.mdp" ]; then
REF_TYPE="Project"
REF_TO="$NAME"
elif [ -e "$NAME" ]; then
REF_TYPE="Assembly"
REF_TO="$NAME"
else
REF_TYPE="Gac"
REF_TO=`gacutil -l $NAME | grep $NAME`
fi
REFS="$REFS <ProjectReference type=\"$REF_TYPE\" localcopy=\"True\" refto=\"$REF_TO\" />"
done
cat $MDP_TEMPLATE | \
sed 's/{{PROJECT}}/'"$1"'/g' | \
sed 's/{{TARGET}}/'"$2"'/g' | \
sed 's#{{FILES}}#'"$FILES"'#g' | \
sed 's#{{REFS}}#'"$REFS"'#g' > $1/$1.mdp
}
generate_mds()
{
STARTUP_ENTRY="$1"
DEBUG=""
RELEASE=""
STARTUP=""
ENTRIES=""
for PROJECT in $@; do
DEBUG="$DEBUG <Entry build=\"True\" name=\"$PROJECT\" configuration=\"Debug\" />"
RELEASE="$RELEASE <Entry build=\"True\" name=\"$PROJECT\" configuration=\"Release\" />"
STARTUP="$STARTUP <Execute type=\"None\" entry=\"$PROJECT\" />"
ENTRIES="$ENTRIES <Entry filename=\"./$PROJECT/$PROJECT.mdp\" />"
done
MDS_FILE=`echo $MDS_TEMPLATE | sed 's/\.template//'`
cat $MDS_TEMPLATE | \
sed 's#{{DEBUG}}#'"$DEBUG"'#g' | \
sed 's#{{RELEASE}}#'"$RELEASE"'#g' | \
sed 's/{{STARTUP_ENTRY}}/'"$STARTUP_ENTRY"'/g' | \
sed 's#{{STARTUP}}#'"$STARTUP"'#g' | \
sed 's#{{ENTRIES}}#'"$ENTRIES"'#g' > $MDS_FILE
}
generate_mdp $LIB Library
generate_mdp $GDK Library "gdk-sharp $LIB"
generate_mdp $UTILS Exe "$LIB"
generate_mdp $NAVI Exe "gtk-sharp glade-sharp $LIB $GDK"
generate_mdp $BEAGLE Exe "$BEAGLE_HOME/Util.dll $BEAGLE_HOME/Beagle.dll $BEAGLE_HOME/BeagleDaemonPlugins.dll $LIB"
generate_mds $LIB $GDK $UTILS $NAVI $BEAGLE
exit 0