Changes between Version 76 and Version 77 of BuildSystem


Ignore:
Timestamp:
12/15/12 22:34:59 (7 years ago)
Author:
welberge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildSystem

    v76 v77  
    105105is to include \resources" into its own resource directory within your project. (Our ant build system puts your project's own resource directory on the classpath, as well as other directories that you specify in the build.properties file) !NetBeans auto-include of src documents is also not so nice if you have some secret-remarks.txt, or some huge remarks.doc word file in your source directories. In this case, you must set the files to exclude for packaging. For instance, via: Build | Set Main Project Configuration | Customize..., or via right-clicking the project tab, and selecting \Properties". Choose the \Packaging" tab, and to the "Exclude from jar file", for instance, add, **/*.txt, **/*.doc. 
    106106 
    107 == Advanced == 
    108  
    109 === Running and compiling against source code === 
    110 It 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: 
    111  
    112 e.g. 
    113 {{{ 
    114 rebuild.list=Hmi/HmiUtil, Hmi/HmiMath, Hmi/HmiAnimation, Hmi/HmiNeurophysics, Hmi/HmiRenderEnvironment, Hmi/HmiAnimationEmbodiments 
    115 }}} 
    116  
    117 * `ant resolve` to collect all dependent released and external libraries in the `lib` directory 
    118 * `ant compilelist` to compile dependent modules  
    119 * `ant main` to set the class that is to be run 
    120 * `ant run` to compile and run the project 
    121  
    122  
    123 === Fixing java.lang.!OutOfMemoryError: !PermGen space === 
    124 For large (re)builds, especially of !HmiDemo projects with lots of 
    125 dependencies, the default ant settings do not suffice, and ant might 
    126 crash because of memory problems; typically  
    127 {{{ 
    128 java.lang.OutOfMemoryError: PermGen space 
    129 }}} 
    130 This error can be fixed by explicitly setting the permgensize in the ANT_OPTS environment variable. In linux this is done using: 
    131 {{{ 
    132 export ANT_OPTS="-XX:MaxPermSize=1024M" 
    133 }}}  
    134 in e.g. ~/.bashrc. In windows,ant calls the antrc_pre.bat file (if it exists) before running ant, so the environment variable can be set there using: 
    135 {{{ 
    136 set ANT_OPTS=-XX:MaxPermSize=1024M 
    137 }}} 
    138 ant_rc.bat should be placed in  your HOME directory. 
    139  
    140  
    141 === Using a local repository === 
    142 By default, the Hmi, Asap and external libraries are checked out from the https server and it is strongly advised that you resolve them from there. 
    143 However, if you (temporarily, e.g. at a conference) don't have an internet connection, you can set up the build system to check out from a local directory (here: d:/hmirepo). This is done as follows: 
    144  
    145  
    146 Create a  
    147 hmi.build.properties file in your home directory and add: 
    148 {{{ 
    149 hmi.repository.filesystem.root=d:/hmirepo 
    150 repository.mode=filesystem 
    151 }}} 
    152  
    153 Copy the hmirepository to your directory of choice. Rsync can be used to create incremental copies: 
    154 {{{ 
    155 rsync -v -a --delete loginname@hmirepo.ewi.utwente.nl:/local2/hmirepo . 
    156 }}} 
    157  
    158  
    159 === Compiling to/as a different Java version === 
    160 In build.properties: 
    161 {{{ 
    162 javac.version=1.6 (both source and target are 1.6) 
    163 }}} 
    164 or  
    165 {{{ 
    166 javac.target=1.6  (source may e.g. be Java 1.7, target is 1.6 class code) 
    167 }}} 
    168  
    169 === Releasing external jar files === 
    170 hmibuild/publishexternal/publish.py is a python script to release external jar files into e.g. hmirepo. This script will create the ivy xml file, setup up the correct directory structure in the repository and copy over a specified jar. The script assumes that a private key for the server is available in ~/.ssh/id_rsa. Windows users will need to install the winrandom and Crypto packages for Python, in linux (at least on the new techfak netboot machines in Bielefeld) it just works. Run the script as follows: 
    171 {{{ 
    172 python ./publish.py -v 1.1 -o myorganization -m mymodule --host welberge@hmirepo.ewi.utwente.nl mymodule-1.1.jar 
    173 }}} 
    174  
    175  
    176 === Releasing your project on a repository === 
    177 To create a release of your project on the soa, asap or hmi repository: 
    178 {{{ 
    179 ant release 
    180 }}} 
    181 This requires that you specify the repository in the build.properties file, e.g.: 
    182 {{{ 
    183 publish.resolver=soa.core.repository 
    184 }}} 
    185  
    186 Of course you'll also need to have write access to the repository. The following repositories are available by default: 
    187 {{{ 
    188 asap.sftp.publish: the asap code ssh repository (web version located at http://asap-project.org/repo/repository) 
    189 asap.resource.sftp.publish: the asap resource ssh repository (web version located at http://asap-project.org/repo/resource) 
    190 soa.core.repository: the soashared repository, a git repository assumed to be located in your <gitroot>/soashared directory. Send a pull request to Herwin add your local changes into the shared git repository. 
    191 hmicore.sftp.publish: the hmi code ssh repository (web version located at http://hmirepo.ewi.utwente.nl/repository) 
    192 resource.sftp.publish: the resource hmi repository (web version located at http://hmirepo.ewi.utwente.nl/resource) 
    193 }}} 
    194  
    195 {{{ant release}}} increments the minor version number, then produces a version with "release" status. When the current version happens to be a 
    196 developer version, then "incrementing the minor" actually means "stripping off" the -devi suffix. 
    197  
    198 To increment the major release number use 
    199 {{{ 
    200 ant majorrelease 
    201 }}} 
    202  
    203 ==== Releasing data as a zip file ==== 
    204 To release a project containing only data as a zip file, set the following in ivy.xml: 
    205 {{{ 
    206 <publications> 
    207      <artifact type="zip" ext="zip"/> 
    208 </publications> 
    209 }}} 
    210 in build.properties 
    211 {{{ 
    212 language=zipresource 
    213 }}} 
    214  
    215 This will zip up everything in your resource dir and release it when you use one of the release targets (e.g. release, majorrelease). When resolving such a released dataset, it will be unpacked in the lib directory. Such resource project should contain a single top-level directory and no other files in resource to keep the lib dir somewhat clean and readable (this is somewhat enforced by the resolver). 
    216  
    217 ==== Releasing under a different user name ==== 
    218 If you need to release under a different name than your username (e.g. at home), use 
    219 {{{ 
    220 publish.user.name=yourpublishusername 
    221 }}} 
    222 in your ~/hmi.build.properties file. 
    223  
    224107== More == 
    225108Detailed explanation of the build system is still being written. For specific questions, ask below.