|Home||Lawrence's Labyrinth||Deconstructing B/X D&D||Adventure Generator!||B/X D&D Character Generator||Other||Contact|
First, we open the “SVN Repository Exploring” Perspective.
Select Window→Open Perspective→Other.
Highlight “SVN Repository Exploring” and press OK.
The screen will change to something like this:
Now we need to add the RustyBox subversion repository to the list of repositories we can check out projects from.
Right-click on the white area under the “SVN Repositories” tab, and select New→Repository Location.
Enter the URL of the repository in the field.
After a bit of grinding, the repository will appear. Unroll it with the little arrow icon.
You'll see a list of projects in the repository.
“SimpleIO” is a cheesy little IO library that lets us embed running code into the chapters of this book, as we write it. It also trivializes reading keyboard input for you, so we can concentrate on writing game stuff instead of silly IO stuff.
“trunk” is the most recent working copy of the code. It may contain things that are in-progress and/or buggy.
You'll see other projects corresponding to various chapters of the “Let's Build an RPG!” book.
Highlight the one that you want to check out, then right-click and select Checkout.
Make sure you check out the SimpleIO project before you check out anything else. The per-chapter projects depend on it for writing to the screen and getting input from the keyboard. If you check out something else first, Eclipse will think that there is an error, but the error will go away once you have SimpleIO in your workspace.
If you are just coming here from Chapter 2, then you need to first check out “SimpleIO”, then “002 - Getting Started”.
You only need to check out a particular project once. Once it is in your workspace, it remains linked to the SVN copy (unless you explicitly disconnect it), and to get updated code out of the repository later, all you have to do is “update your working copy” (more on that below).
Take the default values and click Finish.
There will be some grinding as the project is downloaded.
Once the project is downloaded, we need to switch back to the Java perspective. This is done by using the buttons in the upper-right corner of the screen. You may have to grab the left edge of the tab and enlarge it to see everything, depending on what version of eclipse you are using.
Once you have enlarged it, click on “Java” to switch back to the Java perspective. You can switch back to the SVN Repository Exploring Perspective at any time by clicking on its button here.
And now you will see that the project has been checked out into your workspace. Have fun with it!
If you try some things and end up breaking the code, you can revert it back to what is in the repository.
To do this, first highlight the project. Then right-click and select Team→Revert.
If you are following “trunk”, or bugs are fixed in some of the chapter branches, you can update your copy of the code.
To do this, first Revert, as above, to make sure there are no conflicts if you changed some things. (You can skip this step if you haven't changed any of the code in the project that you are updating.)
Then, from the Team menu as before, select Update to Head.
The per-chapter projects won't get updated much, unless we find silly bugs in them later. But trunk and SimpleIO will continue to evolve as work on the book continues, so it is worth making sure that they are up to date each time you sit down for a coding session!
If you want to make significant, permanent modifications to your copy of a project, you should disconnect it from the subversion repository and rename it.
To do this, first select Disconnect from the Team menu.
When prompted, tell it to “also delete SVN meta information from the file system.” Then press Yes.
Once it has finished disconnecting, highlight the project. Then right click on the project and select Refactor→Rename.
Enter the name for your forked project and press OK.
Once you have done this, you can re-checkout the original code from the repository as described previously. However, you will not be able to update your forked copy of the project if changes/fixes are made to the original project in the repository. You will have to patch in the changes by hand, if needed.