HcryptoJ Project using SVN

Back to workshop details

In this exercise we will work in groups on the HcryptoJ codebase. We will use the Sourceforge SVN repository.

Creating an Eclipse Project from SVN

 * In Eclipse, using the same workspace that you used yesterday, create a new project. However, this time we will create the project from the SVN repository. Eclipse, with the Subclipse plugin, is equipped to do this.
 * Select: New > Other > SVN > Checkout projects from SVN
 * Select: Create a new repository destination: https://hcryptoj.svn.sourceforge.net/svnroot/hcryptoj
 * Select: Repo > branches -> hfoss2010
 * Select: Check out as a project in the workspace, Name:  hcryptoj-workshop
 * Select: Next > Finish

This will create a folder in your workspace named: hcryptoj-workshop [repo/branches/hfoss2010]

Creating a Patch
Let's make a minor documentation edit to the HcryptoJ source code. For example, let's modify the README.txt file to correct the mistake that Norman discovered yesterday in the compile command. Let's replace the text following To Compile the Source: with the following: To compile all the files in ./src and store the classes in the ./classes, which must already exist, use the following command. This assumes that you are presently in this directory.

javac -d classes -classpath src src/hcrypto/cipher/*.java \ src/hcrypto/provider/*.java src/hcrypto/engines/*.java \ src/hcrypto/analyzer/*.java src/applications/*.java \ src/applications/cryptotoolj/*.java \ src/pluginanalyzers/*.java \ src/hcrypto/analyzer/*/*.java


 * In Eclipse, open a source file, make the edit, and save the change.
 * In Eclipse, right click on the README.txt file.
 * Select: Team > Create a patch ...
 * Select: Save in file system > Browse
 * Browse to your desktop or somewhere and use a name like inits-readmepatch.txt.
 * Select: Next > Finish
 * Confirm that the patch file was created.

Submitting the Patch to Sourceforge
You can submit the patch anonymously, but if you have a Sourceforge account, login to it.


 * Go to the HcryptoJ Sourceforge page: http://sourceforge.net/projects/hcryptoj/
 * Go to Develop > Tracker > Patches
 * Select: Add New and fill in the form fields Summary and Description.
 * Browse to your patch file and select it and fill in the Description.
 * Click on Add Artifact to submit you patch file.

Reviewing the Patch
Someone with commit privileges for this project would typically review the patch.


 * Download the patch from Sourceforge.
 * Select: Develop > Tracker > Patches
 * Select: the Change to README.txt patch.
 * Click on:  Attached File (1) and then the Download button.


 * Open the patch in Eclipse
 * Right click on the project and select: Team > Apply patch...
 * Use the Browse button to find the patch you downloaded and the Next
 * Next > Apply the patch to the selected file, folder, or project
 * Select: the README.txt file and then Next

At this point, the patch file will be loaded into Patch Contents. If a red bug flag appears on it, use Ignore leading path segments to try and remove it. Select:  Finish

At this point, the developer would review the patch, testing that it is correct:

Committing the Patch to the Code Base
Suppose now, the patch review has been successful. For this step, the developer would need commit privileges on the HcryptoJ code base.


 * Right click on the project and select: Team > Commit
 * 'Type in a brief descriptive commit comment''. This will be displayed in the repository.
 * Select (checkbox): the file(s) you want to commit.
 * Enter: Username and password
 * Finish

If the commit was successful, you will see something like the following report in the Eclipse console:

commit -m "Change to README.txt to correct an error in the 'How to compile' instructions." /prefix/workspace-hcrypto/hcryptoj51/README.txt Sending       /prefix/workspace-hcrypto/hcryptoj51/README.txt Transmitting file data ...   Committed revision 33.