# Development Environment
# Repository Overview
The source code repository is organised in the following subfolders:
The ACS folder contains the AsTeRICS Configuration Suite source code.
The Android folder contains a server application for Android phones which allows interfacing with the AsTeRICS Android plugin to use phone functions in AsTeRICS models.
The ARE folder contains the middleware and service layers and ARE components.
The bin folder contains subfolders where ARE and ACS executable files are placed during the build flow. These folders contain additional configuration files or dependencies, for example the config.ini and loader.ini files which specify the modules which are loaded by the ARE at startup.
Additionally, the bin folder contains several resources which are useful, e.g. a pre-built ACS with demo models (in the ACS\models folder) and the OSKA application.
The BNCIevaluationSuite is a collection of matlab files for analysis and comparison of algorithms for Brain Computer Interfaces (contributed by Starlab).
The CIM folder contains firmware for the microcontroller modules used to interface the system to the environment (maintained by IMA and FHTW).
The Documentation folder contains the User- and the Developer Manual, and OSKA manual and the licence information for the developed and all utilized source code and libraries.
The NativeASAPI folder contains C++ libraries for mobile-phone and GSM modem access, 3d-mouse and tremor reduction from own C++ projects.
# Clone Repository
Install a git (opens new window) command line client and clone the repository (opens new window) by entering:
git clone https://github.com/asterics/AsTeRICS.git
# Prerequisites
You need:
- Java Development Kit 8: Zulu JDKs (opens new window) are recommended, but you can also use OpenJDK (opens new window) or the Oracle JDK (opens new window). If you are on Windows, be sure to select the 32-bit version of the JDK.
- apache ant build framework (version >= 1.9.1) (opens new window).
- Set Environment Variables.
# Environment Variables
- Ensure to set
JAVA_HOME
to the folder where you installed the Java JDK and add the JDK bin path to the Environment VariablePath
. - Ensure to set
ANT_HOME
to the folder where you installed ant and add the ant bin path to the Environment VariablePath
.
See below an example of how to set the environment variable JAVA_HOME
on Windows 7.
# Build
AsTeRICS uses the build system ant
.
You can simply build the framework from the command line:
ant
To build and start the ARE, enter:
ant run
For other build targets and their meaning, enter:
ant -projecthelp
# Building ARE Middleware, Services and Plugins
In the ARE
subfolder the source code of the ARE middleware (ARE/middleware
), ARE services (ARE/services
) and plugins (ARE/components
) can be found.
The middleware, the services and the components have separate ant build files (build.xml
). The middleware and services are required for building the plugins (components). To build everything, a top-level build script is available in the ARE
folder.
Alternatively, individual services or components can be built by selecting their associated build.xml
script from the corresponding subfolders.
To build the ARE (plugins, services), enter:
ant
To build and start the ARE, enter:
ant run
To build and start the ARE with remote debugging enabled, enter:
ant run-debug
For other build targets and their meaning, enter:
ant -projecthelp
# Eclipse Setup
The AsTeRICS framework is not bound to a specific IDE, but Eclipse IDE for Enterprise Java Developers (opens new window) is recommended. This will provide editing support for diverse file types (java, html, Js, CSS, xml). Alternately you can install Eclipse IDE for Java Developers and later install addons for web development.
# Java Project
You must create a Java Project
first:
Choose File -> New -> JavaProject in the Eclipse main menu, disable the option “Use default location” and browse to the ARE subfolder:
Then you should see something like this:
Eclipse provides different views (Window -> Show View), where the Navigator and the Package Explorer are most useful for Java source code development.
Note that the “Refresh” command (F5) synchronizes the Navigator view with changes in the local file system.
# Character encoding
Incorrect character encoding settings can cause problems with ANT-based builds in eclipse, especially if special characters like ö, ä, etc. are used in the source code. Be sure to use ISO-8859-1 as character encoding in Configuations and Lauch settings (in the Common tab) as shown in the screenshot (note that this is not the default setting in some versions of eclipse):
# Editing Model Files (windows-only)
You can configure the Eclipse editor to open the ACS editor for AsTeRICS model files (.acs
).
- Right click on a model file, select
Open with/Other
- Check
External programs
and browse toC:\Program Files (x86)\AsTeRICS\ACS\ACS.bat
(Note: ACS.bat) - Check
Use it for all `*.acs file
- Click onto
Ok
# Ant within Eclipse
You can run the ant targets of the AsTeRICS build system from within Eclipse.
# Run default target
- Right click onto file
build.xml
- Select
Run As/Ant Build
(first entry)
# Run selected targets
- Right click onto file
build.xml
- Select
Run As/Ant Build...
(second entry) - Click onto targets to run
- Select order of execution at the bottom
- Click onto
Apply
andRun
The screenshot below shows the dialog for build target selection: