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


Starting point

Clone the hmibuild repository (see GitRepositories for repository locations). To make the build system work out-of-the box with our other code, this code must reside in the same top level directory as hmibuild.



And, if you'd like to compile the Asap/Hmi sources:


Quickstart: resolving libraries for and running a Java demo

Set up the hmibuild and your project top level directory as described above under "Starting point".

In command prompt the module directory (e.g. AsapDemo/AsapRealizerDemo):

  • ant resolve to collect all dependent released and external libraries in the lib directory
  • ant main to select the main class
  • ant run to compile and run the project

Directory Layout

The build system assumes the following directory layout:

yourproject/build.xml                 (ant build file)
yourproject/ivy.xml                   (specification of dependencies)
yourproject/          (build properties)
yourproject/src                       (source directory)
yourproject/generatedsrc              (source code generated by a source code generation tool (e.g. protoc))
yourproject/lib                       (directory for resolved jars (auto filled, do not add custom libraries here, nor commit to git))
yourproject/lib.local directory       (directory for custom libraries for your project)
yourproject/resource                  (directory for data resources for your project)
yourproject/privateprops              (private properties for your project, e.g. selected main class, should not be committed to git)
yourproject/build                     (compiled files, e.g. .jar, .pyc, should not be committed to git)
yourproject/dist                      (distribution of your project, e.g. .jar, .zip, should not be committed to git)
yourproject/docs                      (documentation, also for generated javadoc)
yourproject/test/ivy.xml              (specification of test specific jar dependencies)
yourproject/test/src                  (test sources)
yourproject/test/lib                  (directory for resolved test libraries (auto filled, do not add custom jars here))
yourproject/test/resource             (test specific data)

To use the build system with your own project, you'll need to set up a build.xml, and ivy.xml file. The build.xml file provides the project name and normally simply refers to the default build.xml in hmibuild: e.g.:

<?xml version="1.0" encoding="UTF-8"?>
<project name="HmiNeuroPhysicsDemo"  default="run">
   <import file="../../hmibuild/build.xml" />

The ivy.xml file is used to specify the library dependencies of the project. For example:

<ivy-module version="2.0">
   <info organisation="HMIDemo" module="HmiNeuroPhysicsDemo"/>
      <include file="${ivy.settings.dir}/configurations.xml"/>
      <dependency org="HMI"   name="HmiRenderEnvironment"   rev="latest.${resolve.status}"  />
      <dependency org="HMI"   name="HmiAnimationEmbodiments"   rev="latest.${resolve.status}"  />
      <dependency org="HMI"   name="HmiAnimation"     rev="latest.${resolve.status}"  />
      <dependency org="HMI"   name="HmiGraphics"      rev="latest.${resolve.status}"  />
      <dependency org="HMI"   name="HmiMath"          rev="latest.${resolve.status}"  />
      <dependency org="HMI"   name="HmiNeurophysics"  rev="latest.${resolve.status}"  />
      <dependency org="HMI"   name="HmiUtil"          rev="latest.${resolve.status}"  />
      <dependency org="jcip"      name="jcip-annotations"  rev="latest.release"  />   
      <dependency org="slf4j"     name="slf4j-api"         rev="latest.release"  />   
      <dependency org="logback"   name="logback-classic"   rev="latest.release"  />   
      <dependency org="logback"   name="logback-core"      rev="latest.release"  />   
      <dependency org="Sun"       name="jlfgr"             rev="latest.release"  />               

rev="latest.release" means: resolve the latest version of this external library rev="latest.${resolve.status}" means: resolve the latest version of this library of ${resolve.status} resolve.status is set in the build properties, valid values are beta (for daily release) and release (for stable version).

The full list of available external libraries and Hmi libraries can be found here: Asap's libraries names and jars can be found here:

The file specifies several build and run options. For example resource path and runtime arguments for the jvm:

run.jvmargs= -Xms128m -Xmx512m  -Xss5M -Dlogback.configurationFile=LogbackConfigs/warnlogstdout.xml

Multiple programming languages are supported, including java, python, cpp (C++), scripts (simply releases everything in the scripts dir), none (for top-level projects that manage other projects using multiple programming language) and zipresource (for projects containing only data).