|
|
# How to check out the interpreter from github and configure it in Eclipse
|
|
|
|
|
|
# Before Starting
|
|
|
|
|
|
It's best to install the following plugins:
|
|
|
1. [ANTLR eclipse](http://antlreclipse.sourceforge.net) plugin for generating the AmbientTalk/2 parser from its ''atgrammar.g'' grammar specification.
|
|
|
|
|
|
Warning: When checking out projects and assigning names to them in Eclipse, avoid whitespace in the names of your projects. Some plugins or tools such as ANTLR cannot cope with spaces in path names and will not work properly.
|
|
|
|
|
|
# Checking out projects
|
|
|
|
|
|
Since 2015, AmbientTalk/2 source has been moved to https://gitlab.soft.vub.ac.be.
|
|
|
Here is how to configure the AmbientTalk/2 sources in Eclipse:
|
|
|
|
|
|
1. Download the source code from the https://gitlab.soft.vub.ac.be/ambienttalk The language is subdivided into 4 main projects: atlib, iat, interpreter, parser. Each such project has a 'trunk' (the main development branch), a number of 'tag'ged versions, and a number of branches, which represent "work in progress" development branches.
|
|
|
1. pull the appropriate branch (or tagged version) of each of the 4 projects, and import them into Eclipse.
|
|
|
1. After importing these four projects into Eclipse, you may still get a lot of build errors. Configure each project as follows:
|
|
|
|
|
|
Note: AmbientTalk/2 is targeted to run the Android platform, the JDK compliance level should be set to at least Java 1.5.
|
|
|
|
|
|
## parser
|
|
|
|
|
|
Warning: information below needs to be updated, but the parser.jar is included in the interpreter project so you do not need to configure this project if no changes for syntax are required
|
|
|
|
|
|
1. Right-click the project directory and select ''toggle ANTLR project nature'' (only available if you installed the ANLTREclipse plugin, otherwise you have to set the ANTLR_HOME environment variable and add the antlr.jar file to the project manually).
|
|
|
1. Source folders: set ''src'', ''test'' and ''grammar'' as the project's source folders
|
|
|
1. Project references: add the ''interpreter'' project
|
|
|
1. Right-click the ''atgrammar.g'' file, select properties, and in the ANLTR options set ''src/edu/vub/at/parser'' as the output directory for the generated parser files.
|
|
|
1. Make sure that the output dir of the project is set to `projectname/bin` (the ANT build script depends on this)
|
|
|
|
|
|
Note: the parser was specified using ANLTR v2.7, it's not (yet) compatible with ANLTR v3.x.
|
|
|
|
|
|
## interpreter
|
|
|
|
|
|
1. Source folders: set ''src'' and ''test'' as the project's source folders.
|
|
|
1. In the build path, select "Add Jars" and add all .jar files from the interpreter project's ''lib'' subdirectory
|
|
|
1. In the "order and export" tab, check the boxes next to ''at-parser'', ''antlr'', and ''junit''. These jar files then become visible to projects referring to your interpreter project.
|
|
|
1. Make sure that the output dir of the project is set to `projectname/bin` (the ANT build script depends on this)
|
|
|
|
|
|
## atlib
|
|
|
|
|
|
1. Even though this project contains largely `.at` files, it also contains some `.java` files, so it's best to set this project as a Java Project as well. You will then see AmbientTalk namespaces (e.g. /at/support) as if they were Java packages.
|
|
|
1. Project references: add the ''interpreter'' project
|
|
|
1. Exclusion patterns: bridges/rfid, demo/m2mi/chat, ext/m2mi/comparison, ext/m2mi/slides, test
|
|
|
1. Make sure all .jar files in the project are added to your build path (the crime.jar and m2mi.jar).
|
|
|
1. Does not require any other configuration, just make sure the project is set to use the 1.3 JDK.
|
|
|
1. Make sure that the output dir of the project is set to `projectname/bin` (the ANT build script depends on this)
|
|
|
|
|
|
## iat
|
|
|
|
|
|
1. Source folder: set ''src'' as the project's source folder.
|
|
|
1. Project references: add your interpreter, library and parser projects as dependencies.
|
|
|
1. Build path: select "Add jar" and add all .jars located in the ''lib'' subdirectory of the iat project.
|
|
|
1. Make sure that the output dir of the project is set to `projectname/bin` (the ANT build script depends on this)
|
|
|
|
|
|
## atdoclet
|
|
|
|
|
|
1. Source folder: set ''src'' as the source folder
|
|
|
1. Build path: select "Add jar" and add the ''ambienttalk2.jar'' file.
|
|
|
1. In the build path, make sure to set the JDK Runtime libraries to 1.3.1 (the project uses the 1.3 Doclet API)
|
|
|
|
|
|
## Run Configurations
|
|
|
|
|
|
It is best to configure a new run in eclipse that allows you to easily start up ''iat''.
|
|
|
|
|
|
Go to the Run->Run menu, add a new Java application (called e.g. IAT), set the main class to ''edu.vub.at.IAT''. In the 'Arguments' tab, set the **VM** arguments to:
|
|
|
|
|
|
```
|
|
|
-DAT_INIT="${project_loc:atlib}/at/init/init.at"
|
|
|
-DAT_LIBPATH="at=${project_loc:atlib}/at:applications=${project_loc:atlib}/applications:bridges=${project_loc:atlib}/bridges:frameworks=${project_loc:atlib}/frameworks:demo=${project_loc:atlib}/demo:test=${project_loc:atlib}/test:extensions=${project_loc:atlib}/extensions"
|
|
|
```
|
|
|
|
|
|
Where ''atlib'' is the name of your checked out the AT2 atlib project. Also useful: if you don't always want to type in the same startup code over and over again when debugging, set the run configuration to make ''iat'' evaluate a 'main' AmbientTalk file. You can do so by setting the **Program** arguments in the 'Arguments' tab to:
|
|
|
|
|
|
```
|
|
|
/path/to/main.at
|
|
|
```
|
|
|
|
|
|
This will make ''iat'' load the specified ''main.at'' file each time it starts up.
|
|
|
|
|
|
Also useful: you can regulate the logging priorities of the interpreter by setting the **Program** arguments in the 'Arguments' tab to:
|
|
|
|
|
|
```
|
|
|
/path/to/main.at -l all=FATAL
|
|
|
```
|
|
|
|
|
|
This will set all logs to FATAL category (the highest one). Have a look to all command line parameters available for iat [here]
|
|
|
(https://gitlab.soft.vub.ac.be/ambienttalk/ambienttalk/wikis/Command-Line-Parameters)
|
|
|
|
|
|
You're now set to run ''iat'' quickly and smoothly from within Eclipse.
|
|
|
|
|
|
## Running the tests
|
|
|
|
|
|
If you want to run the test suite, take care to only run the TestSuite classes provided by the projects.
|
|
|
There are two such classes:
|
|
|
1. edu.vub.at.InterpreterTests, in the interpreter project
|
|
|
1. edu.vub.at.parser.AllParserTests, in the parser project
|
|
|
|
|
|
By default Eclipse will run all the tests available, which will run the tests once as they are, and once via the test suite.
|
|
|
You **will** get test failures if you do this, so make sure you select the test suites.
|
|
|
|
|
|
You can also test the distribution test (i.e. testsuite written in AmbientTalk itself) by including the following line on your main.at file, or typing it on the console:
|
|
|
|
|
|
```
|
|
|
/.test.libraryTestSuite.testATDistribution();
|
|
|
``` |