ryman | 91c1307 | 2004-12-08 19:18:10 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> |
| 5 | <meta name="GENERATOR" content="IBM Software Development Platform" /> |
| 6 | <link rel="stylesheet" href="http://www.eclipse.org/default_style.css" |
| 7 | type="text/css" /> |
| 8 | <title>WTP Development Practices</title> |
| 9 | <!-- David Williams, 10/25/04 (david_williams@us.ibm.com) --> |
| 10 | </head> |
| 11 | |
| 12 | <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" |
| 13 | vlink="#551a8b"> |
| 14 | |
| 15 | <table border="0" cellpadding="2" cellspacing="5" width="100%"> |
| 16 | |
| 17 | <tbody> |
| 18 | <tr> |
| 19 | |
| 20 | <td width="60%"> |
| 21 | <p align="LEFT"><FONT size="6"><B><FONT |
| 22 | face="Verdana, Arial, Helvetica, sans-serif">WTP Development |
| 23 | Practices</FONT></B></FONT><FONT size="1"><FONT |
| 24 | face="Arial, Helvetica, sans-serif"><FONT color="#8080ff"><br /> |
| 25 | WTP Development Practices</FONT></FONT></FONT></p> |
| 26 | </td> |
| 27 | |
| 28 | |
| 29 | <td></td> |
| 30 | |
| 31 | <td rowspan="2" width="19%"><img |
| 32 | src="http://www.eclipse.org/images/Idea.jpg" border="0" height="86" |
| 33 | width="120" alt="" /></td> |
| 34 | |
| 35 | </tr> |
| 36 | |
| 37 | |
| 38 | </tbody> |
| 39 | </table> |
| 40 | <p>This document is to describe some guidelines, procedures, and |
| 41 | "best practices" for doing WTP development. In some cases its |
| 42 | simply covers consistency/procedure issues, but also recommends best |
| 43 | practices to help community review and involvement. While all component |
| 44 | teams can have their own practices, if anyone has some good tips or |
| 45 | recommendations, please post to wtp-dev for discussion or suggest that |
| 46 | they be added here.</p> |
| 47 | <h2>Code into CVS</h2> |
| 48 | |
| 49 | <p>The component developers should provide the following information to |
| 50 | accompany code checked into CVS. Some of this information will become |
| 51 | part of the components 'development' directory in cvs, or on the |
| 52 | component's WTP website, and should be kept up to date as changes take |
| 53 | place and development progresses. (See <A |
| 54 | href="#webanddevelopmentresources" target="_self">Web and development |
| 55 | resources</A> for guidelines on what goes where).</p> |
| 56 | |
| 57 | <ul> |
| 58 | <li> |
| 59 | <p>A brief description of the component. This might be an initial |
| 60 | design document, if it exists, but the actual design document can come |
| 61 | later. This brief description should overview the function provided by |
| 62 | the component, but should also list at least a few API's, extension |
| 63 | points, or other "starting points" for anyone wanting to use |
| 64 | or extend the component. (See <A href="sse/PluginOverview.html">PluginOverview.html</A> |
| 65 | for example).</p> |
| 66 | </li> |
| 67 | |
| 68 | <li> |
| 69 | <p>A brief initial work plan: describing what development tasks are |
| 70 | expected for the next milestone or two (or simply in "future" |
| 71 | if not yet planned for a specific milestone). Specific bugs and feature |
| 72 | requests can be tracked with bugzilla, but this plan should be given as |
| 73 | a prose "overview" or highlights of work that is planned |
| 74 | towards refactoring or making the component "platform |
| 75 | quality". (See <A href="sse/SSEDevelopmentPlan.html">SSEDevelopmentPlan.html</A> |
| 76 | for example). In particular, if there are areas that can be explicity |
| 77 | tagged with "HELP WANTED", that would be good since can help |
| 78 | let potenital contributors know what areas</p> |
| 79 | </li> |
| 80 | |
| 81 | <li> |
| 82 | <p>Each plugin and build feature should contain a 'description' in the |
| 83 | plugin.xml (or feature.xml) file (there is a description tag for such |
| 84 | purpose).</p> |
| 85 | </li> |
| 86 | |
| 87 | <li> |
| 88 | <p>A plan for how the component will be documented: both the |
| 89 | "developers guide" type of information (see Platform Plugin |
| 90 | Developers Guide and JDT Plugin Developers Guide in the base Eclipse |
| 91 | for examples) and also the status and plan for design overviews and |
| 92 | "javadoc" type of information.</p> |
| 93 | </li> |
| 94 | |
| 95 | <li> |
| 96 | <p>All copyrights and appropriate license files should be correctly |
| 97 | provided.</p> |
| 98 | </li> |
| 99 | <LI><b>CVS Hygiene</b></LI> |
| 100 | <ul> |
| 101 | <li> |
| 102 | <p><B>Team Project Set.</B> Each component team should have a |
| 103 | "team project set" in their 'development' directory to make |
| 104 | it easy for others to check out what is needed for that particular |
| 105 | component.</p> |
| 106 | </li> |
| 107 | |
| 108 | <li> |
| 109 | <p><B>Source Folders</B> A minor consistency point: If there's only |
| 110 | one "source directory" it should be named 'src'. If there's |
| 111 | more than one, the additional ones should be named similar to |
| 112 | src-wizards, so its obvious both that's its source, and what its |
| 113 | conceptual division is. Multiple folders are not typically required, |
| 114 | but can be handy when one team has responsibility for one part, and |
| 115 | another team responsibility for another part of the plugin.</p> |
| 116 | </li> |
| 117 | |
| 118 | <LI> |
| 119 | <P><B>Compiled code jar.</B> Its recommended the jar for the plugin be |
| 120 | in the "root" of the plugin. Its also recommended a directory such as |
| 121 | "runtime" be reserved for those few cases where a pre-existing binary |
| 122 | jar is shipped with a plugin.</P> |
| 123 | </LI> |
| 124 | |
| 125 | <li> |
| 126 | <p><B>cvsignore</B> A .cvsignore file should be provided which has at |
| 127 | least 'bin' in it to prevent the check in of .class files -- please do |
| 128 | this before bin is committed to the repository (since you can not |
| 129 | ignore after its there). Typically, other "transient files" |
| 130 | (such as a non-custom build.xml, etc) are also added to this |
| 131 | .cvsignore file.</p> |
| 132 | </li> |
| 133 | |
| 134 | <li> |
| 135 | <p><B>Source Formatting</B> Source should be formatted according to |
| 136 | some stated standard (e.g. see /wtp-jst-home/development/format) and |
| 137 | appropriate Eclipse compiler options used (e.g. see |
| 138 | /wtp-jst-home/development/compilersettings) to produce "clean |
| 139 | code" (no unnecessary casts, no unused imports, etc.) Its also |
| 140 | recommended the source originally have 'sorted members'. The intent |
| 141 | here is to have clean, consistent code that makes it easier for others |
| 142 | to do diffs, compares, and supply patches.</p> |
| 143 | </li> |
| 144 | <LI> |
| 145 | <P><B>Obsolete directories in CVS. </B> If, due to renaming, |
| 146 | refactoring, or just spelling mistakes, a directory in CVS should |
| 147 | literally be deleted, to avoid a large of confusing directories, |
| 148 | please use following procedure. First, if it contains source, its |
| 149 | recommend to version that plugin's source, with a name such as |
| 150 | "obsolete<date>". Next delete the source, and leave in |
| 151 | its place a single file named "obsolete.txt" . If |
| 152 | appropriate, that file can contain information about why obsolete, |
| 153 | where the replacement is, etc. Lastly, someone will occasionally delete those directories from CVS (not |
| 154 | typically an desirable thing to do, since it is a source code control |
| 155 | system! Note: if some code or project simply become old or outdated, it is usually not appropriate to delete it since it might be required for simple historical reason. In these cases, its recommed to version the final version with some descriptive name like "outdated<date>" and leave a file in the directory called something like "outdated.txt" with some description of when and why, if there's a similar function offered elsewhere, etc. </P> |
| 156 | </LI> |
| 157 | </ul> |
| 158 | </ul> |
| 159 | <H3>Modified Code into CVS</H3> |
| 160 | <P>As features are added to bugzilla and fixes done and patches are |
| 161 | applied, enter the <B>CVS commit comment</B> as<BR> |
| 162 | <CODE>[BUGNO] Bugzilla abstract or explanation (eg: [6788] Fixed NPE on |
| 163 | open) </CODE><BR> |
| 164 | This will allow us to generate a "what is fixed " list |
| 165 | automatically with links to bugzilla with each build. For an example of |
| 166 | output in another project, see <BR> |
| 167 | <A |
| 168 | href="http://download.eclipse.org/tools/emf/scripts/news-release-notes.php?ver=2.1.0#I200411180800">http://download.eclipse.org/tools/emf/scripts/news-release-notes.php?ver=2.1.0#I200411180800</A><BR> |
| 169 | </P> |
| 170 | <H2>Plugin Design Conventions</H2> |
| 171 | <P><B>Avoid using the export="true" attribute on pre-req |
| 172 | (imported) plugins</B>. |
| 173 | </P> |
| 174 | <P>Its never appropriate to use it just so your upstream clients save |
| 175 | typing a line in their plugin.xml file. But, sometimes it is appropriate |
| 176 | to use it -- when the classes/interfaces in pre-req plugin really are |
| 177 | part of the pre-reqing plugins API. If it fits this later case, |
| 178 | that is it is part of the plugin's API, please document what part of the API requires it. For example: <BR> |
| 179 | <CODE> <!-- need to re-export org.eclipse.text since our API depends |
| 180 | on it, <BR> |
| 181 | such as IStructuredDocument extends IDocument <BR> |
| 182 | --> <BR> |
| 183 | <import plugin="org.eclipse.text" |
| 184 | export="true"/> </CODE><BR>The reason for this convention is that it forces upstream clients to stay better aware of exactly what they are pre-reqing instead of picking up some classes simply as a side effect of pre-reqing your plugin. </P> |
| 185 | <h2><A name="webanddevelopmentresources">Web and development resources</A></h2> |
| 186 | <P>By convention, a directory named 'development' should be used in the |
| 187 | component's CVS directory structure. This directory would be a peer with |
| 188 | 'features' and 'plugins'. These directories should hold things that may |
| 189 | be useful or relevant not only to the developers of the components, but |
| 190 | others interested in contributing (e.g. project team sets, Rose source |
| 191 | files of designs, etc). Things in these directories are not intended to |
| 192 | be in a build. If they are intended for an SDK build, they would be part |
| 193 | of the plugins directory structure.</P> |
| 194 | <P>[Note: there's some CVS work still needed to map the website to an |
| 195 | area in CVS, so the following paragraph will be expanded after that is |
| 196 | established]</P> |
| 197 | <P>For resources that are to be published or linked on the WTP web site, |
| 198 | there will be an area in CVS that parallels the website, so resources |
| 199 | that are placed there will be periodically copied to the whosoever for |
| 200 | proper serving.</P> |
| 201 | <H2>Streams and Builds</H2> |
| 202 | <H3>Code into a Build</H3> |
| 203 | <UL> |
| 204 | <LI>Code can go into a build before its part of a milestone plan, since |
| 205 | frequent builds are important to stay integrated.</LI> |
| 206 | <LI>The component team must be able to do a "local build" (to |
| 207 | work out major kinks in definitions and pre-reqs).</LI> |
| 208 | |
| 209 | <LI>In addition to the code itself being in a build, automated unit |
| 210 | tests should also be submitted for the build process.</LI> |
| 211 | </UL> |
| 212 | <H3>Nightly, Weekly, Milestone Builds</H3> |
| 213 | <BLOCKQUOTE> |
| 214 | <P>Nightly builds will be built from the head stream. Occasional compile |
| 215 | errors or unit tests failures would not be abnormal, but should be fixed |
| 216 | by the next nightly build.</P> |
| 217 | </BLOCKQUOTE> |
| 218 | <BLOCKQUOTE> |
| 219 | <P>Weekly integration builds will be built from developer tagged |
| 220 | versions. There should never be compile errors or unit tests failures in |
| 221 | an integration build, but if that happens then 1) immediate fixes are |
| 222 | required and 2) the offender must wear a red clown nose for the day :). |
| 223 | Integration builds are expected to be of sufficient quality they can be |
| 224 | used as the target in the development environment, though will have |
| 225 | received little or no testing.</P> |
| 226 | </BLOCKQUOTE> |
| 227 | <BLOCKQUOTE> |
| 228 | <P>Milestone builds are like weekly integration builds except they get |
| 229 | substantial testing. The expectation is that milestone builds be of |
| 230 | sufficient quality that they can be used to self host development.</P> |
| 231 | </BLOCKQUOTE> |
| 232 | <H3>Streams, Streams, and more Streams</H3> |
| 233 | <BLOCKQUOTE> |
| 234 | <P>Most development should take place in the HEAD stream. However, if a |
| 235 | component knows its making large breaking changes that would cause |
| 236 | clients a lot of churn (such as daily changes, to avoid breaking nightly |
| 237 | build), they can do the major changes in a temporary branch. The |
| 238 | component team should keep everyone informed that major development is |
| 239 | occurring in a branch, and naturally, well coordinate the merge back |
| 240 | into the HEAD stream. A good guideline is that development on a branch |
| 241 | should not occur for more than 3 weeks without being merged back into |
| 242 | HEAD.</P> |
| 243 | </BLOCKQUOTE> |
| 244 | <H2>Self Assessment</H2> |
| 245 | |
| 246 | <p>The following criteria can be useful to self-measure the success of a |
| 247 | milestone or release. Component leads should monitor their progress with |
| 248 | these expectations in mind.</p> |
| 249 | <ul> |
| 250 | <li>Made the date</li> |
| 251 | <li>Promised function complete</li> |
| 252 | <li>Unit tests and performance tests complete and running as |
| 253 | "passed"</li> |
| 254 | <li>Test plan with use cases</li> |
| 255 | <li>Function available one week before milestone for testing</li> |
| 256 | <li>Design and APIs reviewed and issues answered before milestone</li> |
| 257 | <li>Community-users buy-in and/or excitement</li> |
| 258 | <li>Included community contributed code.</li> |
| 259 | <li>All "priority 1" defects resolved and all "severity |
| 260 | 1" defects addressed.</li> |
| 261 | </ul> |
| 262 | </body> |
| 263 | </html> |