Skip to content

Eclipse and PyDev setup

andresriancho edited this page Mar 21, 2013 · 1 revision

Introduction

This guide will help you setup your Eclipse environment to develop new features for the w3af framework. The guide is focused on Ubuntu 12.04 LTS but it should work on any operating system with minor modifications.

Install Eclipse and plugins

Run the following command to install Eclipse in your system: apt-get install eclipse

Then, run eclipse by clicking on the Eclipse icon in your application menu. Follow these steps to get the recommended plugins installed:

  • In the main menu click on "Help > Install New Software..."
  • In the "Work with" entry type "PyDev" and hit enter
  • In case you don't get the treeview that's below the "Work with" entry populated with something that says "PyDev", you'll have to click on the "Add..." button on the top right and add PyDev with http://pydev.org/updates/ as the URL.
  • Choose "PyDev for Eclipse"
  • Click Next and follow the wizard until PyDev is installed

An alternative method for installing PyDev can be found in this YouTube video. Since we had many issues with the EGit installation we don't recommend it anymore for our developers (you would use the "git" command from the console anyways!).

Create the w3af project

Also in the Eclipse main window, follow these steps:

Alt attribute text Here

  • On the main menu click "File > New > Project ..."
  • Choose "PyDev Project" from the list
  • Choose a project name, in the screenshot we used "w3af-fork"
  • Setup the interpreter using auto-configure and leave all the other settings as-is
  • Click "Finish"

Import the code into the workspace

Since we're not using EGit, we'll have to import the code from the local file system. On a console, clone your fork using this command (replace andresriancho with your github username):

git clone [email protected]:andresriancho/w3af.git

If the git command isn't found, please install git first:

sudo apt-get install git

Once the previous steps is finished go back to Eclipse and right-click over the "w3af-fork" project, in the context menu choose "Import..." and follow these steps:

  • Choose "General > File System"
  • Click "Next"
  • Click "Browse..." and choose the directory where your code was cloned, example: "/home/pablo/w3af/"
  • In the leftmost tree-view choose all w3af files by clicking on "w3af"
  • Click "Finish"

This should create a directory in "/home/pablo/workspace/w3af-fork/ with all of w3af's source code. Please note that any changes you make using Eclipse will be applied to that directory and not to the one where you initially cloned your code using "git clone".

That's it! You're ready to start using Eclipse to edit your Python files. Some shortcuts that might be useful:

  • Ctrl+Click over a variable or function will take you to it's definition
  • Ctrl+Shift+R opens a resource search

Improvements needed

This document needs improvements! Please help us keep it up to date, if it doesn't work on your system let us know via our mailing list and we'll talk with you to correct it.