Developer:Getting Started

From Jig

Jump to: navigation, search

Contents

Download Software and Utilities

Begin by downloading the following tools. You'll want these regardless of what platform you'll be using:

Java SDK
you'll want version 1.5 or higher (1.6 is better if it's available for your platform)
Eclipse
you'll want version 3.2 or higher. Once you install eclipse, you should start it up (any workspace location is ok the first time) and follow these steps:
  • Select the "Help-->Software Updates-->Find and Install" menu item.
  • Select "Search for new features to install"
  • Add the following features using the "new remote site" button. You'll need to look at the web pages listed below to find the appropriate address to enter into the eclipse dialog...
    • Mylar (note: Mylar has been renamed to Mylyn, and is now included as part of the standard Eclipse platform in version 3.3+)
    • Subclipse (note: If you get an error saying you need "buckminster" then you need to expand the tree and deselect the "optional" section when it asks you which components to install)
    • Eclipse-CheckStyle

Windows users will also need:

To join the Developer IRC Channel you will need an IRC Client. There are many free clients, here are just a few.

Create Public/Private Key pair

The basic process for this step is:

  1. Make a public/private DSA key
  2. Set up an authentication agent
  3. Test the key and agent to make sure they are working together
  4. Send me your public key so I can give you repository access

The exact process depends on what platform you're using:

Windows

Make a key
Follow the steps below to create your public/private key pair with puttygen
  1. Start up puttygen
    1. Select a DSA key that is at least 1024 bits long.
    2. Put your email address in the comment field.
    3. Pick a good password for your key; you'll be able to re-use it for a variety of purposes in the future.
    4. Save the public key in a file with your email address and the extension .pub
    5. Save the private key in a file with your email address and the extension .ppk
  2. Put your public and private keys somewhere where you won't lose it (like in My Documents/keys)
Set up authentication agent
You'll use the putty agent, and the process is simple
  1. Use windows explorer to associate .ppk files with putty agent (pagent.exe)
  2. Create a shortcut on your desktop to your private key
Test it
Now, its time to test it out. Double click the private key shortcut. You should be prompted to enter your password, and then you should see the pagent icon appear in the task bar. Now your key is stored in memory and you won't need to reenter your password.
Send it to me
If you've made it this far, you can move on by sending me (swallace@vancouver.wsu.edu) the public key so I can give you access to the repository. You'll be ready for the next step once I send you a message with a username for the server.

Make Sure It's Working

This step will give you some indication that everything's set up correctly on the server side to let you access the repositories. You can safely skip this step, but if you have problems later on, you should return to this procedure to pin point the problem.

  • Authenticate to your private key
  • ssh (on window use putty) to username@ai.vancouver.wsu.edu

You should be automatically logged in; there's nothing really for you to do here, so just log out.

  • If you are prompted for your password, your key is either not set up correctly on the server, you did not authenticate to your key correctly, or your ssh client is not using your private key.
  • If you are immediately disconnected, the server has blacklisted you. The server gives you only a few login attempts before banning you for life ;) You'll need to contact us to get off the blacklist.


