#Getting Started with Boa Development This document describes how you might set up your development environment to view, edit and test the Boa compiler's source code on your local computer. The Boa infrastructure hosted at http://boa.cs.iastate.edu uses the same code, but that execution would use a Hadoop cluster.
##Using Eclipse
-
Setup your development environment by following the instruction from Development Setup page.
After following the instructions above, you would have successfully imported the project into your Eclipse IDE. You should also be able to trigger ant builds and edit project source files within your Eclipse installation. -
In order to run a Boa program locally, the Boa compiler compiles a Boa program to a Java program and runs the generated Java program using reflection and Hadoop libraries. To enable this within the Eclipse IDE
- Create a directory named "compile" in the project's root directory.
- From the project's "Properties > Java Build Path", select the "Libraries" tab."
- Use "Add External Class Folder" to add newly created directory (compile) in classpath.
- After adding the "compile" directory, your "Libraries" tab should look like this:
- From "Run > Run Configuration > Java Application" select "Main" tab to create a "Run Configuration" for the BoaEvaluator class. After this step your "Main" tab should look something like this:
- Select "Arguments" tab in same window to provide program arguments separated by single space.
Program arguments include - Hit apply and Run, this will run your Boa program on local data. Once the program execution completes, your "Console" will look similar to this: Note that depending on your Boa program, the data set, and the capabilities of your local computer the execution may take some time.
- Problems with the Boa compiler, and questions regarding Boa programming can be asked at the Boa user forum.
###Using IntelliJ IDEA
-
Setup your development environment by following the instruction from Development Setup page.
After following the instructions above, you would have successfully imported the project into your Eclipse IDE. You should also be able to trigger ant builds and edit project source files within your Eclipse installation. -
In order to run a Boa program locally, the Boa compiler compiles a Boa program to a Java program and runs the generated Java program using reflection and Hadoop libraries. To enable this within the IntelliJ IDE
-
Create a directory named "compile" in the project's root directory.
-
From the project's "Properties > Compiler", select the "Dependencies" tab."
-
Use "+" (available at bottom) to add newly created directory (compile) in classpath.
-
After adding the "compile" directory, your "Dependencies" tab should look like this:
-
From "Run > Edit Configuration > Application" select "Configuration" tab to create a "Run Configuration" for the BoaEvaluator class.
-
In the "Arguments" field in same window, provide program arguments separated by single space.
Program arguments include -
Hit apply and Run, this will run your Boa program on local data. Once the program execution completes, your "Console" will look similar to this: Note that depending on your Boa program, the data set, and the capabilities of your local computer the execution may take some time.
-
Problems with the Boa compiler, and questions regarding Boa programming can be asked at the Boa user forum.
-
##Sample Data Set A small data set is provided within the Boa repository to test the compiler and your modifications. You can access this data under the "dataset" directory located in the root directory. The organization of this dataset is identical to that used by the Boa infrastructure. A complete Boa dataset consists of 3 files:
- index: this is a map file that stores a mapping from project index to the data location in the AST sequence file (see below). For more on the map file format see its documentation.
- data: this file stores the abstract syntax tree (AST) of each project as a sequence file. See the documentation for more information on the sequence file format.
- projects.seq: this file stores the metadata for each project e.g. commit logs, authors, etc. as a sequence file.
The sample dataset contain only three projects to keep the download size small: Boa, PaniniJ, and Panini.