CVS
Search:
ClassWork / CVS

Sharing Code with CVS

  • Code repositories on a server are really useful. For a beginner, you can download example code perfectly set up into an Eclipse project. As you write your own code, it is nice to have a backup or a central location even just to share with yourself (ex home and work or 10 kiosks). It makes class go more smoothly if we can can see and run each others code from one place. Beyond class the potential of leveraging the many eyeballs of the open source movement who now may be able to see and suggest changes in your code is a the ultimate incentive.
  • Of course Eclipse has many built in capabilities to each the sharing of your projects with code repositories. Two famous protocols for these repositories are "CVS" and the newer "SVN or Subversion." Eclipse comes ready to connect to "CVS" and itp.nyu.edu server is ready to accomodate "CVS." You can use SVN with a plugin which has great appeal because code.google.com used that on their repositories.

Make a New Project Starting with Examples CVS Repository

You can get the examples for this class from a CVS repository.

  1. In Eclipse use "File>New>Project" and then pick "CVS>Check Out Project From CVS"
  2. If your Eclipse has not already connnected to this repository (the examples_CVS does not show up in the list) then you have to choose "Create a New Repository Location." Note this does not make a new repository on the server, it just lets your Eclipse know about an existing one. If it is in the list, pick the existing "examples" and skip the next step.
  3. If this is the first time, fill in itp.nyu.edu for host, /home/dbo3/CVS/examples for repository path, your id and password and change connection type to extssh
  4. Choose "Use an Existing" and pick which example project that you want to bring to your machine.
  5. You can probably hit "Finish" now. If you keep pressing "Next" you will have opportunities to call the project something else or put it in a special place on your machine.
  6. After the project has been built on your machine, check in the build path that the example was not depending on external libraries. Also, especially in the case of mobile examples, make sure you have the required plugins installed.
  7. Note you will have priveleges only to read these files.
  8. If you want to get the freshest examples use the "Team> Update" menu.

Putting Your Work In the Student Repository

You can use another repository that I have set up for sharing your work with me and and with other students.

  1. Create a project in Eclipse.
  2. Right (option) Click on the project and scroll down to "Team > Share Project"
  3. Choose CVS
  4. Look for a repository called "students" and pick it if your can. If your Eclipse has not already connnected to this repository (the students does not show up in the list) then you have to choose "Create a New Repository Location." Note this does not make a new repository on the server, it just lets your Eclipse know about an existing one.
  5. Fill in <b>itp.nyu.edu</b> for host, <b>/home/dbo3/CVS/students</b> for repository path, your <b>id and password</b> and change connection type to <b>extssh</b>
  6. Note as an itp student you will have priveleges to read and write these files but so will the other students.
  7. Before you start coding, get the latest files by use the "Team> Update" menu.
  8. After you finish working use the "Team> Commit" menu to put your changes back on the server.

Creating your own CVS Repository

You can create a repository that is totally under your control and in your own server space.

  1. Create a folder on stage to hold your CVS stuff, maybe above your public_html folder so it is not accessable, let's say /home/netid/CVS/myRepositoryName/.
  2. You can make it a CVS repository with this simple command. "cvs -d /home/netid/CVS/myRepositoryName/ init"
  3. You will see that a folder called CVSROOT has been added to your folder
  4. Now follow the steps above but point to your folder instead of /home/dbo3/ThisClass_Students_CVS
Search
  Page last modified on February 03, 2009, at 04:22 PM