harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov" <alexei.zakha...@gmail.com>
Subject Re: [classlib]strings externalization
Date Mon, 31 Jul 2006 07:14:43 GMT
Hi Ilya,

> I was trying to implement generation with
> using ant tasks(it seemed to me more elegant solution, than to work with
> file streams in Java code) and found that ant can't work with cycles. I can
> run replace task for certain file name and can't do this with parametrized
> file names for a set of modules

IMHO if you write a standalone tool then pure Java or even
shell-script is probably the better choice (in comparison with ant).
But if you like to incorporate this logic into the current build
system - there is a separate build file for each module as you
probably know. You don't need to parse the list of modules since the
module name is predefined for each build.xml

Regards,

2006/7/28, Ilya Okomin <ilya.okomin@gmail.com>:
> On 7/27/06, Tim Ellison <t.p.ellison@gmail.com> wrote:
>
> > Ilya Okomin wrote:
> > > I share your point of view about Exceptions without description, it
> > > isn't user friendly. But I think it will be another sort of 'manual'
> > > scan :) There is a need to waste time to analyze surrounding code to
> > > provide appropriate message, a bit another sort of work, isn't it? I
> > > think the best way would be if all these Exceptions without info are
> > > being identified before externalization process is to be ran. For
> > > today I'd better postpone the task of initialization 'empty'
> > > exceptions until the externalization is finished.
> >
> > Sure, I agree that it is a different problem, so have no problem dealing
> > with it separately.
> >
> > > I've implemented a small tool that generates Message source and
> > > MsgHelp source into a desired module. Tool gets a list of modules
> > > names from property file (you can specify modules class sources to
> > > generate for), then we run over the list and special word '<module>'
> > > in Message and MsgHelp source templates files replaced with the
> > > specified module name.
> >
> > Cool.  You may find it easy to do this using Ant's replace task [1].
> >
> > [1] http://ant.apache.org/manual/CoreTasks/replace.html
>
>
> Tim, thanks for hint with ant. I was trying to implement generation with
> using ant tasks(it seemed to me more elegant solution, than to work with
> file streams in Java code) and found that ant can't work with cycles. I can
> run replace task for certain file name and can't do this with parametrized
> file names for a set of modules:( There is an extension of ant called
> "Ant-Contrib" [2] where cycles are implemented. Do you know if it can be
> used in Harmony? Or may be there is a possibility to do replace task for a
> set of modules just in pure Ant?
>
> [2] http://ant-contrib.sourceforge.net/
>
>
> Thanks,
> Ilya.
>
>
>
> > > Resulting sources are copied to the o/a/h/<module>/internal/
> > > directory. At first I planned to use MsgHelp class from luni but
> > > after a while I've decided to avoid dependency on luni module and
> > > included generation source file of this class to every module.
> >
> > I agree, if you are going to do the template then you might as well
> > duplicate the MsgHelp behavior across the modules.  In fact, don't feel
> > obliged to maintain the separation of Message and MsgHelp, you may find
> > that it makes sense to combine them now.  Your choice.
> >
> > > Thus Message or MsgHelp source files can be easy regenerated for a
> > > desired set of modules, if anything is changed there. I plan to add
> > > creation of a new empty messages.properties files with copyright
> > > heading if it is absent for the module.
> >
> > Extra credit for that ;-)
> >
> > > Also I think that it make sense to changle location to
> > > o/a/h/<module>/internal/nls.
> >
> > Agreed.
> >
> > > Will provide patch with this tool when these changes are to be
> > > implemented and checked.
> >
> > I'll look forward to seeing it.  Thanks Ilya!
> >
> > Regards,
> > Tim
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> --
> Ilya Okomin
> Intel Middleware Products Division
>
>


-- 
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message