ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew B. Sudell" <>
Subject Re: task for native2ascii
Date Sun, 17 Sep 2000 01:00:36 GMT
Hiroaki Nakamura writes:
 > Andrew Sudell wrote:
 > > 
 > > Is there any interest in a task do wrap native2ascii?  I've built a
 > > prototype and am more than willing to contribute it if there's
 > > interest.
 > I am very interested.

What I've got is done and working, so I can post that.  But I think
I'd like to resolve the bit about how it works first. 

 > (snip)
 > > Creating a task for every file seems a bit tedious, but off hand
 > > I don't see a good alternative, since to the relationship between
 > > input and output are somewhat arbitrary.
 > I suppose that in most cases of using native2ascii, you don't want
 > mix sources files and destination files in the same directory,  so

Actually in the case I'm supporting that's exactly what is being
done.  There are a set of native encoded ResourceBundles with
"arbitrary extensions" that sort of map to encoding.  The make system
I'm migrating them from translates to .java files in the same

I'm not sure that the smartest thing, but it's what happened.

 > I think it is natural that the native2ascii would be a subclass
 > of MatchingTask and that srcDir and destDir are mandatory attributes.
 > And you can specify source files with the "include" nested tags, or
 > with any other ways built in MatchingTask.
 > About filenames, two cases come to my mind.
 > case 1: Each pair of a source filename and a destination filename
 >         have the same name.
 > case 2: A destination file will be named after a source file
 >         using some naming rules.
 > In case 2, a rule might be replacing some string in a source
 > filename to another string, so the native2ascii can have
 > two optional attributes, "token" and "value" (named after the Replace
 > task).  For example, if you change the destination directory to
 > "foo", Andrew's example will become:
 > <native2ascii encoding="EUCJIS" srcDir="." destDir="foo"
 >     token=".euc" value="" includes="*.euc" />
 > Any other thought?

I sort or like case 1.  Keep the names the same and move directories.
It lets one avoid a lot of tedious small tasks.  Case 2 imposes the
notion that the input and output files have some naming convention,
which isn't really required by the original tool.

I don't think, however, that I should be altering the semantics of
native2ascii as I incorporate it into ant.  I suppose those who object 
to lots of small tasks could resort to a script tag and do the
iteration around the task.  Like as not in most projects the likely
uses will be message catalogs and there ought not be thousands of them 
per language in a given program.  More likely one per language.

I think I'm leaning towards the opinion that ant should respect the
syntax of the tools it provides access to, no matter how inconvenient
they might be.  Does this seem unfair?


        Drew Sudell

View raw message