[Qgis-developer] New Script for plugin generation in Mac Os X

Aju Ajusito namsfpfgo at gmail.com
Tue Jan 26 17:59:59 EST 2010


Hi, I have worked over a year to understand the QGIS development and now I
try to contribute.
The subject is:
If we want to create a plugin for QGIS with some folders inside for example
on FreeBSD is easy but in Mac Os X using Xcode is not same, because the
script for compile the plugin is not really good.
Let's see the old script:
------------------------------------------------------------------
mkdir -p "$DERIVED_FILES_DIR"

cd ../../src/plugins/$TARGET_PLUGINDIR

UIUI=`ls *.ui`

for u in $UIUI
do
    uh=`echo $u | sed 's,\.ui$,.h,'`
    # compare times because output files spec below doesn't seem to work
with wildcards
    if [ ! -f "$DERIVED_FILES_DIR/ui_$uh" ] || [ $u -nt
"$DERIVED_FILES_DIR/ui_$uh" ] ; then
        rm -f "$DERIVED_FILES_DIR/ui_$uh"
        echo "$QTUIC -o \"$DERIVED_FILES_DIR/ui_$uh\" $u"
        $QTUIC -o "$DERIVED_FILES_DIR/ui_$uh" $u
    fi
done

exit 0
------------------------------------------------------------------

and now take a look to my new script

------------------------------------------------------------------
mkdir -p "$DERIVED_FILES_DIR"

cd ../../src/plugins/$TARGET_PLUGINDIR

UIUI=`find . -type f -name "*.ui" | sed 's,.\/,,'`

for u in $UIUI
do
    uh=`echo $u | sed 's,[^:]*\/,,' | sed 's,\.ui$,.h,'`
    # compare times because output files spec below doesn't seem to work
with wildcards
    if [ ! -f "$DERIVED_FILES_DIR/ui_$uh" ] || [ $u -nt
"$DERIVED_FILES_DIR/ui_$uh" ] ; then
        rm -f "$DERIVED_FILES_DIR/ui_$uh"
        echo "$QTUIC -o \"$DERIVED_FILES_DIR/ui_$uh\" $u"
        $QTUIC -o "$DERIVED_FILES_DIR/ui_$uh" $u
    fi
done

exit 0
------------------------------------------------------------------
I decided to use the find function and not the ls.
what you think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100126/7f07c38c/attachment.html


More information about the Qgis-developer mailing list