Sending a pull request on GitHub

Now that you have mastered the Libgdx framework, a great opportunity to give back to the community has opened. Improving, adding, or fixing code are good challenges to test your knowledge. However, the Libgdx core team must approve your contributions first.

This process is performed through the official Libgdx GitHub repository.

Getting ready

Everything starts by clicking on the Fork button within the Libgdx forge while being logged in with your GitHub user account:

Getting ready

After that, import it into your Eclipse workspace through any of the offered methods according to the instructions provided in the Using source control on a Libgdx project with Git recipe of Chapter 1, Diving into Libgdx. You can get the repository URL from a box like this:

Getting ready

Then, open a ticket within the issue tracker of the GitHub repository, so the community can give their opinion about your potential contribution. If an agreement is reached about the need of accepting your request, move on to the real deal.

Note

Note that opening a ticket is a common practice in software development communities, but it is optional; you can take a shortcut and go directly to the next section.

How to do it…

Once you have the Libgdx project imported into Eclipse, you are ready to start tweaking the code. Before getting into any explanation, the next screenshot gives an overview of the whole process:

How to do it…

This is how we start:

  1. The first step is to add, modify, or remove code. Bear in mind that attaching new tests or modifying existing ones is a recommended practice to demonstrate the strength of your contribution.
  2. Whenever you feel happy with your work and all tests have passed, commit and push it to the master branch. However, there is a set of common sense practices that help with the creation and maintenance of pull requests within the community. The first thing is to add the ticket number of the issue to its title so that it becomes more visible and places the reader in context. Then, a little more information is required, which can be organized in multiple ways. A template might consist of the description, dependencies (optional), screenshots (optional), and the test process. In the end, the result should be something like this:
    How to do it…

    This structure will allow nonfamiliar developers to quickly understand the pull request and even test it.

    Moreover, you can directly close an open issue ticket by writing fixes #issuenumber within the description.

    Click on the Create pull request button when all the fields are properly filled up.

  3. Up until here, it was your effort. Now, someone from the Ligbdx core team will evaluate your request and give you some feedback. If it is not positive, just make the convenient modifications and try again. Do not get disappointed if it is not accepted at the first try; the advice, tips, or demands given will make you a better programmer.
  4. Finally, whenever your pull request is ready, the Libgdx team will merge it with the master branch.

There's more…

Libgdx is not the only project that you can lend a hand to. Ashley, Universal Tween Engine, Box2DLights, and others are auxiliary open source libraries that we have mentioned in this book, and they are willing to receive contributions.

See also

  • The Creating a new test for your fresh feature recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.187.233