-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_plugin.sh
executable file
·94 lines (81 loc) · 2.05 KB
/
prepare_plugin.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
88
89
90
91
92
93
94
#!/bin/bash
SVN="svn"
M4="m4"
convert_plugin() {
TARGETPATH=$1
PLUGINNAME=$2
PLUGINID=$3
PLUGINTYPE=$4
if [ -d $TARGETPATH/src ]; then
for file in $TARGETPATH/src/*.cpp; do
filename=$(basename $file)
$SVN mv $file $TARGETPATH/$filename
done
$SVN rm $TARGETPATH/src
fi
if [ -d $TARGETPATH/inc ]; then
for file in $TARGETPATH/inc/*.h; do
filename=$(basename $file)
$SVN mv $file $TARGETPATH/$filename
done
$SVN rm $TARGETPATH/inc
fi
TEMPLATEPATH=./TemplatePlugin
FILES="AUTHORS autogen.sh configure.ac COPYING INSTALL Makefile.am missing NEWS README ltmain.sh ChangeLog"
M4FILES="Makefile.am configure.ac"
for file in $FILES; do
if [ ! -f $TARGETPATH/$file ]; then
$SVN cp $TEMPLATEPATH/$file $TARGETPATH/.
fi
done
for file in $M4FILES; do
$M4 -DPLUGINNAME=$PLUGINNAME \
-DPLUGINID=$PLUGINID \
-DPLUGINSOURCES="$PLUGINSOURCES" \
-DPLUGINTYPE=$PLUGINTYPE \
$TEMPLATEPATH/$file > $TARGETPATH/$file
done
pushd $TARGETPATH
$SVN rm *.cbp
$SVN rm *.dsp
$SVN rm *.vcproj
$SVN rm *.depend
$SVN rm *.layout
popd
}
commit() {
pushd $pluginPath
svn commit -m 'Plugin $pluginName usando autotools. sin compilar.'
popd
}
updateM4() {
TARGETPATH=$1
PLUGINNAME=$2
PLUGINID=$3
PLUGINTYPE=$4
M4FILES="Makefile.am"
TEMPLATEPATH=./TemplatePlugin
pushd $TARGETPATH
PLUGINSOURCES=$(echo *.cpp)
popd
for file in $M4FILES; do
$M4 -DPLUGINNAME=$PLUGINNAME \
-DPLUGINID=$PLUGINID \
-DPLUGINSOURCES="$PLUGINSOURCES" \
-DPLUGINTYPE=$PLUGINTYPE \
$TEMPLATEPATH/$file > $TARGETPATH/$file
done
}
TYPESPATHS="MasterEffects Resources IODevices PreEffects Effects PostEffects"
for pluginTypePath in $TYPESPATHS; do
PLUGINS=$pluginTypePath/*
pluginType=$(echo $pluginTypePath | tr '[:upper:]' '[:lower:]')
for pluginPath in $PLUGINS; do
pluginName=$(basename $pluginPath)
pluginId=$(echo $pluginName | tr '[:upper:]' '[:lower:]')
echo Processing: $pluginId
updateM4 $pluginPath $pluginName $pluginId $pluginType
#commit($pluginPath)
#convert_plugin $pluginPath $pluginName $pluginId $pluginType
done
done