[gcompris/gcomprixogoo] Modified the createit script so that the xml template menu is created avoiding the need to run make.



commit 1e1c5007206d92c292ce8c352d28346e960ed452
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Thu Nov 11 09:00:22 2010 -0200

    Modified the createit script so that the xml template menu is created avoiding the need to run make.
    
    Now the user can just run creatit.sh then runit.sh

 src/createit.sh |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)
---
diff --git a/src/createit.sh b/src/createit.sh
index 4989f0b..43443ed 100755
--- a/src/createit.sh
+++ b/src/createit.sh
@@ -19,24 +19,31 @@ cp newactivity.svg $activitydir/$activity.svg
 cd $activitydir
 
 # Cleanup, remove generated files
-rm -f Makefile pythontemplate.pyc pythontemplate.xml \
+rm -f Makefile pythontemplate.pyc \
     Makefile Makefile.in python.svg
 
 mv $template.py $activity.py
-mv $template.xml.in $activity.xml.in
-
-sed -i s/$template/$activity/g init_path.sh Makefile.am \
-    $activity.xml.in $activity.py
+sed -i s/$template/$activity/g init_path.sh Makefile.am $activity.py
+sed -i s/python.svg/$activity.svg/ Makefile.am
 
-sed -i s/python.svg/$activity.svg/ $activity.xml.in Makefile.am
-
-sed -i "s:Bruno Coudoin:your name here:" $activity.xml.in
-sed -i "s:\\(<_title>.*</_title>\\):<_title>set a title for $activity</_title>:" $activity.xml.in
-sed -i "s:\\(<_description>.*</_description>\\):<_description>set a description for $activity</_description>:" $activity.xml.in
-sed -i "s:\\(<_prerequisite>.*</_prerequisite>\\):<_prerequisite>set a prerequisite for $activity</_prerequisite>:" $activity.xml.in
-sed -i "s:\\(<_goal>.*</_goal>\\):<_goal>set a goal for $activity</_goal>:" $activity.xml.in
-sed -i "s:\\(<_manual>.*</_manual>\\):<_manual>set a manual for $activity</_manual>:" $activity.xml.in
-sed -i "s:\\(<_credit>.*</_credit>\\):<_credit>set a credit for $activity</_credit>:" $activity.xml.in
+mv $template.xml.in $activity.xml.in
+mv $template.xml $activity.xml
+
+# Let's process also $activity.xml so that running 'make'
+# is not mandatory to run the activity.
+for menu in $activity.xml.in $activity.xml
+do
+  sed -i s/$template/$activity/g init_path.sh $menu
+  sed -i s/python.svg/$activity.svg/ $menu
+
+  sed -i "s:Bruno Coudoin:your name here:" $menu
+  sed -i "s:\\(<_title>.*</_title>\\):<_title>set a title for $activity</_title>:" $menu
+  sed -i "s:\\(<_description>.*</_description>\\):<_description>set a description for $activity</_description>:" $menu
+  sed -i "s:\\(<_prerequisite>.*</_prerequisite>\\):<_prerequisite>set a prerequisite for $activity</_prerequisite>:" $menu
+  sed -i "s:\\(<_goal>.*</_goal>\\):<_goal>set a goal for $activity</_goal>:" $menu
+  sed -i "s:\\(<_manual>.*</_manual>\\):<_manual>set a manual for $activity</_manual>:" $menu
+  sed -i "s:\\(<_credit>.*</_credit>\\):<_credit>set a credit for $activity</_credit>:" $menu
+done
 
 cd -
 
@@ -47,9 +54,9 @@ echo src/$activitydir/$activity.xml.in >> ../po/POTFILES.in
 echo src/$activitydir/$activity.py >> ../po/POTFILES.in
 
 echo "Now you can test your activity with:"
-echo "make && ./runit $activitydir"
+echo "./runit $activitydir"
 echo "To run it in a complete GCompris, run:"
-echo "sudo make install"
+echo "make && sudo make install"
 echo "gcompris --experimental"
 echo "(by default the activity is in the experimental section."
 echo " To change is, edit the file $activitydir/$activity.xml.in"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]