wiki:UsingAsapRealizerInEclipse

Version 6 (modified by welberge, 7 years ago) (diff)

--

Using AsapRealizer in an Eclipse project

STEP 1: Setting up project structure

First, you need to set up projects in Eclipse for the various modules that you want to compile. The process is slightly different when you work from the source git or when you work from the released binaries.

Variant A: Setting up project structure via git in Eclipse

If you use the source releases from AsapRealizer, you need to set up git in Eclipse, check out the modules from the repository, and make them into an Eclipse project.

  1. Install  Python and make sure the python binary is on your path
  2. (Optional, if you'd like to use git within eclipse) Get the git plugin from  http://www.eclipse.org/egit/ and install it
  3. Check out the source repository by hand (using commandline git SmartGit, TortoiseGit, or any tool of your choice). Typical directory setup when you have checked out the Git:
    <gitroot>/Asap/AsapAnimationEngine
    <gitroot>/Asap/AsapRealizer
    <gitroot>/Asap/AsapBML
    ...
    <gitroot>/AsapDemo/AsapRealizerDemo
    ...
    <gitroot>/asapresource/
    ...
    <gitroot>/HmiResource/
    ...
    <gitroot>/asapshared/
    ...
    <gitroot>/HmiShared/ant
    <gitroot>/HmiShared/docs
    <gitroot>/HmiShared/repository
    ...etc
    ...etc
    <gitroot>/Hmi/HmiBml
    <gitroot>/Hmi/HmiAnimation
    ....etc
    

STEP 2: Set build paths to include dependent libraries

you need the right versions (for your machine and operating system) of all dependent libraries in the project classpath; AsapRealizer contains ant scripts to take care of this.

  1. First, collect right versions of libraries using our ant scripts
    1. command prompt in HmiDemo/MyFirstProject
    2. now use resolve the libraries for your project, using ant resolve, ant compile list, etc (see also http://asap-project.ewi.utwente.nl/wiki/BuildSystem)
    3. Now, all required libraries, in the version for your OS and machine, are in HmiDemo/MyFirstProject/lib
  2. Second, create the eclipse project files, again using an ant script
    1. Sane people: ant eclipseproject
    2. Herwin: ant eclipsesourceproject

The first will create an independent eclipse project file with dependencies on the jar files that were resolved in the lib directory. The second will create an eclipse project file in which the rebuild.list is linked to other eclipse projects. This option is only useful if you are very deeply involved in the development of AsapRealizer.

STEP 3: Adding/changing library dependencies, resources, etc.

It is strongly recommended that you do not manually edit your project configuration in eclipse, but instead regenerate the project using step 2 whenever library dependencies change and/or new resource dependencies are added. This way your project will also work with ant, and others can easily reconstruct eclipse project files for it. After recreating the project file, you can simply refresh the project in eclipse. You can also easily switch between resolved alpha dependencies and release dependencies in this way. ant eclipseproject/eclipsesourceproject will automatically put resources specified in resource.path and test.resource.path in the project's build.properties on the project's classpath.

STEP 4: set a few virtual machine variables

For running your project, you need to set a few additional settings in "run configuration" dialog for your main class

  1. tab "arguments", VM arguments, add
    -Djava.library.path="lib"
    -Xms128m 
    -Xmx512m  
    -Xss5M
    
  2. add -Dlogback.configurationFile=LogbackConfigs/warnlogstdout.xml or any other config file to specify your logging (see ProgrammingGuidelines)
  3. Add a relative path from you project directory to the proejct root: -Dshared.project.root="../.."