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 ease 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.
- In Eclipse use "File>New>Project" and then pick "CVS>Check Out Project From CVS"
- 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.
- 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
- Choose "Use an Existing" and pick which example project that you want to bring to your machine.
- 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.
- 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.
- Note you will have privileges only to read these files.
- 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.
- Create a project in Eclipse.
- Right (option) Click on the project and scroll down to "Team > Share Project"
- Choose CVS
- 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.
- 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>
- Note as an itp student you will have priveleges to read and write these files but so will the other students.
- Before you start coding, get the latest files by use the "Team> Update" menu.
- 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.
- 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/.
- You can make it a CVS repository with this simple command. "cvs -d /home/netid/CVS/myRepositoryName/ init"
- You will see that a folder called CVSROOT has been added to your folder
- Now follow the steps above but point to your folder instead of /home/dbo3/ThisClass_Students_CVS