[nant-dev] Formatting, #Regions, and CVS Keywords

2003-03-12 Thread Scott Hernandez



I want to reformat all the filesand do the 
following:

1.) Wrap the license 
info at the top of the filein a #region, which will make editing with 
vs.net (and others I believe). 

2.) Reformat all files removing tabs and following 
the guidelines in the nant coding conventions.(http://sourceforge.net/docman/display_doc.php?docid=6080group_id=31650).

3.) Insert cvs substitutionkeywords that will 
help build ahistory log in each file. (http://www.cvshome.org/docs/manual/cvs_12.html) 
(I will look into making this part of the xml docs for revision 
history.)

So, beforewe go through this work, any one 
have any moreideas? If this doesn't happen now, I would like to see it 
happen before a .9 release.

Is there anything else we should do (other than 
coding, code reviews, testing, and releases :) along these lines? 



[nant-dev] AlTask patch

2003-03-12 Thread Arjen Poutsma
Hi,

When creating satellite assemblies based on .resources files for specific cultures, I 
ran into some problems with the AlTask. The AlTask always embeds resource with a name 
that is equal to the filename of the resource. Visual Studio uses the namespace as a 
prefix for this name. In other words, the AlTask does the following:

al.exe /embed:d:\devel\somepath\Form1.nl-NL.resources [other arguments]

while VS does the following:

al.exe /embed:d:\devel\somepath\Form1.nl-NL.resources,SomeApp.Form1.nl-NL.resources 
[other arguments]

Naturally, this results in resources not being found by the .NET runtime when running 
the resulting app.

To fix this, I added a Prefix property to AlTask.cs which is added to the filename of 
the embedded resource. So, in order to fix the above example, one has to specify the 
prefix SomeApp..  The patch is follows at the end of this message. 

A nicer way to do this is to let AlTask.cs use the ResourceFileSet instead of the 
plain FileSet it uses right now. The ResourceFileSet already has support for prefixes, 
and also has dynamic prefix generation features.

Best,

Arjen

--- AlTask.cs.orig  2003-03-03 20:25:36.0 +0100
+++ AlTask.cs   2003-03-12 11:56:04.0 +0100
@@ -52,6 +52,7 @@
 string _target = null;   
 string _culture = null;
 string _template = null;   
+string _prefix = null;
 FileSet _sources = new FileSet();
 
 /// summaryThe name of the output file for the assembly manifest.
@@ -70,6 +71,12 @@
 /// This attribute corresponds to the c/c[ulture]:/c flag./summary
 [TaskAttribute(culture, Required=false)]
 public string Culture { get { return _culture; } set {_culture = value; } }
+
+/// summaryThe prefix used for embedding resources.
+   /// This prefix can be used for specifying a namespace 
when embedding resources. 
+   /// /summary
+[TaskAttribute(prefix, Required=false)]
+public string Prefix { get { return _prefix; } set {_prefix = value; } }
  
 /// summarySpecifies an assembly from which to get all options except the 
culture field.
 /// The given filename must have a strong name.
@@ -148,8 +155,15 @@
 writer.Write( /template:\{0}\, Template);
 }
 
+bool prefixDefined = _prefix != null;
 foreach (string fileName in Sources.FileNames) {
-writer.Write ( /embed:\{0}\, fileName);
+if (prefixDefined) {
+FileInfo fi = new FileInfo(fileName);
+writer.Write ( /embed:\{0},{1}.{2}\, fileName, 
_prefix, fi.Name);
+} else {
+writer.Write ( /embed:\{0}\, fileName);
+}
+
 }
 // Make sure to close the response file otherwise contents
 // Will not be written to disk and ExecuteTask() will fail.


---
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] Formatting, #Regions, and CVS Keywords

2003-03-12 Thread Ian MacLean
Scott Hernandez wrote:
I want to reformat all the files and do the following:
 
1.) Wrap the license info at the top of the file in a #region, which 
will make editing with vs.net (and others I believe).
+1

2.) Reformat all files removing tabs and following the guidelines in the 
nant coding 
conventions.(http://sourceforge.net/docman/display_doc.php?docid=6080group_id=31650 
http://sourceforge.net/docman/display_doc.php?docid=6080group_id=31650).
I went thru and did this for a bunch of files in the core recently. It 
was mostly pretty good. A lot of the files in the test directories still 
have tabs in them.

3.) Insert cvs substitution keywords that will help build a history log 
in each file. (http://www.cvshome.org/docs/manual/cvs_12.html) (I will 
look into making this part of the xml docs for revision history.)
Can you give an example of what this will look like in a source file. I 
didn't find the reference too clear on that.

