Re: refactoring

2010-04-19 Thread Stefan Bodewig
On 2010-04-18, Raja Nagendra Kumar nagendra.r...@tejasoft.com wrote:

 There are 4 references to the encoding string ISO-8859-1 in ant
 source code.. may be it is good to introduce a constant..

Good idea, svn revision 935488.

Thanks

Stefan

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Re: Iteration of ant properties in the same natural order

2010-04-19 Thread Stefan Bodewig
On 2010-04-18, Raja Nagendra Kumar nagendra.r...@tejasoft.com wrote:

 Does ant api has any class, which read ant/java properties files and
 allows the iteration in the same order they were present in the
 original file.

None that I was aware of.

 I was looking at org.apache.tools.ant.util.LayoutPreservingProperties
 .. but does not seem to expose

This is true, but is shouldn't be too difficult to expose an iterator
over all Pairs stored in logicalLines (returning Map.Entry instances,
probably) and provide a patch for this.

Stefan

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Re: Ant1.8 copy task gives error Failed to copy with Permission denied

2010-04-19 Thread Stefan Bodewig
On 2010-04-14, SHAILJA shalja.ru...@gmail.com wrote:

 Failed to copy
 /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
 to /u/kumari/main/shailja/bin/share/load_stats.pl due to
 java.io.FileNotFoundException
 /u/kumari/main/shailja/bin/share/load_stats.pl
 (Permission denied)

 this time something is different, the file the exception talks about
 actually is the same as the one the task wants to copy to.  In your
 first post they've been different.

 I am getting this kind of error only in my first post also.

In your initial post it was

,
| Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
| /u/kumari/main/base/bin/share/run_m.pl due to java.io.FileNotFoundException
| /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
`

Different source and target files and in particular the error message
talks about a third file that is different from both the source and the
destination.

 But do you have permissions to write there - and is there enough space?

 Permission on /u/kumari/main/shailja/bin/share directory is
 drwxrwsr-x

Which doesn't mean anything to me since I don't know whether you are the
owner or in the appropriate group 8-)

 df -akh .
   11G   9.7G   1.3G89%

and I don't know how big the file is. 8-)

 Does a simple
 cp
 /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
 /u/kumari/main/shailja/bin/share/

 succeed on the command line?

 Yes it succeeded. Thats why I am not getting the cause of this error.

I'm sorry, I'm running out of ideas myself and honestly it doesn't
really help that the issue seems to be a moving target with every post.

Cheers

Stefan

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Re: [Vote] Augment feature

2010-04-19 Thread Matt Benson
Martijn,
  augment can change properties that are coded as attributes, but
only interacts with nested elements by adding new children to a given
reference.  The task as it stands is extremely, extremely simple.  Any
restrictions we care to impose would complicate it immensely--I would
again urge that we consider addressing this universally for all
attack vectors by creating a task to armor a reference.  In my
copious spare time (ha) I may start a sandbox antlib for that purpose.
 Thanks for not wanting to be a blocker.  :)

-Matt

On 4/18/10, Martijn Kruithof j...@famkruithof.net wrote:
 Hello

 I have quite some difficulties with the discrepancy of the name of the
 task and that what the task is about to do.
 Therefore, using the current name and functionality I would cast a -0,5
 vote, as i do not want to be blocking.
 I can see the desire for a task that changes predeclared id's.

 My objection against the current name comes from the fact that the task
 not only augments (basically adds, increases, stretches, enlarges etc.)
 things but it is used to change the path at will.

 On the other hand I think free modification of references seems like a
 giant pitfall in the following situations:
   - when used in combination with parrallel
   - when related tasks in a script expect the same elements present on
 the path

 If the augment task was used to do only what its name implies (extend)
 and not to reduce less problems could be expected.
 Therefore I would be in favour of an augment feature if it can only be
 used to augment (and not change at will).


 On 14-4-2010 0:34, Bruce Atherton wrote:
 Ok, so this didn't start out as a vote thread, just my suggestion for
 what questions should appear in the vote. But since it has morphed
 into that I've changed the subject line to make it easier for people
 to find. So the questions are:

 1. Are you in favor of adding the augment feature to Ant?

 -0,5 : Non blocking negative look. +1 if augment is only used to augment
 (increase, extend, combine, add to the existing)

 2. Are you in favor of an attribute that allows references to be
 marked as final, to avoid augmentation?

 3. If a final attribute is decided upon, do you think it should
 default to false?

 If you have already voted, no need to recast your vote.


 -
 To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
 For additional commands, e-mail: dev-h...@ant.apache.org



 -
 To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
 For additional commands, e-mail: dev-h...@ant.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Re: Check that path elements exist?

2010-04-19 Thread Jeffrey E Care
Stefan Bodewig bode...@apache.org wrote on 04/15/2010 12:01:56 AM:

 On 2010-04-15, Jeffrey E Care ca...@us.ibm.com wrote:
 
  Before I write my own, if there a way to check that the elements of a 
path
  actually exist (or optionally that at least one exists)?
 
 I assume you mean the pathelement's of a path.  resourcecount,
 restrict and exists are the ingredients that should help.
 
 If you wrap your path in a restrict using exists as selector you
 get only the existing elements.  resourcecount will count them and if
 it is greater than 0 you obviously have at least one - likewise if you
 count the path itself and compare the numbers you'll know whether all
 elements exist.

That worked perfectly, thanks.

And shame on me for posting this to dev instead of user...

Refactoring of ant scripts

2010-04-19 Thread Raja Nagendra Kumar

Hi,

It would be great for experts of ant dev, consider enhancements to ant to
make it refactoring friendly.

Some of the thoughts I have here are

1. All the tasks, which has a reference to path/file should support include
patterns as in fileset.
Such support of patterns would enable script writers to choose not to
have absolute paths.
2. Should support referring of ant files's directory (like ant.this.dir or
ant.this.file)
3. All the tasks which need a root directory, can be configured to take
either basedir (could be the default as it is today) or ant.this.dir.

It would nice to capture much more such needs of writing refactoring
friendly needs from others and give a big push to ant tasks design.


Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
-The Java Code Audit Experts 'We Report, You Decide'
-- 
View this message in context: 
http://old.nabble.com/Refactoring-of-ant-scripts-tp28287801p28287801.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org