[Yanel-dev] Building/Compiling resources more efficiently

Michael Wechner michael.wechner at wyona.com
Mon Sep 22 14:44:41 CEST 2008


Michael Wechner schrieb:
> Alec Bickerton schrieb:
>> Michael Wechner wrote:
>>  
>>> Hi
>>>
>>> Just as a reminder, but also for discussion:
>>>
>>> One can build/compile a resource without having to trigger to whole
>>> build process by using the -f option, for example
>>>
>>> ./build.sh -f
>>> /home/michi/src/wyona/SOME_CUSTOM_PROJECT/res-types/shared/build.xml
>>>
>>> whereas one needs to configure the yanel.source.version within
>>>
>>> res-types/shared/src/build/dependencies.xml
>>>
>>> by setting for example
>>>
>>> <target name="dependencies" description="Dependencies">
>>>    <property name="yanel.source.version" value="1.0-dev-rREVISION"/>
>>>
>>> this makes developing Java classes much faster.
>>>
>>> The problem is a bit that one needs to set this property explicitely 
>>> and
>>> shouldn't leave it there, because in case Yanel source should
>>> change this version number, then old libs will be used or one will
>>> receive a compile error.
>>>
>>> In order to solve this I thought about introducing an environment
>>> variable, for example
>>>
>>> export YANEL_SOURCE_HOME=/home/michi/src/wyona/public/yanel/trunk
>>>
>>> which would allow the build process to check what Yanel source 
>>> version is.
>>>
>>> WDYT?
>>>     
>>
>> Interesting.
>>
>> How about having a build.xml in the realms root directory that simply
>> creates a jar against the libs in a Barebones Yanel. then copies this
>> .jar to the WEB-INF/lib of Yanel.
>>   
>
> this is what some realms already have, for example the "Yanel website" 
> realm
>
> YANEL_HOME/src/realms/yanel-website/build.xml
>
> but again the problem is how does this build file know where 
> YANEL_HOME is  in order to access its properties etc.
>
> I will create a small prototype within a custom realm/resource and 
> test how well this YANEL_HOME env var method works
> and report my findings.

ok, seems to work fine. I had to add the following lines:

<project name="yanel-resource" default="compile">

  <property environment="env"/>
  <echo message="YANEL_HOME is set to = ${env.YANEL_HOME}"/>

  <property file="${env.YANEL_HOME}/src/build/local.build.properties"/>
  <property file="${env.YANEL_HOME}/src/build/build.properties"/>

for making it compile using YANEL_HOME and also a target

  <target name="deploy-lib" depends="compile">
    <property name="build.dir" value="${env.YANEL_HOME}/build"/>
    <copy 
todir="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/lib">
      <fileset dir="build/lib"/>
    </copy>
    <copy 
todir="${tomcat1.home.dir}/webapps/${servlet.context.prefix}/WEB-INF/lib">
<!--
    <copy 
todir="${env.YANEL_HOME}/local/apache-tomcat-${tomcat.version}/webapps/${servlet.context.prefix}/WEB-INF/lib">
-->
      <fileset dir="build/lib"/>
    </copy>
  </target>

for allowing to deploy easily only a specific resource lib

By adding these few lines one can develop much faster.

Cheers

Michael
>
> Cheers
>
> Michael
>> Say realm-[realm-name]-lib.jar for example
>>
>> That would be a step towards easily loadable realms and would speed up
>> development. I personally haven't worked on any Yanel classes as yet,
>> I'm still getting familiar with it.
>>
>> Of course when the .jar changes you need to restart Tomcat. Unless we
>> write a classloader, I don't see any way around that.
>> _______________________________________________
>> Yanel-development mailing list
>> Yanel-development at wyona.com
>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>   
>
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development



More information about the Yanel-development mailing list