Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 97619 invoked from network); 17 Feb 2009 21:18:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Feb 2009 21:18:24 -0000 Received: (qmail 17963 invoked by uid 500); 17 Feb 2009 21:18:24 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 17934 invoked by uid 500); 17 Feb 2009 21:18:24 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 17925 invoked by uid 99); 17 Feb 2009 21:18:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2009 13:18:24 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO aurora.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2009 21:18:17 +0000 Received: from aurora.apache.org (localhost [127.0.0.1]) by aurora.apache.org (8.13.8+Sun/8.13.8) with ESMTP id n1HLHsia014538 for ; Tue, 17 Feb 2009 21:17:56 GMT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: core-commits@hadoop.apache.org Date: Tue, 17 Feb 2009 21:17:54 -0000 Message-ID: <20090217211754.14422.86258@aurora.apache.org> Subject: [Hadoop Wiki] Update of "ZooKeeper/HowToContribute" by PatrickHunt X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification. The following page has been changed by PatrickHunt: http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute ------------------------------------------------------------------------------ {{{ svn checkout http://svn.apache.org/repos/asf/hadoop/zookeeper/trunk/ zookeeper-trunk + }}} + + You may also want to develop against a specific release. To do so, visit [http://svn.apache.org/repos/asf/hadoop/zookeeper/tags/] and find the release that you are interested in developing against. To checkout this release, run: + + {{{ + svn checkout http://svn.apache.org/repos/asf/hadoop/zookeeper/tags/release-X.Y.Z/ zookeeper-X.Y.Z }}} If you prefer to use Eclipse for development, there are instructions for setting up SVN access from within Eclipse at [:ZooKeeper/EclipseEnvironment: EclipseEnvironment]. @@ -35, +41 @@ * Place your class in the {{{src/java/test}}} tree. * {{{ClientTest.java}}} is an example of a client-server test. * You can run all the unit test with the command {{{ant test}}}, or you can run a specific unit test with the command {{{ant -Dtestcase= test}}} (for example {{{ant -Dtestcase=ClientTest test}}}) + + ==== Understanding Ant ==== + + ZooKeeper is built by Ant, a Java building tool. This section will eventually describe how Ant is used within ZooKeeper. To start, simply read a good Ant tutorial. The following is a good tutorial, though keep in mind that ZooKeeper isn't structured according to the ways outlined in the tutorial. Use the tutorial to get a basic understand of Ant but not to understand how Ant is used for Hadoop: + + * Good Ant tutorial: http://i-proving.ca/space/Technologies/Ant+Tutorial === Generating a patch === @@ -98, +110 @@ * try to adhere to the coding style of files you edit; * comment code whose function or rationale is not obvious; * update documentation (e.g., ''package.html'' files, this wiki, etc.) + * name the patch file after the JIRA -- ZOOKEEPER-.patch If you need to rename files in your patch: 1. Write a shell script that uses 'svn mv' to rename the original files. @@ -106, +119 @@ 1. Submit both the shell script and the patch file. This way other developers can preview your change by running the script and then applying the patch. + ==== Testing your patch ==== + + Before submitting your patch, you are encouraged to run the same tools that the automated Hudson system will run on your patch. This enables you to fix problems with your patch before you submit it. The {{{test}}} Ant target will run your patch through the same checks that Hudson currently does. + + To use this target, you must run it from a clean workspace (ie {{{svn stat}}} shows no modifications or additions). From your clean workspace, run: + + {{{ + ant test + }}} + + At the end, you should get a message on your console that indicates success. + + Some things to note: + * you may need to explicitly set ANT_HOME. Running {{{ant -diagnostics}}} will tell you the default value on your system. + * you may need to explicitly set JAVA_HOME. + ==== Applying a patch ==== To apply a patch either you generated or found from JIRA, you can issue {{{ - patch -p0 < cool_patch.patch + patch -p0 < ZOOKEEPER-.patch }}} if you just want to check whether the patch applies you can run patch with --dry-run option {{{ - patch -p0 --dry-run < cool_patch.patch + patch -p0 --dry-run < ZOOKEEPER-.patch }}} If you are an Eclipse user, you can apply a patch by : 1. Right click project name in Package Explorer , 2. Team -> Apply Patch