Changes between Version 71 and Version 72 of BuildSystem

12/15/12 22:28:09 (7 years ago)



  • BuildSystem

    v71 v72  
    22= The ANT based build system = 
    4 == Goal of the build system == 
    54The modules in Asap are dependent on many external and internal libraries, sometimes in different versions. Furthermore, each machine (32bit, 64bit, mac, windows, linux) may require its own version of a specific library. The build system was created to: 
    65 * collect all dependent external libraries, and all internal releases, in a structured repository that allows to keep track of versions and dependencies 
    87 * make it easy to release new versions of our own modules 
    98 * make it easy to use, in module A, the current latest compile of module B, instead of the released version of module B 
     9 * make all this functionality available for multiple programming languages (java, python, c++) in a unified manner 
     11== Getting Started == 
     12 * BuildQuickStart 
    1116== Build philosophy == 
    97102* The major.minor-devi form is used as a "developer version" for release major.minor. Such versions are produced during our "nightly" build process. (Should be running on a daily basis; but when testing during the nightly build produces error, no new versions are published that night). Daily builds are thus more stable than alphas, in that they are guaranteed to pass the test cases. The number i matches to the build number on the daily build server. To guarantee unique daily build numbers, daily builds should therefore only be produced by the build server; if an inbetween daily build is desired, one can create on by starting the daily build job on the build server. TODO: currently only Herwin can do this... 
    99 == Starting point == 
    100 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. 
    102 e.g. 
    103 {{{ 
    104 <gitroot>/hmibuild 
    105 <gitroot>/AsapDemo 
    106 <gitroot>/HmiDemo 
    107 <gitroot>/AsapResource 
    108 <gitroot>/HmiResource 
    109 ...etc 
    110 }}} 
    112 And, if you'd like to compile the !Asap/Hmi sources: 
    113 {{{ 
    114 <gitroot>/HmiCore 
    115 <gitroot>/HmiEnvironment 
    116 <gitroot>/Asap 
    117 ....etc 
    118 }}} 
    120 == Quickstart: resolving libraries for and running a Java demo == 
    121 Set up the hmibuild and your project top level directory as described above under "Starting point". 
    123 In command prompt the module directory (e.g. !AsapDemo/AsapRealizerDemo): 
    124  * `ant resolve` to collect all dependent released and external libraries in the `lib` directory 
    125  * `ant main` to select the main class 
    126  * `ant run` to compile and run the project 
    128 == Creating your own project == 
    129 [=#directorylayout] 
    130 The build system assumes the following directory layout: 
    131 {{{ 
    132 yourproject/build.xml                 (ant build file) 
    133 yourproject/ivy.xml                   (specification of dependencies) 
    134 yourproject/          (build properties) 
    135 yourproject/src                       (source directory) 
    136 yourproject/generatedsrc              (source code generated by a source code generation tool (e.g. protoc)) 
    137 yourproject/lib                       (directory for resolved jars (auto filled, do not add custom libraries here, nor commit to git)) 
    138 yourproject/lib.local directory       (directory for custom libraries for your project) 
    139 yourproject/resource                  (directory for data resources for your project) 
    140 yourproject/privateprops              (private properties for your project, e.g. selected main class, should not be committed to git) 
    141 yourproject/build                     (compiled files, e.g. .jar, .pyc, should not be committed to git) 
    142 yourproject/dist                      (distribution of your project, e.g. .jar, .zip, should not be committed to git) 
    143 yourproject/docs                      (documentation, also for generated javadoc) 
    144 yourproject/test/ivy.xml              (specification of test specific jar dependencies) 
    145 yourproject/test/src                  (test sources) 
    146 yourproject/test/lib                  (directory for resolved test libraries (auto filled, do not add custom jars here)) 
    147 yourproject/test/resource             (test specific data) 
    148 }}} 
    149 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: 
    150 e.g.: 
    151 {{{ 
    152 <?xml version="1.0" encoding="UTF-8"?> 
    153 <project name="HmiNeuroPhysicsDemo"  default="run"> 
    154    <import file="../../hmibuild/build.xml" /> 
    155 </project> 
    156 }}} 
    158 The ivy.xml file is used to specify the library dependencies of the project. For example: 
    159 {{{ 
    160 <ivy-module version="2.0"> 
    161    <info organisation="HMIDemo" module="HmiNeuroPhysicsDemo"/> 
    162    <configurations> 
    163       <include file="${ivy.settings.dir}/configurations.xml"/> 
    164    </configurations> 
    165    <dependencies> 
    166       <dependency org="HMI"   name="HmiRenderEnvironment"   rev="latest.${resolve.status}"  /> 
    167       <dependency org="HMI"   name="HmiAnimationEmbodiments"   rev="latest.${resolve.status}"  /> 
    168       <dependency org="HMI"   name="HmiAnimation"     rev="latest.${resolve.status}"  /> 
    169       <dependency org="HMI"   name="HmiGraphics"      rev="latest.${resolve.status}"  /> 
    170       <dependency org="HMI"   name="HmiMath"          rev="latest.${resolve.status}"  /> 
    171       <dependency org="HMI"   name="HmiNeurophysics"  rev="latest.${resolve.status}"  /> 
    172       <dependency org="HMI"   name="HmiUtil"          rev="latest.${resolve.status}"  /> 
    174       <dependency org="jcip"      name="jcip-annotations"  rev="latest.release"  />    
    175       <dependency org="slf4j"     name="slf4j-api"         rev="latest.release"  />    
    176       <dependency org="logback"   name="logback-classic"   rev="latest.release"  />    
    177       <dependency org="logback"   name="logback-core"      rev="latest.release"  />    
    178       <dependency org="Sun"       name="jlfgr"             rev="latest.release"  />                
    179    </dependencies> 
    180 </ivy-module>  
    181 }}} 
    182 rev="latest.release" means: resolve the latest version of this external library 
    183 rev="latest.${resolve.status}" means: resolve the latest version of this library of ${resolve.status} 
    184 resolve.status is set in the build properties, valid values are beta (for daily release) and release (for stable version). 
    186 The full list of available external libraries and Hmi libraries can be found here: 
    187 Asap's libraries names and jars can be found here: 
    189 The file specifies several build and run options. For example resource path and runtime arguments for the jvm: 
    190 {{{ 
    191 language=java 
    192 resolve.status=beta 
    193 resource.path=${shared.resources}/DefaultShaders/resource;${shared.resources}/LogbackConfigs/resource;${shared.resources}/HmiHumanoidEmbodimentArmandia/resource; 
    194 run.jvmargs= -Xms128m -Xmx512m  -Xss5M -Dlogback.configurationFile=LogbackConfigs/warnlogstdout.xml 
    195 }}} 
    197 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). 
    199104== Use cases == 
    200105=== Running and compiling against released versions ===