[sip-comm-dev] using external progs (e.g. date and sed) in build.xml


#1

Hello all,

I saw yesterday that we are using in build.xml external programs like date and sed, so I was wondering: wouldn't it be better to use the ant equivalents so that we keep the script as platform independent as possible?

Even though it is impossible not to use externals in some cases, wouldn't it be nice to limit their usage to a minimum?

The ones that got my attention were sed and date. Ant has 2 tasks which I personally find even more convenient than these external programs. Here they are:

Instead of sed we could use the "replace" task:

     <replace file="${src}/felix.properties" token="####" value="word"/>

the above has the same effect as

     sed s/####/word/

you could find more on the task here:

     http://ant.apache.org/manual/CoreTasks/replace.html

Concerning the date task you could replace it with the "tstamp" ant task. For example, simply calling:

     <tstamp/>

would set the DSTAMP, TSTAMP, and TODAY properties with the current date. You could also specify a custom time format like this:

     <tstamp>
         <format property="formatted.time" pattern="yyyy-MM-dd"/>
     </tstamp>

more on this property could be found here:

     http://ant.apache.org/manual/CoreTasks/tstamp.html

WDYT?

Emil

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hello Emil,

Emil Ivov wrote:

Hello all,

I saw yesterday that we are using in build.xml external programs like date and sed, so I was wondering: wouldn't it be better to use the ant equivalents so that we keep the script as platform independent as possible?

Even though it is impossible not to use externals in some cases, wouldn't it be nice to limit their usage to a minimum?

[...]

WDYT?

I think you're entirely right! I commited the modification in the build.xml related to the debian package.

Sorry for the delay :wink:

Martin

···

Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Emil,

Emil Ivov wrote:

I saw yesterday that we are using in build.xml external programs like date and sed, so I was wondering: wouldn't it be better to use the ant equivalents so that we keep the script as platform independent as possible?

You are right, Martin reminded me that (sorry for the delay :stuck_out_tongue: ).
I changed the dependencies to sed using "replace" and "echo" tasks.

the only dependencies remaining is for the DMG generation that needs a specific macosx tool (hdiutil).

···

--
Romain KUNTZ
kuntz@sfc.wide.ad.jp

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Martin, Romain,

Thank you both for your modifications.

Emil

···

On 1/29/07, Romain KUNTZ <kuntz@sfc.wide.ad.jp> wrote:

Hi Emil,

Emil Ivov wrote:
> I saw yesterday that we are using in build.xml external programs like
> date and sed, so I was wondering: wouldn't it be better to use the ant
> equivalents so that we keep the script as platform independent as possible?

You are right, Martin reminded me that (sorry for the delay :stuck_out_tongue: ).
I changed the dependencies to sed using "replace" and "echo" tasks.

the only dependencies remaining is for the DMG generation that needs a
specific macosx tool (hdiutil).

--
Romain KUNTZ
kuntz@sfc.wide.ad.jp

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net