Code Share is a directory of open source code projects covering all aspects of the Force.com platform. You can browse and access the source code for these projects to learn more about the code, or create an account of your own on Code Share to collaborate with project owners and other members on existing projects. You can also create and register projects of your own. This article provides a brief introduction to getting started on Code Share.
Code Share is a directory of open source code projects. The idea is that you, and potentially others, work together on the source code for the project. As such, the source code is typically hosted in a way that permits team development - something like Google Code.
If you have a code sample instead of code - in other words you simply have some source that you'd like to share, then instead consider creating a Code Sample. See the Code Samples page to add and create code samples.
A code project typically has a number of elements:
The following sections look at each of these aspects in more detail.
The source code is really what your project is about. It's what will draw other developers to your project, and it's behind the bits that execute! All of the source code on Code Share is open source - in other words it's shared with everyone.
You should choose a structure for your source code that makes sense for your project. Typically this may follow the metadata structure that the Force.com IDE uses when it grabs the metadata from your Force.com environment.
Your source code typically has a license attached to it as well, which describe the terms under which it may be used. Many of the salesforce.com contributed projects, such as TwitterForce, Force.com for Facebook and Force.com for Google App Engine, use the New BSD License.
Code Share is all about collaborative code development, and as such you need to host your code in a way that lets multiple developers download, and potentially contribute, to your code. This is typically accomplished by using a code repository, such as Subversion. See Using Force.com with Subversion for Team Development for how teams can use Subversion.
Most of the code projects on Code Share use GitHub or Google Code as their host. This provides a nice web interface to your code source, as well as git/subversion support, as well as support for collaboration - especially on GitHub.
If your code is pure Force.com, consider making a one-click unmanaged package install version as well. Providing a quick route to installing your application or library is a sure way to get more folk excited about it and trying it out. See Packaging to learn more about this.
Code Share is a directory of projects, and once you have your source code hosted, and (optionally) an install package to hand, then you're ready to create add your Code Share project to the directory. The following steps walk you through the process of adding a project to Code Share.
Navigate to Code Share and login by using the login link:
One you're logged in, you'll notice that the "My Code Share" panel changes to expose the "Create a Project" link. Select this action.
You will now be asked for your project details.
The details you'll need to have at hand include:
Once your project is created, you'll be able to edit the description to add additional links - perhaps to documentation, or an article on the project and so on.
If you ever want to edit your project, perhaps to include additional links for to modify the description, then log in again and click on your name in the "My Code Share" panel.
Ideally you not only want developers and users to use your code, but you also want some to join your code project and contribute to its development. As such, here are some best practices that we recommend:
Code Share is a directory for open source code projects. Creating a project is a matter of logging in and creating a directory entry to describe and point to your hosted code.