Changes between Version 76 and Version 77 of BuildSystem

12/15/12 22:34:59 (7 years ago)



  • 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 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. 
    107 == Advanced == 
    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: 
    112 e.g. 
    113 {{{ 
    114 rebuild.list=Hmi/HmiUtil, Hmi/HmiMath, Hmi/HmiAnimation, Hmi/HmiNeurophysics, Hmi/HmiRenderEnvironment, Hmi/HmiAnimationEmbodiments 
    115 }}} 
    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 
    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. 
    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: 
    146 Create a  
    147 file in your home directory and add: 
    148 {{{ 
    149 hmi.repository.filesystem.root=d:/hmirepo 
    150 repository.mode=filesystem 
    151 }}} 
    153 Copy the hmirepository to your directory of choice. Rsync can be used to create incremental copies: 
    154 {{{ 
    155 rsync -v -a --delete . 
    156 }}} 
    159 === Compiling to/as a different Java version === 
    160 In 
    161 {{{ 
    162 javac.version=1.6 (both source and target are 1.6) 
    163 }}} 
    164 or  
    165 {{{ 
    166  (source may e.g. be Java 1.7, target is 1.6 class code) 
    167 }}} 
    169 === Releasing external jar files === 
    170 hmibuild/publishexternal/ 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 ./ -v 1.1 -o myorganization -m mymodule --host mymodule-1.1.jar 
    173 }}} 
    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 file, e.g.: 
    182 {{{ 
    183 publish.resolver=soa.core.repository 
    184 }}} 
    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 
    189 asap.resource.sftp.publish: the asap resource ssh repository (web version located at 
    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 
    192 resource.sftp.publish: the resource hmi repository (web version located at 
    193 }}} 
    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. 
    198 To increment the major release number use 
    199 {{{ 
    200 ant majorrelease 
    201 }}} 
    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 
    211 {{{ 
    212 language=zipresource 
    213 }}} 
    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). 
    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 {{{ 
    221 }}} 
    222 in your ~/ file. 
    224107== More == 
    225108Detailed explanation of the build system is still being written. For specific questions, ask below.