Changes between Version 23 and Version 24 of BuildSystem


Ignore:
Timestamp:
10/25/12 13:49:34 (7 years ago)
Author:
welberge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildSystem

    v23 v24  
    3131 * make it easy to use, in module A, the current latest compile of module B, instead of the released version of module B 
    3232 
    33 == Quickstart == 
    34 In command prompt the module directory: 
     33== Quickstart: resolving libraries for and running a Java demo == 
     34In command prompt the module directory (e.g. AsapDemo/AsapRealizerDemo): 
    3535 * `ant resolve` to collect all dependent released and external libraries in the `lib` directory 
    36  * `ant compilelist` to compile dependent modules  
    37  * `ant ca` to collect the newest compiled versions in the `lib` directory 
     36 * `ant main` to select the main class 
    3837 * `ant run` to compile and run the project 
    3938 
    40 Specify dependent libraries in `ivy.xml`; specify compile-dependent modules in `build.properties` using the `rebuild.list` property 
     39== Creating your own Java project == 
     40The build system assumes the following directory layout: 
     41yourproject/build.xml (ant build file) 
     42yourproject/ivy.xml (specification of jar dependencies) 
     43yourproject/build.properties (build properties) 
     44yourproject/src  (source directory) 
     45yourproject/lib  (directory for resolved jars (auto filled, do not add custom jars here)) 
     46yourproject/lib.local directory (directory for custom jars for your project) 
     47yourproject/resource (directory for data resources for your project) 
     48yourproject/test/ivy.xml (specification of test specific jar dependencies) 
     49yourproject/test/src (test sources) 
     50yourproject/test/lib (directory for resolved test jars (auto filled, do not add custom jars here)) 
     51yourproject/test/resource (test specific data) 
     52 
     53To use the build system with your own Java project, you'll need to set up a build.xml, build.properties and ivy.xml file. The build.xml file provides the project name and normally simply refers to the default build.xml in hmibuild: 
     54e.g.: 
     55{{{ 
     56<?xml version="1.0" encoding="UTF-8"?> 
     57<project name="HmiNeuroPhysicsDemo"  default="run"> 
     58   <import file="../../hmibuild/build.xml" /> 
     59</project> 
     60}}} 
     61 
     62The ivy.xml file is used to specify the library dependencies of the project. For example: 
     63<ivy-module version="2.0"> 
     64   <info organisation="HMIDemo" module="HmiNeuroPhysicsDemo"/> 
     65   <configurations> 
     66      <include file="${ivy.settings.dir}/configurations.xml"/> 
     67   </configurations> 
     68   <dependencies> 
     69      <dependency org="HMI"   name="HmiRenderEnvironment"   rev="latest.${resolve.status}"  /> 
     70      <dependency org="HMI"   name="HmiAnimationEmbodiments"   rev="latest.${resolve.status}"  /> 
     71      <dependency org="HMI"   name="HmiAnimation"     rev="latest.${resolve.status}"  /> 
     72      <dependency org="HMI"   name="HmiGraphics"      rev="latest.${resolve.status}"  /> 
     73      <dependency org="HMI"   name="HmiMath"          rev="latest.${resolve.status}"  /> 
     74      <dependency org="HMI"   name="HmiNeurophysics"  rev="latest.${resolve.status}"  /> 
     75      <dependency org="HMI"   name="HmiUtil"          rev="latest.${resolve.status}"  /> 
     76                         
     77      <dependency org="jcip"      name="jcip-annotations"  rev="latest.release"  />    
     78      <dependency org="slf4j"     name="slf4j-api"         rev="latest.release"  />    
     79      <dependency org="logback"   name="logback-classic"   rev="latest.release"  />    
     80      <dependency org="logback"   name="logback-core"      rev="latest.release"  />    
     81      <dependency org="Sun"       name="jlfgr"             rev="latest.release"  />                
     82   </dependencies> 
     83</ivy-module>  
     84rev="latest.release" means: resolve the latest version of this external library 
     85rev="latest.${resolve.status}" means: resolve the latest version of this library of ${resolve.status} 
     86resolve.status is set in the build properties, valid values are beta (for daily release) and release (for stable version). 
     87 
     88The full list of available external libraries and Hmi libraries can be found here: http://hmirepo.ewi.utwente.nl/. 
     89Asap's libraries names and jars can be found here: http://asap-project.ewi.utwente.nl/repo/. 
     90 
     91The build.properties file specifies several build and run options. For example resource path and runtime arguments for the jvm: 
     92{{{ 
     93resolve.status=beta 
     94resource.path=${shared.resources}/DefaultShaders/resource;${shared.resources}/LogbackConfigs/resource;${shared.resources}/HmiHumanoidEmbodimentArmandia/resource; 
     95run.jvmargs= -Xms128m -Xmx512m  -Xss5M -Dlogback.configurationFile=LogbackConfigs/warnlogstdout.xml 
     96}}} 
    4197 
    4298== Use cases == 
     
    46102* `ant run` to compile and run the project 
    47103 
     104=== Testing === 
     105* `ant junit` to compile and run the test cases 
     106* `ant junitreport` to compile and run the test cases and generate an html report in the test/report directory 
     107 
     108=== Resolving dependencies === 
     109Dependencies are resolved from 
     1101. the local.lib directory of a project 
     1112. the local repository directory of a project (can be set up in its repository directory) 
     1123. the repositories in http://asap-project.ewi.utwente.nl/repo/ and http://hmirepo.ewi.utwente.nl/ 
     113`ant resolve' and similar resolve commands empty the lib directory, so use local.lib to store local libraries instead. Local resources are, by convention, stored in a projects resource directory. 
     114 
     115'''Advanced:''' new/alternative default repositories can be added in !hmibuild/ivy/ivysettings.xml 
     116 
     117== Advanced == 
     118 
    48119=== Running and compiling against source code === 
     120It is possible (but not recommended) to run and compile your project against the source of other projects. To this end, define the projects source dependencies using rebuild.list: 
     121 
     122e.g. 
     123{{{ 
     124rebuild.list=Hmi/HmiUtil, Hmi/HmiMath, Hmi/HmiAnimation, Hmi/HmiNeurophysics, Hmi/HmiRenderEnvironment, Hmi/HmiAnimationEmbodiments 
     125}}} 
     126 
    49127* `ant resolve` to collect all dependent released and external libraries in the `lib` directory 
    50128* `ant compilelist` to compile dependent modules  
     
    52130* `ant run` to compile and run the project 
    53131 
    54 === Testing === 
    55 * `ant junit` to compile and run the test cases 
    56 * `ant junitreport` to compile and run the test cases and generate an html report in the test/report directory 
    57132 
    58 == Setting up project dependencies == 
    59 The dependencies of a project are managed in the ivy.xml file in its root directory. 
    60 A typical ivy.xml file looks like this: 
    61 {{{ 
    62 <ivy-module version="2.0"> 
    63    <info organisation="HMI" module="HmiTTS"/> 
    64    <dependencies>  
    65       <dependency org="jcip"       name="jcip-annotations"   rev="latest.release"  />    
    66       <dependency org="slf4j"      name="slf4j-api"          rev="latest.release"  />    
    67       <dependency org="HMI"        name="HmiUtil"            rev="latest.${resolve.status}"  /> 
    68       <dependency org="HMI"        name="HmiXml"             rev="latest.${resolve.status}"  />             
    69    </dependencies> 
    70 </ivy-module>    
    71 }}} 
    72 rev="latest.release" means: resolve the latest version of this external library 
    73 rev="latest.${resolve.status}" means: resolve the latest version of this HMI library of ${resolve.status} 
    74 resolve.status is set in the build properties, valid values are beta and release. 
    75  
    76 === Resolving dependencies === 
    77 Dependencies are resolved from 
    78 1. the local.lib directory of a project 
    79 2. the local repository directory of a project (can be set up in its repository directory) 
    80 3. the repository in !HmiShared 
    81 `ant resolve' and similar resolve commands empty the lib directory, so use local.lib to store local libraries instead. Local resources are, by convention, stored in a projects resource directory. 
    82  
    83 '''Advanced:''' new/alternative default repositories can be added in !HmiShared/ivy/ivysettings.xml 
    84  
    85 == Advanced == 
    86133=== Fixing java.lang.!OutOfMemoryError: !PermGen space === 
    87134For large (re)builds, especially of !HmiDemo projects with lots of