Shell Script : To generate Qt DBus xml, Proxy and Adaptors.

#!/bin/sh
## Rahul's laziness is the reason for this automation!

# Prompt for a header...
echo "Please enter header name :"
read HEADERFILE
HEADERFILE=$HEADERFILE".h"
echo "Please enter a name for XML :"
read XMLFILE
XMLFILE=$XMLFILE".xml"
echo "Please enter a name for Adaptor & Proxy :"
read WRAPPERNAME

#Generate dbus xml and then Proxy & Adapter.
qdbuscpp2xml $HEADERFILE -o $XMLFILE
echo $XMLFILE" is generated at :: `pwd`"
qdbusxml2cpp -a $WRAPPERNAME"_adapter" $XMLFILE
echo $WRAPPERNAME"_adapter.cpp & .h is generated at :: `pwd`"
qdbusxml2cpp -p $WRAPPERNAME"_proxy" $XMLFILE
echo $WRAPPERNAME"_proxy.cpp & .h is generated at :: `pwd`"

#Copy/Move Proxy if needed to client application location.
echo "Do you want to move the proxy files to another location? [Press y/n]"
read CHOICE
if [ $CHOICE = "y" ]; then
 echo "Please enter the path"
 read TARGETPATH
 cp $WRAPPERNAME"_proxy"* $TARGETPATH
 echo "Done."

fi

No comments:

Post a Comment