Skip to content

Adding new Extension

psineur edited this page Jun 6, 2011 · 18 revisions

Thank you for your interest for contributing to cocos2d-iphone-extensions.
Cocos2D Community will never forget you!
These guidelines will help you go down in history of cocos2d community! ;)

Requirements

  1. Your extension should be licensed under MIT License: http://www.opensource.org/licenses/mit-license.php
  2. Your extension should be compatible with latest stable cocos2d source: https://github.com/cocos2d/cocos2d-iphone
  3. Your extension should have examples, that shows all aspects of it and can be used as tests.
  4. Try to follow cocos2d develop guidelines - this will increase your karma ;)

Preparing your Pull Request

You don't need to know Git & use GitHub to add your extension to the cocos2d-iphone-extensions repo.
But this is the best approach how to collaborate with us.

  1. Switch to the latest 'bleeding edge' version of cocos2d-iphone-extensions:
    git clone git@github.com:cocos2d/cocos2d-iphone-extensions.git
    cd cocos2d-iphone-extensions
    git fetch origin
    git checkout -t origin/develop
    git submodule update --init
  1. Create new branch from latest develop state with good describing name. From now on we think that your extension is CCAndroidCollider... God knows what is this thing for in cocos2d...
   git checkout -b CCAndroidCollider
  1. Apply your changes with detailed commit messages and comments. Don't forget that "person who will maintain your code is a maniac serial killer that knows where you live".
  2. Push your branch to your fork of cocos2d-iphone-extensions. If you still don't have a fork of cocos2d-iphone-extensions - fork it: http://help.github.com/fork-a-repo/
  3. Send a pull request to develop branch: https://github.com/cocos2d/cocos2d-iphone-extensions/pull/new

Adding an Extension

  1. Copy all files needed for work of your extensions to the Extensions/CCAndroidCollider folder including source & resource files, that user of your extension will need to include in his project.
  2. Copy all tests files of your extension to Tests/CCAndroidColliderTest including source & resource files. Assign your test main layer like this:
   #import "ExtensionTest.h"
   SYNTHESIZE_EXTENSION_TEST(CCAndroidColliderTestLayer)
  1. Provide all necessary info about dependencies, system requirements, compatibility and issues in README file in Extensions/CCAndroidCollider folder.
  2. In cocos2d-extensions-ios.xcodeproj (and or cocos2d-extensions-mac.xcodeproj) drag n drop CCAndroidCollider to Extensions Group & CCAndroidColliderTest to Tests Groups. Uncheck 'copy files if needed' and any targets.
  3. Duplicate any test target, i.e. CCMenuAdvanced
  4. Delete Info copy.plist or (Info-Mac Copy.plist) and set Info.plist in your test target info to 'Tests/SharedResources/Info.plist' ('Tests/SharedResources/Info-Mac.plist' for Mac)
  5. Rename your target to CCAndroidColliderTest & set product name in it's Info to CCAndroidColliderTest
  6. Assing files in CCAndroidCollider & CCAndroidColliderTest Groups to CCAndroidColliderTest target.
  7. Make sure that everything builds ok and be happy.
Clone this wiki locally