Showing posts with label Subversion. Show all posts
Showing posts with label Subversion. Show all posts

Wednesday, October 9, 2013

Using GoogleCode repository with Eclipse

There are free code repositories such as GoogleCode for storing a project’s codebase. Github also has a free usage tier. The catch is that all hosted code must be open source. As such anything you store in the repository is public, and can be downloaded. You are, however, in control of who can check code in to the project.


In this tute, we are going to use GoogleCode with the Subclipse Subversion plugin for Eclipse.


Setting up a project at Google code


  • Go to Google Code https://code.google.com/
  • Click Create a new project
  • Enter all fields as required -
  • for version control system, enter Subversion
  • for source code licence - enter Apache Licence 2.0
  • Click Create Project
  • You will then be presented with your project’s home page.
  • Click on the source tab
  • There are two svn checkout commands:
    • The first one is the one you will use to check your projects in and out with - note that it includes a URI, and your username at the end of the command.
    • The second one may be used by anyone to check out your project
  • Bookmark this page.



Install the Subversion plugin into Eclipse


Next, install the Subclipse Subversion Eclipse plugin:
  • From the main menu > Help > Install new software > Add new
  • enter the following:
  • Click OK
  • Allow the list of available software to populate
  • Select/Accept/Download/Install the subclipse plugin
  • You will be asked to restart. Do so.


Connect existing Eclipse projects to your Google code repo


  • Create a new project or select an existing project (any type of project)
  • Right click the project > Team > Share





  • Select the Create a new repository location option > Next
  • Enter the URL component of the SVN check in command (from your Google code repo)





  • Click Next
  • Leave the next lot of options as default > Next





Click Finish






  • Enter your Google Code username and password:
    • username: your email addresspassword: your Google code generated password (return to your Google code project source page and click on the googlecode.com password link to generate a password.

  • Click OK





  • Click OK on the next screen.


Notice that your project now has an *asterisk on it’s name. This is to indicate that the current version of the project has not yet been checked in to the repo. There is also repo location information next to the project name.





Your project and Eclipse is now ready to use the repo (it is not checked in yet).


Commit the project to the repo

  • Right click the project >Team > Commit





  • Click Select All
  • You can enter a comment with the commit if you like.
  • Click OK
  • The local copy of the project is now committed to the repo.
  • Your project icon now looks like this:




  • Return to Google code and click Source > Browse
In the svn tree under directories, expand the trunk node.






You can click and view the java files in the src directory too!


Connect Eclipse to existing projects in the Google code repo

  • Find the project you wish to check out on Google Code and select browse > source (you can use my code repo to test on)
  • Copy the check out URL
  • In Eclipse, from the main menu select Import > Other > SVN > Checkout projects from SVN > Next
  • Select Create a new repository location > next
  • Copy in/enter the project’s check out url for example
  • https://my-diploma-workspace.googlecode.com/svn
  • > Next
  • The list should populate with all of the project folders available in the repository. Select the one/s you require and select Next > Next > Finish.



Here's a cat.