You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Steinar Overbeck Cook <st...@balder.no> on 2002/05/11 16:46:06 UTC

Ant task for java.util.prefs.Preferences (v1.4)

Thanks a lot for providing Ant! I've been using it a lot and would like to
contribute with a Task I've just written which enables me to manipulate the
system and user preferences managed through the new J2SDK1.4 java.util.prefs
package.

This probably breaks the backwards compatibility, but nevertheless I regard
the new API as important.

Sample:

	<javaprefs node="no/balder/prefs" property="myKey" value="Steinar"
command="put" />
	<javaprefs node="no/balder/prefs" property="myKey" command="get" />
	<javaprefs node="no/balder/prefs" property="myKey" command="remove" />
	<javaprefs node="no/balder/prefs" command="removeNode" />

The above samples uses the System node as the default, this may be changed
thus:

	<javaprefs scope="user" node="no/balder/prefs" property="myKey"
command="get" />

I find this task very usefull and kind of hoped that someone else might find
use for it.

Where do I go from here?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant task for java.util.prefs.Preferences (v1.4)

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Cool.... I don't think there will be a problem with Ant taking on tasks that
are JDK 1.4 specific.  It doesn't break backwards compatibility (meaning
that a build file written for a previous version would not break by adding
the <javaprefs> task).  Submit your task as an enhancement through Bugzilla
and we'll have a look and see about getting it into Ant 1.6.

On a related note, what about an Ant task (or infrastructure) to load Ant
properties from preferences?  Seems like this is a logical extension of our
current property mechanism.  For Ant2 there needs to be a more carefully
thought out integration with properties and preferences so that its more
integrated - in other words I always want my <javac> to compile with
debug="true" - this doesn't need to be explicitly added to <javac>
necessarily and should use my defaults.  I think myrmidon has capabilities
along these lines.  How about mutant?

    Erik


----- Original Message -----
From: "Steinar Overbeck Cook" <st...@balder.no>
To: <an...@jakarta.apache.org>
Sent: Saturday, May 11, 2002 10:46 AM
Subject: Ant task for java.util.prefs.Preferences (v1.4)


>
> Thanks a lot for providing Ant! I've been using it a lot and would like to
> contribute with a Task I've just written which enables me to manipulate
the
> system and user preferences managed through the new J2SDK1.4
java.util.prefs
> package.
>
> This probably breaks the backwards compatibility, but nevertheless I
regard
> the new API as important.
>
> Sample:
>
> <javaprefs node="no/balder/prefs" property="myKey" value="Steinar"
> command="put" />
> <javaprefs node="no/balder/prefs" property="myKey" command="get" />
> <javaprefs node="no/balder/prefs" property="myKey" command="remove" />
> <javaprefs node="no/balder/prefs" command="removeNode" />
>
> The above samples uses the System node as the default, this may be changed
> thus:
>
> <javaprefs scope="user" node="no/balder/prefs" property="myKey"
> command="get" />
>
> I find this task very usefull and kind of hoped that someone else might
find
> use for it.
>
> Where do I go from here?
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>