----- Original Message -----
From: "Scott Hernandez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2003 7:06 PM
Subject: Re: [nant-dev] new #cvslib binary
> See comment below.
>
> From: "Gert Driesen" <[EMAIL PROTECTED]>
> > > From: "Clayton Harbour" <[EMAIL PROTECTED]>
> [snip]
> > [TaskName("cvscheckout")]
> > [TaskName("cvs-checkout", Obsolete=true, ObsoleteMessage="Use
> <cvscheckout>
> > instead.")]
> > public class CheckoutTask : AbstractCvsTask {
> >
> > What do you think ? Got any other (and better) proposals ?
>
> That is an option but I like the idea of allowing only a single [TaskName]
> attributes on a class. I don't think we allow (or should) a class to
> implement more than one task (name).
Sure, I agree ... just couldn't come up with any better yet ...
>
> >
> > This might appear simple, but it has quite some impact on our
> > attribute-based initialization code and our documentation generation
> process
>
> We could go the route of using a new attribute to mark obsolete tasks. It
> would work something like this:
>
> [TaskName("cvscheckout")]
> [ObsoleteTask("Use <cvscheckout> instead.")]
> public class CheckoutTask : AbstractCvsTask {
> ....
> }
>
I imagine you've forgotten the task name parameter for the ObsoleteTask
attribute, so it should actually look like this :
[TaskName("cvscheckout")]
[ObsoleteTask("cvs-checkout", "Use <cvscheckout> instead.")]
public class CheckoutTask : AbstractCvsTask {
...
}
right ?
> We will probably also want to create corresponding [ObsoleteTaskAttribute]
> and [ObsoleteTaskElement] attributes if we go with this method.
Better name it ObsoleteTaskNameAttribute (what a name :-)) then, as we're
not actually deprecating a task, type or attribute but a specific name with
which its available to build authors ...
A task, type or attribute itself can already be deprecated by assigning a
ObsoleteAttribute to it (although the implementation is not 100% complete
yet).
For example :
[TaskName("asminfo")]
[Obsolete("Use the <xxx> task instead.", true)]
public class AssemblyInfoTask : Task {
...
}
However, I'm talking about deprecating a name of a task/type or attribute
here, not the task/type or attribute itself ...
Using your approach its not possible to deprecate, for example, a collection
element, and also change the name of its child elements.
For example, if you'd like to rename the <attributes> collection node of the
following property to <assemblyattributes>, and also change the name of the
child elements from <attribute> to <
[BuildElementCollection("attributes", "attribute")]
public AssemblyAttributeCollection AssemblyAttributes {
}
this could be achieved using :
[BuildElementCollection("assemblyattributes", "assemblyattribute")]
[BuildElementCollection("attributes", "attribute", Obsolete=true,
ObsoleteMessage="Use <assemblyattributes> instead.")]
public AssemblyAttributeCollection AssemblyAttributes {
}
Using your approach, we'd have to add a new attribute class for every type
of attribute we use right now and I'm not sure I like that ... Although, I
definitely do not like my "proposal" either ...
Gert
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers