BYU Home page BRIGHAM YOUNG UNIVERSITY
Department Title
Navigation Menu


BYU EDIF Tools Build Instructions

Eclipse is an excellent package for code development, especially for Java based projects. For this reason, we develop the EDIF project from within the Eclipse environment. This document explains how to get started with Eclipse and the BYU EDIF Tools project.

Install Eclipse

Checkout BYU EDIF Tools from SVN into Eclipse

Install Subclipse Plugin for Eclipse 3.2+

Note: Instructions below written for Eclipse 3.4. Exact commands may differ slightly.

  1. Help > Software Updates...
  2. Add Site...
  3. URL:

    http://subclipse.tigris.org/update_1.4.x

  4. Expand the "Subclipse" dropdown item
  5. Select "Subclipse" category, selecting all items
  6. Install...
  7. When prompted, restart Eclipse

Add the BYU EDIF SVN Respository to the list of repositories

  1. Window > Open Perspective > Other...
  2. SVN Repository Exploring
  3. In the "SVN Respository" section, right-click and select "New > Repository Location..."
  4. In the URL field, enter:

    https://byuediftools.svn.sourceforge.net/svnroot/byuediftools

Checkout BYU EDIF Tools into a new Eclipse project

  1. Switch to the SVN Repository View
  2. Expand the svn repository so that you can see the "trunk" folder
  3. Right-click on trunk and select "Checkout..." (or "Find/Check Out As..." under Eclipse 3.4)
  4. Make sure that "Check out as a project configured using the New Project Wizard"
    • Note: This step is very important and is the only way to get Eclipse to recognize the project as both an SVN project and a Java project.
  5. Select "Finish"
  6. In the "Select a Wizard" dialog box, select "Java Project" and then Next
  7. Enter a project name (e.g. "byuediftools")
  8. Under "Project layout", make sure "Use project folder as root for sources and class files" is selected
    • Note: This is not necessary uner Eclipse 3.4
  9. Finish
  10. If you receive a question asking if you want to switch to the Java perspective, select "OK"
  11. If you receive a warning that the project contains resources other than the standard .project file, select "OK"
  12. At this point Eclipse will begin the checkout from the SVN repository. This may take a few minutes.

Prepare BYU EDIF Tools for building in Eclipse

  1. Right click on the project you have checked out the EDIF code into and select Properties
  2. Java Build Path
  3. Libraries tab
  4. Add External JARs...
  5. You will need to add a JAR for the JSAP package. This can be found at: http://sourceforge.net/projects/jsap/
  6. Some parts of the code also require JHDL; for the most part however, JHDL is optional. It can be found at: http://www.jhdl.org/download.html
  7. After adding these two JARs, the project should build without errors. If you only add the JSAP jar, there will be some build errors, but most of the tools will work.

Installing the BYU EDIF Tools coding style configuration file

  1. Open Eclipse and the BYU EDIF Tools project
  2. Window > Preferences
  3. Java > Code Style > Formatter
  4. Import...
  5. The configuration file in part of the BYU EDIF Tools repository and is located in the following directory: (Here, we assume the Eclipse project name is byuediftools; your project name and location may differ.)
  6. edu/byu/ece/edif/util/BYU_EDIF_Tools_coding_style.xml

Automatic Code Formatting

Eclipse offers the option to automatically format your code every time you save it. This will ensure that your code always conforms to the BYU EDIF Tools coding style. To enable formatting on save:
  1. Open Eclipse and the BYU EDIF Tools project
  2. Window > Preferences
  3. Java > Editor > Save Actions
  4. Turn on "Perform the selected actions on save"
  5. Turn on "Format the source code"
  6. Turn on "Organize Imports"
  7. (We recommend that you leave "Additional Actions" off)

Manual Code Formatting

To manually format the current file in Eclipse:
  • Source > Format
To manually format the current Java element (method, comment block, etc.):
  • Source > Format Element
To format multiple files:
  1. Select the files from the Package Explorer
    • CLICK on the first file, SHIFT+CLICK on the last file
    • or CLICK on first file, CTRL+CLICK on each subsequent file
  2. Right-click on one of the files (or SHIFT+ALT+S)
  3. Source > Format
  4. If Eclipse mentions that the requested action cannot be undone, think hard about what you are doing and then make the best decision. (If you don't have any outstanding changes, you can always "revert" the formatting using SVN.)


Related Links