Rapid Development of Components

When developing Yanel components, often there is no need to recompile everything once a total build has been done. Examples of components that can be built separately are webapp classes, resource classes and realms.

Efficiently building implementation classes

If you change only classes belonging to the Yanel/Yarep implementations, you can save time by executing the target "install-jars":

{yanel.home}/build.sh install-jars

This will compile the classes and make the jar file. After this, you only need to copy this jar to your Tomcat directory and restart Tomcat/Yanel, e.g.:

~/Wyona/svn-repos/yanel $ copy build/lib/yanel-impl-1.0-dev-rREVISION.jar local/apache-tomcat-7.0.25/webapps/yanel/WEB-INF/lib/

Efficiently building webapp classes

Webapp classes are all classes that are under {yanel.home}/src/webapp/src/java/org/wyona/yanel/servlet. In order to build and test these classes efficiently, one can run:

{yanel.home}/build.sh compile-webapp copy-basic-webapp-libs copy-webapp-files-to-tomcat-cluster-node1

instead of running the whole build process. This will build only the webapp and redeploy it, and should reduce the waiting time from a couple of minutes to a couple of seconds.

Efficiently building resource classes

Resource classes can be found in separate directories at several locations, e.g.:

  • {yanel.home}/src/resources
  • {yanel.home}/src/contributions/resources
  • {yanel.home}/src/realms/welcome-admin/yanel/resources
  • {yanel.home}/src/realms/from-scratch-realm-template/res-types
  • {my.realm}/res-types
  • etc...

These classes all have their own build.xml files, so to compile them efficiently, one can run the build as

{yanel.home}/build.sh -f {path.to.resource.dir}/build.xml

instead of running the whole build process. Again, this will reduce the building time significantly, as only the changed resource will be built.

Efficiently building single realms

In the same way as building resource classes, it is also possible to build single realms after editing classes belonging to that realm:

{yanel.home}/build.sh -f {my.realm}/build.xml

Other time savers

You can also save time by setting ant to be less verbose, and skipping the compilation of the GWT classes:

env ANT_ARGS=-q ./build.sh -Dgwt.compile.skip=foo

 

In order to reload classes and libraries without stop/start Tomcat one can set within local/apache-tomcat-7.0.25/conf/context.xml:

<Context reloadable="true">

 



Your comments are much appreciated

Is the content of this page unclear or you think it could be improved? Please add a comment and we will try to improve it accordingly.