So, before we go through this work, any one have any more ideas? If this 
doesn't happen now, I would like to see it happen before a .9 release.
 
Is there anything else we should do (other than coding, code reviews, 
testing, and releases :) along these lines?
I've been going thru making each assembly CLS compliant as per Gerts 
suggestion. Its just a matter of setting the CLSCompliant attribute 
assemblyinfo and then fixing the resulting compiler errors.

Ian



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] Formatting, #Regions, and CVS Keywords

2003-03-12 Thread Matthew Mastracci
For 1 and 2: This is a great idea.  What about having a tool in CVS that
would use the RegEx classes to ensure that the file structure matches
(roughly) the structure we're expecting, ie: replace all tabs w/spaces,
replace all text before the first using keyword with the
#region-wrapped license, etc.

Just a comment about the $Log$ keyword - the CVS in-line version log is
a little bit of a pain to handle sometimes.  I think it would be okay if
wrapped in a #region, but some issues may crop up (especially with
regards to merging/branching).  This page mentions some of the issues
with the $Log$ keyword:

http://developer.apple.com/darwin/tools/cvs/cederquist/cvs_96.html

On Wed, 2003-03-12 at 02:24, Scott Hernandez wrote:
 I want to reformat all the files and do the following:
  
 1.) Wrap the license info at the top of the file in a #region, which
 will make editing with vs.net (and others I believe). 
  
 2.) Reformat all files removing tabs and following the guidelines in
 the nant coding
 conventions.(http://sourceforge.net/docman/display_doc.php?docid=6080group_id=31650).
  
 3.) Insert cvs substitution keywords that will help build a history
 log in each file. (http://www.cvshome.org/docs/manual/cvs_12.html) (I
 will look into making this part of the xml docs for revision history.)
  
 So, before we go through this work, any one have any more ideas? If
 this doesn't happen now, I would like to see it happen before a .9
 release.
  
 Is there anything else we should do (other than coding, code reviews,
 testing, and releases :) along these lines? 
-- 
Matthew Mastracci [EMAIL PROTECTED]


---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] Formatting, #Regions, and CVS Keywords

2003-03-12 Thread Ian MacLean
Matthew Mastracci wrote:

Just a comment about the $Log$ keyword - the CVS in-line version log is
a little bit of a pain to handle sometimes.  I think it would be okay if
wrapped in a #region, but some issues may crop up (especially with
regards to merging/branching).  This page mentions some of the issues
with the $Log$ keyword:
http://developer.apple.com/darwin/tools/cvs/cederquist/cvs_96.html
I have a concern with this too. What do we gain thats not in the logs ? 
The docs imply that its only useful if you move the file out of CVS - 
which we aren't going to do in a hurry I wouldn't have thought. I'd 
prefer not to have that information in the source file if it is already 
stored alsewhere.

Ian



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] Substring?

2003-03-12 Thread Griffin Caprio
So, are you saying that it doesn't exist yet?

I agree that a generic regex task would be much more
useful than a more specific one.  Shall I go ahead and
claim the Regular Expression task?

-Griffin
--- Scott Hernandez [EMAIL PROTECTED] wrote:
 Griffin,
 
 Yep, something like the ant basename or dirname
 task?
 
 http://ant.apache.org/manual/CoreTasks/basename.html
 http://ant.apache.org/manual/CoreTasks/dirname.html
 
 I'd rather see a more generic regex task or
 something that can do
 string/file/dir ops.
 
 - Original Message -
 From: Griffin Caprio [EMAIL PROTECTED]
 
 
  Is there any easy way to get the substring of a
  property?  For example, I an iterating over a
  directory of xml files.  I would like to extract
 the
  filename, without the .xml extension, and use that
 as
  the output of a xslt transformation.  Here is the
  target from my build file:
 
  foreach item=File in=${xml.dir}
  property=filename
 style style=${xsl.dir}/StyleSheet.xsl
  in=${xml.dir}/${filename}.xml
  out=${html.dir}/${filename}.html/
  /foreach
 
  Any way to do this or do I smell a new task coming
 on?
 
 
 

---
 This SF.net email is sponsored by:Crypto Challenge
 is now open! 
 Get cracking and register here for some mind
 boggling fun and 
 the chance of winning an Apple iPod:

http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
 ___
 Nant-developers mailing list
 [EMAIL PROTECTED]

https://lists.sourceforge.net/lists/listinfo/nant-developers


=
Griffin Caprio 
Your child against mine.  The winner
will be hailed, the loser will be booed
until my throat hurts! - Homer Simpson to Marge

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com


---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] Substring?

