The Path to Becoming an openPDC Developer
The easiest wasy to become a developer for the openPDC project is to start providing "patches of value". Anyone can upload code for us to review: upload patch
. If your patch is accepted (i.e., it is a useful new feature or bug fix) the code will be merged into the current code set - any added attributions and copyrights will remain. You can use other open-source code in your patches but it must be compatible with the TVA Open Source License
. Providing patches that add true value set you on the path to becoming a "trusted" developer on the openPDC project. Trusted developers have "check-out" rights to the source code and can directly upload changes to the current code set.
Looking forward to your patches!
All of the code used by the openPDC must be formatted using "Regions" snippet. If you expect to have your patch or code update included within the project it must follow this convention. All the snippets used by the project can be found in the Contributor Resources in the Snippets folder.
To install the snippets copy the *.snippet files to the file location that is defined for your code snippets. The file location can be found by selecting "Tools" > "Code Snippet Manager" from within Visual Studio then choosing Visual C# in the Language dropdown and selecting My Code Snippets. The folder is typically "...\My Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets".
Additionally all code must have a consistent header. We have developed a macro to include the standard code header that can be found in the Contributor Resources in the Macros folder. The following instructions will create this Visual Studio macro. Once defined you can insert the common header from within Visual Studio into any file by pressing "Ctrl+Alt+H". Installation steps follow:
First, install the project macro:
- Go to “Tools” / “Macros” / “Macros IDE”
- Right click “MyMacros” and select "Add" / “Add Module”
- Enter name “ProjectMacros”, then select the "Add" button
- Select all default code by pressing "Ctrl+A"
- Press the "delete" key to remove all existing code
- Paste in code from the "ProjectMacros.vb" found in this folder
- Right click “References” in the Project Explorer and select “Add Reference”
- Select “System.DirectoryServices.dll”
- Select the "Add" button, then select the "OK" button
- Select “File” / “Save MyMacros”
- Close “Macros IDE”
Second, assign a shortcut key to the macro:
- Go to “View” / “Toolbars” / “Customize...”
- Click “Keyboard...” button in the bottom left corner
- Type “MyMacros” into “Show commands containing:” text box
- Select “Macros.MyMacros.ProjectMacros.InsertHeader”
- Select “Text Editor” from the “Use new shortcut in:” list
- Click in the “Press shortcut keys:” text box
- Press the “Ctrl”, “Alt” and “H” key (text box should say Ctrl+Alt+H)
- Click the “Assign” button, then click “OK”
- Click the “Close” button on the “Customize” window
- Open a C# code window, click anywhere in the file
- Press Ctrl+Alt+H, header will be inserted at top of document
Note all steps are executed from within Visual Studio. These instructions have only been tested with Visual Studio 2008.
If you have been granted developer access, please adhere to the following rules:
- Do not check in code that will not build.
- All code should be formatted using the "Regions" snippet.
- All public and/or protected members should have a fully populated XML comment.
- All check-in's must have a comment - please make it relevant.
- Check-in comment should have a project prefix. For example, prefix check-in descriptions for the Synchrophasor project with "Synchrophasor: ".
- Do not leave debug code in the system unless it is properly regioned (#if DEBUG).
- Do not check-out all files in a solution and/or project.
- Keep total number of files checked-out to the absolute minimum needed.
- If possible, keep files checked-out within the same solution.
- Don't keep files checked-out for an excessive period of time. Shelve changes before you go on vacation or change projects and uncheck "Preserve pending changes locally".
- Do not check-in unfinished work - shelve the changes instead remembering to uncheck "Preserve pending changes locally".
- If multiple developers will be working on a large portion of code that will need to be checked-out for a long time, please contact the coordinators to create a branch for the project.
- Please contact one of the project coordinators before adding a new project to any of the solutions so they will have an idea of what's being added and why.
- Without prior coordination large contributions should be posted as a "patch" so it can be properly reviewed.
Note that some of the rules could be enforced by TFS but the codeplex TFS is a shared system, so for now we are simply using the honor system.