Changes between Version 1 and Version 2 of UseCases


Ignore:
Timestamp:
12/15/12 22:35:10 (7 years ago)
Author:
welberge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCases

    v1 v2  
    2727 
    2828'''Advanced:''' new/alternative default repositories can be added in !hmibuild/ivy/ivysettings.xml 
     29 
     30 
     31== Advanced == 
     32 
     33=== Running and compiling against source code === 
     34It 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: 
     35 
     36e.g. 
     37{{{ 
     38rebuild.list=Hmi/HmiUtil, Hmi/HmiMath, Hmi/HmiAnimation, Hmi/HmiNeurophysics, Hmi/HmiRenderEnvironment, Hmi/HmiAnimationEmbodiments 
     39}}} 
     40 
     41* `ant resolve` to collect all dependent released and external libraries in the `lib` directory 
     42* `ant compilelist` to compile dependent modules  
     43* `ant main` to set the class that is to be run 
     44* `ant run` to compile and run the project 
     45 
     46 
     47=== Fixing java.lang.!OutOfMemoryError: !PermGen space === 
     48For large (re)builds, especially of !HmiDemo projects with lots of 
     49dependencies, the default ant settings do not suffice, and ant might 
     50crash because of memory problems; typically  
     51{{{ 
     52java.lang.OutOfMemoryError: PermGen space 
     53}}} 
     54This error can be fixed by explicitly setting the permgensize in the ANT_OPTS environment variable. In linux this is done using: 
     55{{{ 
     56export ANT_OPTS="-XX:MaxPermSize=1024M" 
     57}}}  
     58in 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: 
     59{{{ 
     60set ANT_OPTS=-XX:MaxPermSize=1024M 
     61}}} 
     62ant_rc.bat should be placed in  your HOME directory. 
     63 
     64 
     65=== Using a local repository === 
     66By 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. 
     67However, 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: 
     68 
     69 
     70Create a  
     71hmi.build.properties file in your home directory and add: 
     72{{{ 
     73hmi.repository.filesystem.root=d:/hmirepo 
     74repository.mode=filesystem 
     75}}} 
     76 
     77Copy the hmirepository to your directory of choice. Rsync can be used to create incremental copies: 
     78{{{ 
     79rsync -v -a --delete loginname@hmirepo.ewi.utwente.nl:/local2/hmirepo . 
     80}}} 
     81 
     82 
     83=== Compiling to/as a different Java version === 
     84In build.properties: 
     85{{{ 
     86javac.version=1.6 (both source and target are 1.6) 
     87}}} 
     88or  
     89{{{ 
     90javac.target=1.6  (source may e.g. be Java 1.7, target is 1.6 class code) 
     91}}} 
     92 
     93=== Releasing external jar files === 
     94hmibuild/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: 
     95{{{ 
     96python ./publish.py -v 1.1 -o myorganization -m mymodule --host welberge@hmirepo.ewi.utwente.nl mymodule-1.1.jar 
     97}}} 
     98 
     99 
     100=== Releasing your project on a repository === 
     101To create a release of your project on the soa, asap or hmi repository: 
     102{{{ 
     103ant release 
     104}}} 
     105This requires that you specify the repository in the build.properties file, e.g.: 
     106{{{ 
     107publish.resolver=soa.core.repository 
     108}}} 
     109 
     110Of course you'll also need to have write access to the repository. The following repositories are available by default: 
     111{{{ 
     112asap.sftp.publish: the asap code ssh repository (web version located at http://asap-project.org/repo/repository) 
     113asap.resource.sftp.publish: the asap resource ssh repository (web version located at http://asap-project.org/repo/resource) 
     114soa.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. 
     115hmicore.sftp.publish: the hmi code ssh repository (web version located at http://hmirepo.ewi.utwente.nl/repository) 
     116resource.sftp.publish: the resource hmi repository (web version located at http://hmirepo.ewi.utwente.nl/resource) 
     117}}} 
     118 
     119{{{ant release}}} increments the minor version number, then produces a version with "release" status. When the current version happens to be a 
     120developer version, then "incrementing the minor" actually means "stripping off" the -devi suffix. 
     121 
     122To increment the major release number use 
     123{{{ 
     124ant majorrelease 
     125}}} 
     126 
     127==== Releasing data as a zip file ==== 
     128To release a project containing only data as a zip file, set the following in ivy.xml: 
     129{{{ 
     130<publications> 
     131     <artifact type="zip" ext="zip"/> 
     132</publications> 
     133}}} 
     134in build.properties 
     135{{{ 
     136language=zipresource 
     137}}} 
     138 
     139This 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). 
     140 
     141==== Releasing under a different user name ==== 
     142If you need to release under a different name than your username (e.g. at home), use 
     143{{{ 
     144publish.user.name=yourpublishusername 
     145}}} 
     146in your ~/hmi.build.properties file.