Difference between revisions of "An exercise for new contributors"

From GCompris
Jump to: navigation, search
m (Optionally, publish your patch on GitHub)
(17 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
== Exercise ==
 
== Exercise ==
  
In order to help you practice in the GCompris framework, I propose you to make this little exercise.
+
In order to help you practice in the GCompris framework, we propose you to make this little exercise.
  
 
'''Mandatory:''' GCompris development is done on a '''GNU/Linux''' distribution of your choice.
 
'''Mandatory:''' GCompris development is done on a '''GNU/Linux''' distribution of your choice.
  
 
* Install GNU/Linux on your computer if you don't already have it.
 
* Install GNU/Linux on your computer if you don't already have it.
* Get the GCompris code from the Git version control system (or see bellow the GitHub option).
+
* Download and Install the latest stable version of [https://www.qt.io/download-open-source/#section-2 Qt] (version 5.9.3 recommended, 5.6 is the minimal one)
** git clone --depth=1 git://git.gnome.org/gcompris
+
* Install [https://cmake.org/download/ CMake] (version 3.5.1 recommended)
** cd gcompris
+
* Get the GCompris code from the Kde Git version control system (or see below the GitHub option).
 +
** git clone https://github.com/gcompris/GCompris-qt
 +
** cd GCompris-qt
 +
** git submodule init && git submodule update (to retrieve box2d)
 +
* Configure you Git username and email
 +
** git config --global user.email "your_email@example.com"
 +
** git config --global user.name "FirstName LastName"
 
* Create a branch for your development
 
* Create a branch for your development
 
** git checkout -b exercise
 
** git checkout -b exercise
* Compile GCompris.
+
* Start QtCreator and open the project file CMakeLists.txt at the root of the source code
** sh autogen.sh && make
+
* Compile and run it.
** Check that the python bindings have all they need to be compiled: '''Python plugin = yes''' at the end of the configure.
+
* Create a new activity using the supplied ''createit.sh'' script. For example, use your nick name as the activity name.
* Create a new Python activity using the supplied ''createit.sh'' script. For example, use you nick name as the activity name.
+
** cd src/activities
** cd src
+
** ./createit.sh 'my_new_activity'
** ./createit.sh exercise
+
* Update the copyrights of the different files with your name and email.
* Compile GCompris again.
+
* Compile GCompris again in Qt Creator, check you new activity is present
** make
+
* Modify the activity to display an image, a rectangle and a text.
* Run your activity with the ''runit.sh'' script (it is just the template for now).
+
* (Warning, if you add resources in you activity's resource directory you must run ''cmake'' again).
** ./runit.sh exercise-activity
+
** You can search for code examples in other activities and check the [http://doc.qt.io/qt-5/gettingstartedqml.html Qml getting started].
* Modify the activity to display an image, an ellipse, a rectangle, a line and a text.
 
** You can search for code examples in other activities and check the [http://live.gnome.org/GooCanvas goocanvas API].
 
 
* Add an event to a graphical object so that clicking on it does something visual.
 
* Add an event to a graphical object so that clicking on it does something visual.
* Test your activity by running ''runit.sh'' until you are happy with the result.
+
* Use git add and git commit to commit your changes locally.
* Use git to commit your changes locally.
+
** git add 'my new activity'
** git add exercise-activity
+
** git commit -m "commitMessage"
** git commit -a
 
* Use git to create the patch
 
** git format-patch master --stdout > exercise_activity.patch
 
** then email me the patch
 
  
=== Optionally, publish your patch on GitHub ===
+
=== Publish your patch on GitHub ===
  
 
* Create an account on [https://github.com github]
 
* Create an account on [https://github.com github]
* Fork [https://github.com/bdoin/GCompris GCompris]
+
* Fork [https://github.com/gcompris/GCompris-qt GCompris]
 
** Look at these [http://help.github.com/fork-a-repo/ instructions]
 
** Look at these [http://help.github.com/fork-a-repo/ instructions]
 
* Code your activity
 
* Code your activity
 
* Commit the code
 
* Commit the code
** git add exercise-activity
 
** git commit -a
 
 
* Push it
 
* Push it
 
** git push
 
** git push
 +
* Send a pull request on github or create a task in the "Need review" section at https://phabricator.kde.org/project/view/142/ with the description and link to your diff at https://phabricator.kde.org/differential/diff/create/
 +
 +
You can visit [http://gcompris.net/wiki/Qt_Quick_development_process Qt Quick development process] for more details.
 +
 +
[[Category:English]]

Revision as of 17:46, 21 December 2017

Exercise

In order to help you practice in the GCompris framework, we propose you to make this little exercise.

Mandatory: GCompris development is done on a GNU/Linux distribution of your choice.

  • Install GNU/Linux on your computer if you don't already have it.
  • Download and Install the latest stable version of Qt (version 5.9.3 recommended, 5.6 is the minimal one)
  • Install CMake (version 3.5.1 recommended)
  • Get the GCompris code from the Kde Git version control system (or see below the GitHub option).
  • Configure you Git username and email
    • git config --global user.email "your_email@example.com"
    • git config --global user.name "FirstName LastName"
  • Create a branch for your development
    • git checkout -b exercise
  • Start QtCreator and open the project file CMakeLists.txt at the root of the source code
  • Compile and run it.
  • Create a new activity using the supplied createit.sh script. For example, use your nick name as the activity name.
    • cd src/activities
    • ./createit.sh 'my_new_activity'
  • Update the copyrights of the different files with your name and email.
  • Compile GCompris again in Qt Creator, check you new activity is present
  • Modify the activity to display an image, a rectangle and a text.
  • (Warning, if you add resources in you activity's resource directory you must run cmake again).
  • Add an event to a graphical object so that clicking on it does something visual.
  • Use git add and git commit to commit your changes locally.
    • git add 'my new activity'
    • git commit -m "commitMessage"

Publish your patch on GitHub

You can visit Qt Quick development process for more details.