2003-03-12 Thread Scott Hernandez
Yes, none of the tasks I listed exist in NAnt yet.

Go for it... :)

- Original Message - 
From: Griffin Caprio [EMAIL PROTECTED]


 So, are you saying that it doesn't exist yet?
 
 I agree that a generic regex task would be much more
 useful than a more specific one.  Shall I go ahead and
 claim the Regular Expression task?
 
 -Griffin
 --- Scott Hernandez [EMAIL PROTECTED] wrote:
  Griffin,
  
  Yep, something like the ant basename or dirname
  task?
  
  http://ant.apache.org/manual/CoreTasks/basename.html
  http://ant.apache.org/manual/CoreTasks/dirname.html
  
  I'd rather see a more generic regex task or
  something that can do
  string/file/dir ops.


---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


[nant-dev] tidied up the Wiki FAQ

2003-03-12 Thread Jeff McManus
I just went through and did a bunch of tidying to the FAQ on the Wiki,
mostly correcting spelling, grammar, and formatting errors, and
expanding abbreviations.

I've never used Wiki before, but I think I got it figured out. I hope
so, anyway. Let me know if I bungled anything. Also, if you think there
should be a question in there but don't want to spend the time writing
an answer for it, feel free to stick it in there and I (or somebody
else, I'm sure) can get around to writing up an answer.

Also: it doesn't look like this page
(http://nant.sourceforge.net/changelog.html) is getting updated when a
release happens. I'd be happy to own this job if nobody else wants it.
(Thinking like a product manager, it would probably make the most sense
to announce the release on the home page with the list of new features
there where everybody can see them and get excited about it, that would
relegate changelog.html to more of a history function. Make sense?)

-J.


---
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] Formatting, #Regions, and CVS Keywords

2003-03-12 Thread John Barstow




 
2.) Reformat all files removing tabs and following the guidelines in the 
nant coding conventions.
 
(http://sourceforge.net/docman/display_doc.php?docid=6080group_id=31650).

Whoever is commiting changes may want to run Artistic Style (http://astyle.sourceforge.net/) on the 
source files to enforce code 
formattingconventions.


Re: [nant-dev] Custom validators for enums

2003-03-12 Thread Scott Hernandez
I don't think the result is confusing, but what type of validator would you
want to run? I guess it is possible that a future EnumValidatorAttribute
would limit the enum to only a few values.

Can you describe a usage scenario? (or are you just commenting on how things
should be?)

- Original Message -
From: Gordon Weakliem [EMAIL PROTECTED]

 Looking at SourceForge.NAnt.Element.InitializeAttributes(XmlNode),
attributes backed by a property of type Enum don't have their validators
run.  My thinking is that you might use an existing enum type for
convenience, but you'd want to further restrict the range of values that
could be passed to your task.  Or is that too confusing?



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


Re: [nant-dev] Custom validators for enums

2003-03-12 Thread Gordon Weakliem
This isn't a showstopper, just more of an observation.  I was confused when I wrote a 
custom validator for an enum and was surprised when it didn't get called.  
Specifically, I was looking at demonstrating a custom validator for the tutorial on 
the Wiki (writing a task to manipulate Windows services), and I thought that I could 
use System.ServiceProcess.ServiceControllerStatus to indicate what state you wanted 
the service in after the operation completes.  In this case, the only states that make 
sense are Running, Stopped, and Paused.  I hadn't thought of creating a generic 
validator for any enum type, though that's an interesting idea too.  I could go either 
way, but it should be documented that validators don't get called for enums. 
  
Also, I noticed the code is doing Enum.Parse instead of Convert.ChangeType, even 
though Enums implement IConvertible, and could theoretically use Convert.ChangeType.  
I tried changing Enum.Parse to ChangeType just for grins and got an exception, 
probably doable but requires more research to figure out.  
  
-Original Message- 
  
I don't think the result is confusing, but what type of validator would you 
want to run? I guess it is possible that a future EnumValidatorAttribute 
would limit the enum to only a few values. 
  
Can you describe a usage scenario? (or are you just commenting on how things 
should be?) 
  
- Original Message - 
From: Gordon Weakliem [EMAIL PROTECTED] 
  
 Looking at SourceForge.NAnt.Element.InitializeAttributes(XmlNode), 
attributes backed by a property of type Enum don't have their validators 
run. My thinking is that you might use an existing enum type for 
convenience, but you'd want to further restrict the range of values that 
could be passed to your task. Or is that too confusing? 
  
  
--- 
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod: 
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en 
___ 
Nant-developers mailing list 
[EMAIL PROTECTED] 
https://lists.sourceforge.net/lists/listinfo/nant-developers 


---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers