= Getting Started with OpenSHA Development = [[PageOutline]][[BR]] == Changing your password == If you were given a temporary password, you should first change it [https://scec.usc.edu/password/change/ here] == Obtaining Source Code == Three options are available to obtain the OpenSHA source code: 1. ''`Browse Source`'' on this website. Once in the ''`trunk`'' folder, the current release code may be downloaded as a zip file (the link is at the bottom of the page). 2. Checkout the codebase directly from our Subversion (SVN) repository. We recommend using a newer version of the [http://subversion.apache.org/packages.html SVN client], even if your computer already has a client installed. Navigate to the directory you wish to download the project to, and run: {{{ svn checkout https://source.usc.edu/svn/opensha/trunk }}} If you are a developer and have a unique user/pass, run the following command, substituting ''`username`'' and ''`password`'' as appropriate: {{{ svn checkout --username username --password password https://source.usc.edu/svn/opensha/trunk }}} 3. Checkout the codebase from our Subversion (SVN) repository using Eclipse (see below). ---- == Obtaining Source Code via Eclipse == If you plan on working with OpenSHA, an alternative, and perhaps easier approach is to download the code from within Eclipse: === 1) Download Eclipse === The latest version of Eclipse can be obtained from [http://www.eclipse.org/downloads/ The Eclipse Website] The "Eclipse IDE for Java Developers" should be fine, however the Enterprise Edition (EE) will work as well.[[BR]][[BR]] === 2) Install the Subversion (SVN) Plug-in === The Eclipse SVN Plug in is called "Subclipse". Follow these installation instructions, or see their [https://github.com/subclipse/subclipse/wiki wiki] * In eclipse, select ''Help > Install New Software'' * Click the ''Add...'' button at the top right corner * Enter "Subclipse" in the ''Name'' field and this url in the Location field: `https://dl.bintray.com/subclipse/releases/subclipse/latest/` * Hit enter, then select at least "Core SVNKit Library", "Optional JNA Library", and "Subclipse". * Hit next and follow prompts to install the plugin, restart eclipse when prompted {{{#!comment To install in Eclipse, follow the tutorial here: [https://github.com/subclipse/subclipse/wiki Subclipse Installation] (be sure to use version 1.8, `https://dl.bintray.com/subclipse/releases/subclipse/latest/` as the update site when prompted)[[BR]][[BR]] }}} === 3) Add the OpenSHA Source Repository === Once Subclipse is properly installed, from within eclipse: * Select ''`Window > Open Perspective > Other`''. * Select ''`SVN Repository Exploring`'' and hit ''`OK`''. The ''`SVN Repository`'' tab should now be visible: * Click the ''`Add SVN Repository`'' button shown here... [[Image(svn_add_repo_button.png)]] * Enter `https://source.usc.edu/svn/opensha` as the ''`URL`'' and hit ''`Finish`''. * Enter your ''`username`'' and ''`password`'' if you have have them, otherwise leave the fields blank for anonymous read-only access.[[BR]][[BR]] === 4) Check out the OpenSHA Project === * Click the arrow to expand the repository tree. * Right click on ''`trunk`'' and select ''`Checkout...`'' [[Image(svn_checkout.png)]] * If you are happy with the default options (they are fine for most people), just click ''`Finish`''. * To specify where to put your "Working Copy" of the project, click ''`Next`'' instead. * Be patient, it may take a little while to check out the entire project the first time. * Once it is checked out, switch to the Java perspective ''`Window > Open Perspective > Java`'' (or ''`Other`'', then ''`Java`''). * More patience; it will probably take a little while to build the project as well (you should see ''`Building Workspace`'' in the lower right corner of the Eclipse window.[[BR]] ---- == Working with OpenSHA == The instructions above will enable any registered user to get a copy of the ''`trunk`'' or current codebase. Any new code by authorized developers, however, must be committed to the repository on a ''`branch`''. The details of merging and branching are outlined in [http://svnbook.red-bean.com/ The SVN Book] and we encourage everyone involved to keep it handy. Some very basic instructions and guidelines are provided below.[[BR]][[BR]] === Branching === OpenSHA development occurs on branches. To create a branch: * Switch to the ''`SVN Repository Exploring`'' perspective (see Step 3 above). * Right click on ''`trunk`'' and select ''`Branch/Tag...`'' [[Image(svn_branch.png)]] * In the window that follows, enter the following address in the ''`Copy to URL`'' field, replacing ''`username`'' and ''`branchname`'' as appropriate: {{{ https://source.usc.edu/svn/opensha/branches/username_branchname }}} * Click ''`Finish`'' (or ''`Next`'' for more advanced options). * Once the branch is created, expand the ''`branches`'' folder and check out ''`username_branchname`'' as a "Working Copy" using ''`Checkout...`'' (see Step 4 above).[[BR]][[BR]] === Merging === When new code is ready for inclusion in a release, project admins will assist with any required updates to a developers branched code and with merging it into the main line of the project. ---- == Other Eclipse Tasks == === Relocate Repository === If you had previously set up OpenSHA projects with our old server ''`intensity.usc.edu`'', you can 'relocate' the project rather than [#ObtainingSourceCodeviaEclipse adding] the new server ''`source.usc.edu`'' and checking out the project again: 1. Open any OpenSHA projects in the Eclipse ''Java perspective''. 2. Switch to the ''SVN Repository browsing perspective''. 3. Right click on ''`https://intensity.usc.edu/svn/opensha`''. 4. Select 'Relocate' and advance to the screen where you can set the ''New URL'' to: {{{ https://source.usc.edu/svn/opensha }}} [[BR]][[BR]][[BR]]