Download the Code

  • Authenticate to your private key.
  • Start Eclipse and create an appropriate workspace. I use a folder called "game-engine/development" to store all my code.
  • Right click on the package explorer (left pane) and select "Import" from the context menu.
  • Find the "Checkout from SVN" import source (typically it's located in "Other" sources)
  • Select the "Create new repository location" option and enter svn+ssh://username@ai.vancouver.wsu.edu/home/svn-games/engine/development/ as the url. Be sure to replace username with the name I gave you in the last step.
  • When attempting the above step in Windows, if you get a popup error stating "Folder does not exist remotely" and/or Eclipse's console outputs an error stating "svn: Can't create tunnel: The system cannot find the file specified.", then do the following:
    • Download and install TortoiseSVN if you have not already done so.
    • Edit %USERPROFILE%/Application Data/Subversion/config:
      • Uncomment "[tunnels]" if commented out
      • Add the path to TortoisePlink.exe on a line below "[tunnels]". This will most likely be the following: ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe
  • At this point, you may be asked to authenticate to the server if your key agent isn't working well with eclipse, you won't be able to log in this way, so go back to step 1 above. After a few moments, you should see a list of folders that are available to be checked out. You'll want to begin by checking out these (you can select them all using the shift button):
    • jig-demos
    • jig-engine
    • jig-curriculum (if you're working on curriculum modules)
    • jig-tests
    • lib
  • Click "Finish"

After a few moments, you should see these folders (now projects) appear in the package explorer (left pane) of eclipse. Congratulations, you're almost ready to go.

Note The jig-curriculum and jig-tests projects have multiple source folders, and may not be configured correctly when they are initially imported. If you checked these projects out, continue reading below.

Setup Eclipse for the Project

Project settings information is typically not stored in svn, so eclipse will have to guess how the projects are configured initially. For the jig-curriculum and jig-tests project, eclipse will certainly guess wrong.

To set up these projects, you will need to configure the project build path. Under the 'Source' tab, remove the 'src' folder (it is not used in either project). Then add the correct source folders. For both projects, all top level folders which do not have the 'bin' substring are source folders. For example, in jig-tests, 'unittests' and 'benchmarks' are two such folders.

Once you've checked out the code from SVN, you're ready to begin the next step.

  • In Eclipse, select the menu item "Window-->Preferences" (or Eclipse-->Preferences on the Mac)
  • In the preferences dialog select the arrow next to Java in the navigator on the left.
    • Select the "Java-->Compiler" option. Make sure the compiler compliance setting is 5.0 or 6.0
    • Select the "Java-->Compiler-->Task Tags" option. Add the tag DESIGN with normal priority.
    • Select the "Java-->Installed JREs" option. Make sure that a JDK 1.5 or 1.6 JVM is selected, if not add one (if necessary) and select it now.

At this point there will likely be build errors to resolve. If there are build errors you'll know because the projects shown in the package explorer will have little red x boxes that indicate errors in the project compilation. Follow the steps below to resolve the build errors:

Verify Proper Build Path

  • Select the jig-engine project and right click. From the context menu, select properties.
  • Select the Java Build Path from the options on the left
  • Click on the Source tab.

There should be one source folder, the top level folder named jig-engine/src, make sure that is correct. You should do the same verification for the jig-demos project where the source folder should again be the top level jig-demos/src folder.

Add Jars to the Build Path

  • lwjgl related jars
    • Select the jig-engine project and right click. From the context menu, select properties.
    • Select the Java Build Path from the options on the left
    • Select Libraries from the pane on the right
    • Press the Add Jars button, and in the dialog that pops up navigate to lib-->lwjgl-->jar and select all the jar files displayed.
    • Click OK
    • Press the triangle to the left of each JAR you just added to expand the view.
    • Select Native Library Location and press the Edit button
    • Press the Workspace button and navigate to the workspace directory lib-->lwjgl-->native-->your os
    • Copy this path into each of the JAR's native library location fields
    • Click OK.
  • mp3-spi related jars
    • If you want support for mp3 audio files, do the following:
      • Select the jig-engine project and right click. From the context menu, select properties.
      • Select the Java Build Path from the options on the left
      • Select Libraries from the pane on the right
      • Press the Add Jars button, and in the dialog that pops up navigate to lib-->mp3-spi and select all the jar files displayed.
      • Click OK.
  • ogg-spi related jars
    • If you want support for ogg audio files, do the following:
      • Select the jig-engine project and right click. From the context menu, select properties.
      • Select the Java Build Path from the options on the left
      • Select Libraries from the pane on the right
      • Press the Add Jars button, and in the dialog that pops up navigate to lib-->ogg-spi and select all the jar files displayed.
      • Click OK.
  • junit related jars
      • Select the jig-tests project and right click. From the context menu, select properties
      • Select the Java Build Path from the options on the left
      • Select Libraries from the pane on the right
      • Press the Add Jars button, and in teh dialog that pops up navigate to lib-->junit and select the jar file displayed.
      • Click OK

Add Projects to the Build Path

  • Select the jig-demos project and right click. From the context menu, select properties.
  • Select Java Build Path from the options on the left
  • Select Projects from the pane on the right
  • Click the Add button, and select the jige project from the dialog
  • Click OK.

Repeat this process for the jig-tests and the jig-sandbox projects.

Setup the JIG Project Style Checker

  • Select the jige project and right click. From the context menu, select properties.
  • Select Checkstyle form the options on the left.
  • Click the Local Check Configurations from the pane on the right and press the New button.
  • Create the new style check configuration
    • Set the type to Project Relative Configuration
    • Set the name to JIG Project Baseline Code Style
    • Set the location to /jig-engine/jige-baseline-style.xml
    • Set the description to Baseline Code Style for the JIG Project
  • Click back to the Main tab on the right pane of the properties dialog
  • Select JIG Project Baseline Code Style (Local) from the drop down menu to activate the appropriate code style checker.
  • Press the OK button.

Follow the same procedure for each of the projects that has source code.

Joining the Developer's IRC Channel

When configuring a new IRC connection, you must first say how to connect to the server. This is a server address and port. Some clients ask on one line in the format 'servAddr::port.' Here are the server and port numbers to use.

  • IRC Server: irc.blackened.com
  • Port: 6667

You will also need to specify a unique nick. There are several thousand people on this server so just your first name might already be taken.

The channel we are using is #JIGProject. There is currently no password for the channel and you do not need voice to talk. To join a channel, enter the command '/join #JIGProject'

Beyond the Basics

Personal tools