HowToContributeCode - PerfectCarl/androidannotations GitHub Wiki

Contributing is not a crime

AndroidAnnotations greatly welcomes any contribution. Here is a small guide on how to contribute code, such as bug fixes, new features, javadoc or refactoring.

You should provide contributions by pushing changes on your fork of androidannotations, and letting us know by creating a pull request.

General Steps

  • Fork the repository (you must be signed in Github)
  • Create a local clone of your fork of AndroidAnnotations, create a branch based on the develop branch, commit some code on this branch, and push it on your own github repository.
  • Your branch names must start with the issue number. The branch name should not contain the developer name, it should only contain the id of the issue and a meaningful name. For instance: 123_fragment_support.
  • Do not include in your commit message anything related to automatic issue closing, such as Fixes issue 113. We'll do that when merging your pull request.
  • Create a pull request, choose the right branch that should be integrated back in AndroidAnnotations.

Checklist for contributed code

  • All files should have an Apache 2 License header. To do so, simply run this command in the AndroidAnnotations parent project: mvn license:format
  • Do not put any @author comment. Git keeps track of all your changes and @author does more harm then good.

Merging a pull request (Not up-to-date with move to Github)

Update the local develop branch

git checkout develop
git pull

If the branch is on a clone

Add a remote if not already done

git remote add xxxclone https://code.google.com/r/xxx-clone/

Fetch its latest changes

git fetch xxxclone

Merge the branch on your local develop

git merge xxxclone/xxxbranch

If the branch is on the main repository

Merge the branch on your local develop

git merge origin/xxxbranch

Check and push

Check and test the code changes, verify that AndroidAnnotations still builds :

mvn clean package

Check that the license headers are set :

mvn license:check

Deploy a new snapshot

mvn clean deploy

If anything went wrong, you can remove the merge commit :

git reset HEAD^1

Edit the merge message to add issue closing information (e.g. Fixes issue 113).

git commit --amend --allow-empty

Remove the remote branch

git push origin :xxxbranch