Skip to content

Setting Up Eclipse Dev Environment

Corrina Del Greco edited this page Oct 22, 2020 · 3 revisions

Setting Up Eclipse Development Environment

Prerequisites: You have downloaded the Eclipse IDE and Git Bash.

Cloning the Repository

  • Create a folder for the project in the location of your choosing
  • With that folder open in file explorer, right click in the folder and select Git Bash Here
  • In the bash, run
$ git clone https://github.com/AVanDeBrook/c-dependency-graph.git

Note: To find that link, go to the GitHub page > click the <> Code tab in the upper left > click the green Code button > copy the link

Importing the Project

  • Open Eclipse
  • When prompted for a directory for a workspace, create a new folder and use that
  • Eclipse > File > Open Projects from File System... > Directory... > Choose the folder that the git clone created (in this case, c-dependency-graph inside the folder you created in Cloning the Repository) > ensure "Search for nester projects" is checked > Finish
  • If the welcome window is closed, the left sidebar should show the project.

Configuring Eclipse to Use the Formatter

  • Go to this repo for the formatting file
  • On that page, like before, <> Code tab > green Code button > Download Zip
  • From that Zip, we want eclipse_c_code-style_linux-kernel.xml. Copy that to somewhere you can keep it and you can delete the Zip.
  • Eclipse > Window > Preferences > Java > Code Style > Formatter > Import... > eclipse_c_code-style_linux-kernel.xml > Open > Apply and Close
  • Eclipse > Window > Preferences > Editor > Save Actions > check Perform the selected actions on save > check Format source code > leave Organize imports and Format all lines selected > Apply and Close

Now instead of using Ctrl-Shift-F to format your code, it will format automatically in the Linux Kernel style whenever you save. Plus, unused imports will be removed.

Clone this wiki locally