I'm now managing a team at nVidia. These pages are old. To contact me, use david@coppit.org, since I check that account more often.

CSci 435/535: Software Engineering

Homework 3: Implementation Tools #1

Part 1 due Thursday, Jan 24th by 9am, Part 2 due Friday January 25 by 11am.

Summary

This is an introduction to Subversion and Eclipse. General instructions for accessing our repository are on the project webpage. You will need to consult the Subversion book on the exact syntax of the various svn commands.

Assignment

You must do the following steps by 9am Thursday.

In this step everyone will check out the "Homework 3" project from the repository.

  1. Start Eclipse, verify your version of Subclipse, and make sure that Subclipse is using the Java-only interface as described on the tools website.
  2. Visit the project webpage, and add the course Subversion repository as per the instructions.
  3. Open up the "Homework 3" subproject, and check it out as an Eclipse project.
  4. Switch to the Java perspective, and you should see the project. You may have to refresh the project to see the newly checked out files.
  5. Run the project as a Java application, using Run → Run As → Java Application. (Once you have done this once, selecting Run in the future will always use the Java application configuration.)

Between 9am and 10am on Thursday, I will make a change to the files so that the assignment will work right for the first person to do the remainder of the assignment.

You must do the following steps after 10am Thursday.

  1. In Eclipse, make a change to src/HelloWorld.java at the location marked "edit #1", as described in the comments.
  2. Next edit the file again in the location labeled "edit #2", in the manner described in the comments.
  3. Run the program to make sure it works correctly. Do not commit broken code.
  4. Try to commit your changes to the project by selecting by right-clicking the project and then selecting Team → Commit from the right-click menu. Enter a message saying what you changed for the commit comment. Notice how the bin directory is not versioned. We don't want to fill out our repository with .class files that can be regenerated.
  5. You should encounter a checkin conflict. (It will complain that your version is out of date.)
  6. Compare your version to the latest version in the repository. (Right click the file, then Compare With → Base Revision.)
  7. Update the project in order to merge the changes into your version. You may also notice that additional lines have been added by other students in the printSomeWords() method. But there are no conflicts there. (Do you know why?)
  8. Resolve the conflict by editing the file and forcing your change to override the other one. After you've resolved the conflict, run the program again to make sure it works.
  9. Next mark the file as resolved, and try to commit again. You may get unlucky, and someone else may have beaten you to the repository. If you get another conflict, resolve it in the same manner as before, and commit again.
  10. Your changes are now in the repository. Compare against the base revision againthere should be no source code differences.

Subversion Without Eclipse

In this section you will learn how to use subversion from the command line.

  1. Check out the code using
    svn checkout svn+ssh://<USERNAME>@<MACHINE>.cs.wm.edu/\
      home/f85/coppit/classes/csci435-spring2008/435root/Homework%203
    

    Note the backslash at the end of the line, to escape the newline that I used to break the long line in two. When you issue the command, remove the "\" at the end of the line and the whitespace at the start of the next line. Also note the "%20" in the URLthis is how a space is encoded.

  2. Look at a log of all the changes:
    cd Homework\ 3
    svn log
    

    Note that by default subversion uses a directory name that matches the one checked out from the repository. You can change this by providing a second argument to the svn checkout command. For example, to check out a "trunk" for a project:

    svn checkout svn+ssh://<USERNAME>@<MACHINE>.cs.wm.edu/\
      home/f85/coppit/classes/csci435-spring2008/435root/project/trunk project
    

    You could use this to check out "Homework 3" as "Homework3" so that you don't have to deal with the space in the directory name.

Ant

When you compiled the code in Eclipse, it used its built-in build manager. However, it's possible to build code using tools like "make" or "ant". (The former is typical for C/C++ code, and the latter is typical for Java code.) I've provided a build.xml file for you.

  1. Type ant to compile the source files.
  2. Run the program using ant run.
  3. Now run ant clean to clear the .class files out.
  4. Create a HelloWorld.jar file by running ant jar. This could be distributed to other people, and can be run with java -jar HelloWorld.jar.
  5. Re-compile the code, but save the output this time: ant run > $USER.ant_output. Email this file to coppit@cs.wm.edu to get credit for this part of the assignment.

Grading

75 points total

Back Back to the CSci 435/535 Homepage.

Last changed February 06 2008 12:00:56. David Coppit, coppit@cs.wm.edu

There have been 1323647 hits since Thu Jun 9 14:49:55 2005

Valid CSS!
Valid HTML 4.01!