Utilities such as CVS, SVN and GIT are important and necessary tools when you work in a large software projects with multiple programmers. These utilities facilitate collaboration and version control. However, these are not desirable features in a system used to manage project submission in a course like ours, since, for example, we do not want students to collaborate on their programming assignments. Thus, we will not be using CVS or SVN or GIT for project submission this semester.
Instead, we will practice using CVS just for Project 0. Each section of the course will participate in a collaborative effort to write a story. This is the familiar "story game" in which each person adds one or two sentences to a story --- except we will do this in Java.
ln -s /afs/umbc.edu/users/c/h/chang/pub/cs341/userid ~/cs341projwhere userid should be replaced by your username. This assumes you do not already have a file or directory named cs341proj.
cvs -d /afs/umbc.edu/users/c/h/chang/pub/cs341proj0/sec1 checkout -d myproj0 . cvs -d /afs/umbc.edu/users/c/h/chang/pub/cs341proj0/sec2 checkout -d myproj0 . cvs -d /afs/umbc.edu/users/c/h/chang/pub/cs341proj0/sec3 checkout -d myproj0 . cvs -d /afs/umbc.edu/users/c/h/chang/pub/cs341proj0/sec4 checkout -d myproj0 .Note that the period '.' at the end is necessary. This copies the files in the CVS repository to a directory named myproj0 in your home directory.
cd myproj0 ant ant runThe Java program should print out the beginning of the story plus any lines that other students in your section added.
The stories for the sections begins with:
Section 1: It was a dark a stormy night. The ninja approached his target carefully.
Section 2: They say that everything must start somewhere. That is, unless you have a time machine, then it gets all wibbly wobbly.
Section 3: Long long time ago, in a galaxy far far away, a dragon woke from a long slumber. SOMEONE took the saying "Don't poke the bear" too literally and did not understand that it refers to more than just bears.
Section 4: Once upon a time in a farwawy castle lived a robot. The robot had a special task --- if only he could remember what that task was.
cd src/story ls
You should see files named Story0.java, Story1.java, Story2.java ... Each file, of course, contains the code for the corresponding Java class. Each StoryXX class prints out one or two sentences of the story in its printStoryLine() method. The Story(i+1) class literally extends the Storyi class. The previous lines of the story are printed by invoking:
super.printStoryLine() ;
Add another sentence to the story by creating a new StoryXX class that extends the last StoryXX class. You will also need to modify the main program in Recount.java to make it invoke printStoryLine() in your StoryXX class (and not the previous one).
cd ../.. ant ant run
cvs add src/story/StoryXX.java cvs commit -m "Submitted by John Doe."Of course, replace the XX in StoryXX.java with the real name of the file you added and "John Doe" with your own name.
cvs update cvs update(Yes, do it twice, the first time CVS will complain that your StoryXX.java file disappeared.)
cd ~/myproj0 cvs add src/story/StoryXX.java cvs commit -m "Submitted by John Doe."Remember to use the new file name for StoryXX.java.
cd ~/myproj0 cp -r build.xml src ~/cs341proj/proj0/
cd ~/cs341proj/proj0 ant ant run
ant clean
cd ~/myproj0 cvs update ant ant run