Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Ian MacLean
I'd much prefer to see properties still distinguised by the $. Maybe the 
parser can easily determine that its a property but its not so clear for 
a user reading it. Especially since propertys everywhere else require 
the $ syntax.

Ian

Jaroslaw Kowalski wrote:

It's of course possible to distinguish between "property" and "function()"
within the parser.
The following interpretation of keywords is very easy to implement:

keyword followed by "(" is a function call.
true/false are boolean literals
everything else denotes a property
The following would be allowed then (should it be?):



   

Jarek



---
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
 



--
Ian MacLean, Developer, 
ActiveState, a division of Sophos
http://www.ActiveState.com



---
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


Re: [nant-dev] verbosity of some tasks

2003-12-02 Thread Ian MacLean
Every task should at least output somthing for each unit of work its 
doing - unloess its very fine grained. If it outputs nothing then you 
never see the [taskname] so its hard to know if that task has run at all.
Ian

Hi again (hope last one today)
 
I found verbosity level of many tasks very inconsistent. Maybe we 
could say how much task should output under normal run and other 
messages move into verbose level.
 
for example solution task with only 2 assemblies to compile (without 
warning) outputs:
 
 [solution] Starting solution build.
 [solution] Building Gordic.General [Release]...
Read in 11 resources from 
'c:\temp\build-src\Gordic.Gene
ral\Gordic.General.resx'
Writing resource file...  Done.
 [solution] Building Gordic.Support.Win32 [Release]...
Read in 5 resources from 
'c:\temp\build-src\Gordic.Suppo
rt.Win32\Gordic.Support.Win32.resx'
Writing resource file...  Done.
where plain
 [solution] Building Gordic.General [Release]...
 [solution] Building Gordic.Support.Win32 [Release]...
should be enough.
 
In opposite e.g.
   outputs _nothing_ even when signing over 100 assemblies 
(in verbose mode it outputs 10 lines per assembly)
I think something like copy's [copy] Copying 17 files to 
c:\temp\build-src. should be outputted.
 [delay-sign] 117 assemblies was delay signed.
 
Regards,
Martin






---
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


[nant-dev] Expression Evaluator for NAnt - test1

2003-12-02 Thread Jaroslaw Kowalski

Hi!

Here's the first test release of the expression evaluator I'm developing for
NAnt.
I encourage everyone to try it. I'd like to get as much feedback as possible
on it.

Please report:

1. Does it work for you? Bug reports are welcome.
2. Is it useful?
3. Do you find the syntax simple enough? Are the build files more/less
readable?
4. Does it break your existing build files? (it shouldn't!)
5. What functions/data types/conversions/operators/conversions should be
added/removed?
6. What other features would you like to see?

Pre-compiled binaries along with patches to current CVS code can be found
at:
http://jaak.sav.net/nant-ee/nant-ee-test1.zip

Changes:

* new attribute "test" for  and  which lets you write:

=

...

=

* support for expressions in (hopefully) all places where ${propertyname}
syntax could be used:

=
 
 
=

Jarek

Full list of features:
==

Data types:
integer, double, string, boolean and date

Operators:
and, or, not
=, <>, <, >, <=, >= (because NAnt is XML I'm considering renaming them
to lt, gt, le, ge)
unary minus,
+,-,*,/,%(modulo) with natural precedence, braces (), properties can be
accessed just by providing their name

Functions:
propertyexists(name) - returns true when the property exists, false
otherwise
propertyvalue(name) - returns the value of the named property, fails
when it's not present

Conversion operators:
int(a) - converts a to integer (if possible) and returns the value
double(a) - converts a to double (if possible) and returns the value
string(a) - converts a to string and returns the value
date(a) - converts a to date
bool(a) - converts a to boolean

String functions:

length(a) - returns the length of the string
substring(a,b,c) - equivalent to a.Substring(b,c) in .NET
tolower(s) - returns s converted to lower-case
toupper(s) - returns s converted to upper-case
contains(str,subs) - returns true when subs is a substring of str
indexof(a,b) - equivalent to a.IndexOf(b) in .NET
padleft(a,b,c) - equivalent to a.PadStart(a,b,c) in .NET
padright(a,b,c) - equivalent to a.PadEnd(a,b,c) in .NET
trim(a) - equivalent to a.Trim() in .NET
trimstart(a) - equivalent to a.TrimStart() in .NET
trimend(a) - equivalent to a.TrimEnd() in .NET
startswith(a,b) - equivalent to a.StartsWith(b) in .NET
endswith(a,b) - equivalent to a.EndsWith(b) in .NET

Math functions:

round(v)
floor(v)
ceiling(v)
abs(v)

File functions:

getcreationtime(filename)
getlastwritetime(file)
getlastaccesstime(file)
fileexists(file)
filesize(file)

Date functions:

now()
datediff(d1,d2) - returns date difference in seconds
dateadd(d1,seconds) - returns d1 + seconds

Here are some examples of things that are known to work, taken from my unit
tests:

Assert("1+2", 3);
Assert("1+2+3", 6);
Assert("1+2*3", 7);
Assert("2*1*3", 6);
Assert("1/2+3", 3);
Assert("5.0/(2+8)", 0.5);
Assert("double(5)/(2+8)", 0.5);
Assert("double(1)/2+3", 3.5);
Assert("1", 1);
Assert("1+2", 3);
Assert("1+2)+(2+1", 6);
Assert("1+2)/(2+1", 1);
Assert("length('')", 0);
Assert("length('')=0", true);
Assert("length('')=1", false);
Assert("length('test')", 4);
Assert("length('test')=4", true);
Assert("length('test')=5", false);
Assert("length('d''Artagnan')", 10);
Assert("length('d''Artagnan')=10", true);
Assert("length('d''Artagnan')=11", false);
Assert("-1", -1);
Assert("--1", 1);
Assert("'a' = 'a'", true);
Assert("'a' = 'b'", false);
Assert("'a' <> 'a'", false);
Assert("'a' <> 'b'", true);
Assert("1 = 1", true);
Assert("1 <> 1", false);
Assert("1 = 2", false);
Assert("1 <> 2", true);
Assert("1.0 = 1.0", true);
Assert("1.0 <> 1.0", false);
Assert("1.0 = 2.0", false);
Assert("1.0 <> 2.0", true);
Assert("true", true);
Assert("false", false);
Assert("true==true", true);
Assert("true==false", false);
Assert("true<>false", true);
Assert("true<>true", false);
Assert("!true", false);
Assert("!false", true);
Assert("!(1=1)", false);
Assert("substring('abcde',1,2)='bc'", true);
Assert("trim('  ab  ')='ab'", true);
Assert("trimstart('  ab  ')='ab  '", true);
Assert("trimend('  ab  ')='  ab'", true);
Assert("padleft('ab',5,'.')='...ab'", true);
Assert("padright('ab',5,'.')='ab...'", true);
Assert("indexof('abc','c')=2", true);
Assert("indexof('abc','d')=-1", true);
Assert("indexof('abc','d')=-1", true);
Assert("round(0.1)", 0.0);
Assert("round(0.7)", 1.0);
Assert("floor(0.1)", 0.0);
Assert("floor(0.7)", 0.0);
Assert("ceiling(0.1)", 1.0);
Assert("ceiling(0.7)", 1.0);
Assert("if(true,1,2)", 1);
Assert("if(true,'a','b')", "a");
Assert("if(false,'a','b')", "b");
Assert("abs(1)", 1.0);
Assert("abs(-1)", 1.0);
Assert("fileexists('c:\\notthere.txt')", false

Re: [nant-dev] filesets

2003-12-02 Thread Gert Driesen
For now, I've corrected the documentation, meaning there's no longer any
mention of a comma-separated list of patterns ...

I've merged the fileset documentation available in
http://nant.sourceforge.net/nightly/help/fundamentals/fog26.html
with the fileset type doc
(http://nant.sourceforge.net/nightly/help/types/fileset.html).

The updated documentation should be available online (and in a new nightly
build) later today ...

Gert

- Original Message - 
From: "Martin Aliger" <[EMAIL PROTECTED]>
To: "! nant" <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 3:16 PM
Subject: [nant-dev] filesets


Hi again,

Some time ago I point to this attribute description in docs:
 http://nant.sourceforge.net/nightly/help/fundamentals/fog26.html
  [btw: compare to
http://nant.sourceforge.net/nightly/help/types/fileset.html]


  includes comma-separated list of patterns of files that must be
included; all files are included when omitted. No
  excludes comma-separated list of patterns of files that must be
excluded; no files (except default excludes) are excluded when omitted. No


I like this functionality, but it is currently _not_ supported. Implement
that comma-separared list in quite easy, but it is desired?


If we say not to implement this feature, how to do something like this? :
(i currently use it)






 
  
 


 

 






 

...

first part assemble comma-separated list of assemblies, which have
corresponding .xml and I use that list in includes of ndoc.


Thanks for help in advance,
Martin



---
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


[nant-dev] Re: project references problems in task

2003-12-02 Thread Matthew Mastracci
Sounds good - just make sure you use a separate AppDomain while checking 
for assembly references.  I would also recommend caching lists of 
dependent assemblies based on filename to save time.

Ivan Tarasov wrote:

Hello nant-developers,

  I have quite a big project which uses  task to build
  certain .csproj projects. There is a build directory, some projects
  are built into specific subdirectories of this build directory.
  Consider following dir structure:

  build
  |
  +-ProjectA
  During the build I have some projects built directly into build
  directory. ProjectA is built into the respective folder, but it
  references some dll's in build directory and has CopyLocal set to
  "true" for these references. Thus, as we can expect, these dll's
  are copied to ProjectA directory. The problem is that not only these
  dll's (and the dll's which they reference) are copied to ProjectA,
  but all dll's in build directory!
  Thus, I have lots of dll's in ProjectA which shouldn't be there.
  VS2003 is smart enough to copy only those libraries, which are
  referenced from the project. I've tracked down where the solution
  task does it wrong (in the latest nightly build it is
  Nant\src\NAnt.VSNet\Reference.cs:265-278.
  I've written little program which finds all the referenced assemblies
  in the current folder (for the given assembly) (it was just a
  proof-of-concept). I'm going to add this code to Reference.cs (it
  will add just two methods and a call to one of them instead of
  "Directory.GetFiles(fi.DirectoryName, "*.dll")" in line 265, but I
  need to clean the code up a little bit.
  If anybody can comment upon that change, please let me know.
  I will send the patch here after the clean-up.


---
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


[nant-dev] Re: building nightbuilds

2003-12-02 Thread Matthew Mastracci
What about a  task that sets appropriate properties based on 
provided flags?  This could allow us to hide a number of different tests 
to select appropriate frameworks:









Matt.

Ian MacLean wrote:
Hi Martin,
I've been thinking about adding autodetection of frameworks so that if 
the default doesn't exist then try the one that nant is running with - 
maybe scanning thru the config file to get a match. This issue is 
tripping up a lot of users particularly as more people move to 1.1 only 
systems and we set 1.0 by default.

The same issue occurs on linux with people who have mono installed in 
/usr/bin/ or some location other than /usr/local/bin.

Ian

Martin Aliger wrote:

Framework 'net-1.0' does not exist or is not specified in the NAnt
configuration
file. Defaulting to no known framework.
Buildfile: file:///E:/src/extern/nant/NAnt.build
Target(s) specified: test
BUILD FAILED

aha - i have only net-1.1 installed so i need to edit .config. again -
maybe add some message for newbies? or autodetect it somehow. I'm not 
sure
here...

Regards,
Martin
PS: "tests/NAnt.Core/NAnt.Core.build build" phase is failing for me



---
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
 





---
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


Re[4]: [nant-dev] project references problems in task

2003-12-02 Thread Ivan Tarasov
Hello Martin,

MA> locking problems occurs only to assemblies bigger than 64kB. Do you test it
MA> with larger assemblies?

I do. From VS2003 I have to workaround such problems (by unloading
project which references the locked one), but I don't see why we have
to take it into account -- as far as I reckon, it is only a problem of
VS2003, and not of the framework.

-- 
Best regards,
 Ivanmailto:[EMAIL PROTECTED]



---
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


Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Jaroslaw Kowalski
> > But it may break some build scripts which use "length" and similar
> keywords
> > as property names. What should we do then?
>
> true :-( Looks we couldn't be 100% compatible... Unless expression
generator
> allows to use "length" variable/property and "length()" function in the
same
> time.

It's of course possible to distinguish between "property" and "function()"
within the parser.

The following interpretation of keywords is very easy to implement:

keyword followed by "(" is a function call.
true/false are boolean literals
everything else denotes a property

The following would be allowed then (should it be?):






Jarek



---
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


Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Martin Aliger
> This looks like a good idea. I'll think about it:
>
> We could have:
>
> 
> 
> 
> 
> 
>
> But it may break some build scripts which use "length" and similar
keywords
> as property names. What should we do then?

true :-( Looks we couldn't be 100% compatible... Unless expression generator
allows to use "length" variable/property and "length()" function in the same
time.

> Also, since we use XML, there's a problem with <, <=, >, and >= operators
> which need to be written as < > which isn't very readable. Shouldn't
> we call the operators "lt", "le", "gt", "ge" (less than, less or equal,
> greater than, greater or equal) adding "eq" (for equality) and "ne" (for
> not-equality) ??? Or should we  allow for both forms?

I prefer plan < xml syntax there. You could use other operators without
problem (even >). I was examining xml specs with cdata attributes, but it is
not included in xml (was in sgml i think!)

> This way you could have:
>
> 
>
> Shoud unary boolean negation be "not" or "!"?
> Should binary boolean operators be "and", "or" or "||", "&&" (&&)
in
> XML)

I prefer "and", "or", "not" there. But it is just mine oppinion...


I'm looking forward to expression so much that this small details... :-)
Martin

>
> I'm awaiting your opinions.
>
> Jarek
>
> - Original Message - 
> From: "Martin Aliger" <[EMAIL PROTECTED]>
> To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>; "Ian MacLean"
> <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 02, 2003 3:44 PM
> Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
>
>
> > Sounds good!
> >
> > embedded expression should maybe use ${...} syntax unless we could break
> > some existing buildfiles.
> >
> > how property expansion works together with expressions?
> >
> > e.g.:
> > does  > />work
> > or should I write  ?
> >
> > Maybe, if expressions could use properties directly as variables there
> could
> > be more straightforward
> > %{filelength(filename)} or even with begining ${ to be compatible.
> > ${property} than will be property or expression which is the same in
that
> > case.
> >
> > Martin
> >
> > - Original Message - 
> > From: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
> > To: "Martin Aliger" <[EMAIL PROTECTED]>; "Ian MacLean"
> > <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Tuesday, December 02, 2003 3:27 PM
> > Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
> >
> >
> > > It's not in yet, but I'm working on adding this to NAnt (startswith
and
> > > endswith will be there, too). Some preliminary version should be
> available
> > > before this weekend in a separate branch of NAnt.
> > >
> > > Expression evaluation will be supported in almost all places where you
> can
> > > specify in NAnt. So instead of:
> > >
> > > 
> > >
> > > you will be able to write:
> > >
> > > 
> > >
> > > This will work in for all attributes where non-string values are
> expected
> > > (if, timeout, unless, failonerror, verbose, and all task-specific
> > attributes
> > > like debug,optimize,etc.).
> > >
> > > For strings, I'm planning to provide embedded expressions, like:
> > >
> > > 
> > >
> > > What do you think?
> > >
> > > Jarek
> > >
> > > - Original Message - 
> > > From: "Martin Aliger" <[EMAIL PROTECTED]>
> > > To: "Ian MacLean" <[EMAIL PROTECTED]>; "Jaroslaw Kowalski"
> > > <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, December 02, 2003 2:26 PM
> > > Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
> > >
> > >
> > > > Great! Superb! Maybe I'd love to see startwith and endwith string
> > > functions
> > > > in addition, but great start as Ian said :)
> > > >
> > > > Is it in already?
> > > >
> > > > I tried: [with nant-20031128]
> > > >   
> > > >   
> > > >   
> > > > ...
> > > >
> > > > and no luck :( :
> > > >
> > > > BUILD FAILED
> > > >
> > > > C:\temp\server\GINIS.NET.build(84,5):
> > > >[if]  at least one if condition must be set (propertytrue,
> > > > targetexists, etc...):
> > > >
> > > > Total time: 0.6 seconds.
> > > >
> > > > Martin
> > > >
> > > > - Original Message - 
> > > > From: "Ian MacLean" <[EMAIL PROTECTED]>
> > > > To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
> > > > Cc: <[EMAIL PROTECTED]>
> > > > Sent: Friday, November 21, 2003 7:14 AM
> > > > Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
> > > >
> > > >
> > > > > Jaroslaw,
> > > > > Awesome ! Checking it out now. Obviously this is another thing to
go
> > in
> > > > > post 0.84 but this looks like a great start.
> > > > > Thanks !
> > > > >
> > > > > Ian
> > > > >
> > > > > >Hi!
> > > > > >
> > > > > >As I've promised some time ago on the list, I've implemented a
> > simple,
> > > > yet
> > > > > >very powerful, expression evaluator for NAnt. See below for a
full
> > list
> > > > of
> > > > > >features.
> > > > > >You can now write quite sophisticated expressions, like:
> > > > > >
> > > > > >
> > > > > >...
> > > > > >
> > > > > >
> > > >

[nant-dev] verbosity of some tasks

2003-12-02 Thread Martin Aliger



Hi again (hope last one today)
 
I found verbosity level of many tasks very 
inconsistent. Maybe we could say how much task should output under normal run 
and other messages move into verbose level.
 
for example solution task with only 2 assemblies to 
compile (without warning) outputs:
 
 [solution] Starting solution 
build. [solution] Building Gordic.General 
[Release]...    
Read in 11 resources from 
'c:\temp\build-src\Gordic.General\Gordic.General.resx'    
Writing resource file...  Done. [solution] Building 
Gordic.Support.Win32 
[Release]...    
Read in 5 resources from 
'c:\temp\build-src\Gordic.Support.Win32\Gordic.Support.Win32.resx'    
Writing resource file...  Done.
where plain
 [solution] Building 
Gordic.General [Release]... [solution] Building Gordic.Support.Win32 
[Release]...

should be enough.
 
In opposite e.g.
   outputs _nothing_ even when signing over 100 assemblies (in verbose 
mode it outputs 10 lines per assembly)I think something like 
copy's [copy] Copying 17 files to 
c:\temp\build-src. should be 
outputted.

 [delay-sign] 117 
assemblies was delay signed.
 
Regards,
Martin


Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Jaroslaw Kowalski
This looks like a good idea. I'll think about it:

We could have:







But it may break some build scripts which use "length" and similar keywords
as property names. What should we do then?

Also, since we use XML, there's a problem with <, <=, >, and >= operators
which need to be written as < > which isn't very readable. Shouldn't
we call the operators "lt", "le", "gt", "ge" (less than, less or equal,
greater than, greater or equal) adding "eq" (for equality) and "ne" (for
not-equality) ??? Or should we  allow for both forms?

This way you could have:



Shoud unary boolean negation be "not" or "!"?
Should binary boolean operators be "and", "or" or "||", "&&" (&&) in
XML)

I'm awaiting your opinions.

Jarek

- Original Message - 
From: "Martin Aliger" <[EMAIL PROTECTED]>
To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>; "Ian MacLean"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 3:44 PM
Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt


> Sounds good!
>
> embedded expression should maybe use ${...} syntax unless we could break
> some existing buildfiles.
>
> how property expansion works together with expressions?
>
> e.g.:
> does  />work
> or should I write  ?
>
> Maybe, if expressions could use properties directly as variables there
could
> be more straightforward
> %{filelength(filename)} or even with begining ${ to be compatible.
> ${property} than will be property or expression which is the same in that
> case.
>
> Martin
>
> - Original Message - 
> From: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
> To: "Martin Aliger" <[EMAIL PROTECTED]>; "Ian MacLean"
> <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 02, 2003 3:27 PM
> Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
>
>
> > It's not in yet, but I'm working on adding this to NAnt (startswith and
> > endswith will be there, too). Some preliminary version should be
available
> > before this weekend in a separate branch of NAnt.
> >
> > Expression evaluation will be supported in almost all places where you
can
> > specify in NAnt. So instead of:
> >
> > 
> >
> > you will be able to write:
> >
> > 
> >
> > This will work in for all attributes where non-string values are
expected
> > (if, timeout, unless, failonerror, verbose, and all task-specific
> attributes
> > like debug,optimize,etc.).
> >
> > For strings, I'm planning to provide embedded expressions, like:
> >
> > 
> >
> > What do you think?
> >
> > Jarek
> >
> > - Original Message - 
> > From: "Martin Aliger" <[EMAIL PROTECTED]>
> > To: "Ian MacLean" <[EMAIL PROTECTED]>; "Jaroslaw Kowalski"
> > <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Tuesday, December 02, 2003 2:26 PM
> > Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
> >
> >
> > > Great! Superb! Maybe I'd love to see startwith and endwith string
> > functions
> > > in addition, but great start as Ian said :)
> > >
> > > Is it in already?
> > >
> > > I tried: [with nant-20031128]
> > >   
> > >   
> > >   
> > > ...
> > >
> > > and no luck :( :
> > >
> > > BUILD FAILED
> > >
> > > C:\temp\server\GINIS.NET.build(84,5):
> > >[if]  at least one if condition must be set (propertytrue,
> > > targetexists, etc...):
> > >
> > > Total time: 0.6 seconds.
> > >
> > > Martin
> > >
> > > - Original Message - 
> > > From: "Ian MacLean" <[EMAIL PROTECTED]>
> > > To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Friday, November 21, 2003 7:14 AM
> > > Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
> > >
> > >
> > > > Jaroslaw,
> > > > Awesome ! Checking it out now. Obviously this is another thing to go
> in
> > > > post 0.84 but this looks like a great start.
> > > > Thanks !
> > > >
> > > > Ian
> > > >
> > > > >Hi!
> > > > >
> > > > >As I've promised some time ago on the list, I've implemented a
> simple,
> > > yet
> > > > >very powerful, expression evaluator for NAnt. See below for a full
> list
> > > of
> > > > >features.
> > > > >You can now write quite sophisticated expressions, like:
> > > > >
> > > > >
> > > > >...
> > > > >
> > > > >
> > > > >I've added my parser to "NAnt.Core.ExpressionEval" namespace and
I've
> > > > >modified
> > > > > and  tasks to support a new attribute called "test"
> (named
> > > after
> > > > >XSLT ;-)
> > > > >
> > > > >It's ultra-easy to add new functions. You simply add new public C#
> > > function
> > > > >in "NAnt/Core/ExpressionEval/ExpressionEvaluator.cs" and it works!
> > > > >
> > > > >The code should be considered alpha-quality, but should work in
most
> > > cases.
> > > > >I've taken some well-tested parts from another project of mine, yet
> > some
> > > > >parts are new and they may not work correctly in 100% cases.
> > > > >
> > > > >Can someone please take a look at this patch and commit to CVS if
> it's
> > > ok?
> > > > >
> > > > >Jarek
> > > > >
> > > > >P.S. No NUnit-style unit tests yet, but I'm wo

Re: [nant-dev] building nightbuilds

2003-12-02 Thread Ian MacLean
Hi Martin,
I've been thinking about adding autodetection of frameworks so that if 
the default doesn't exist then try the one that nant is running with - 
maybe scanning thru the config file to get a match. This issue is 
tripping up a lot of users particularly as more people move to 1.1 only 
systems and we set 1.0 by default.

The same issue occurs on linux with people who have mono installed in 
/usr/bin/ or some location other than /usr/local/bin.

Ian

Martin Aliger wrote:

Framework 'net-1.0' does not exist or is not specified in the NAnt
configuration
file. Defaulting to no known framework.
Buildfile: file:///E:/src/extern/nant/NAnt.build
Target(s) specified: test
BUILD FAILED

aha - i have only net-1.1 installed so i need to edit .config. again -
maybe add some message for newbies? or autodetect it somehow. I'm not sure
here...
Regards,
Martin
PS: "tests/NAnt.Core/NAnt.Core.build build" phase is failing for me



---
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
 



--
Ian MacLean, Developer, 
ActiveState, a division of Sophos
http://www.ActiveState.com



---
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


Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Martin Aliger
Sounds good!

embedded expression should maybe use ${...} syntax unless we could break
some existing buildfiles.

how property expansion works together with expressions?

e.g.:
does work
or should I write  ?

Maybe, if expressions could use properties directly as variables there could
be more straightforward
%{filelength(filename)} or even with begining ${ to be compatible.
${property} than will be property or expression which is the same in that
case.

Martin

- Original Message - 
From: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
To: "Martin Aliger" <[EMAIL PROTECTED]>; "Ian MacLean"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 3:27 PM
Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt


> It's not in yet, but I'm working on adding this to NAnt (startswith and
> endswith will be there, too). Some preliminary version should be available
> before this weekend in a separate branch of NAnt.
>
> Expression evaluation will be supported in almost all places where you can
> specify in NAnt. So instead of:
>
> 
>
> you will be able to write:
>
> 
>
> This will work in for all attributes where non-string values are expected
> (if, timeout, unless, failonerror, verbose, and all task-specific
attributes
> like debug,optimize,etc.).
>
> For strings, I'm planning to provide embedded expressions, like:
>
> 
>
> What do you think?
>
> Jarek
>
> - Original Message - 
> From: "Martin Aliger" <[EMAIL PROTECTED]>
> To: "Ian MacLean" <[EMAIL PROTECTED]>; "Jaroslaw Kowalski"
> <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 02, 2003 2:26 PM
> Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
>
>
> > Great! Superb! Maybe I'd love to see startwith and endwith string
> functions
> > in addition, but great start as Ian said :)
> >
> > Is it in already?
> >
> > I tried: [with nant-20031128]
> >   
> >   
> >   
> > ...
> >
> > and no luck :( :
> >
> > BUILD FAILED
> >
> > C:\temp\server\GINIS.NET.build(84,5):
> >[if]  at least one if condition must be set (propertytrue,
> > targetexists, etc...):
> >
> > Total time: 0.6 seconds.
> >
> > Martin
> >
> > - Original Message - 
> > From: "Ian MacLean" <[EMAIL PROTECTED]>
> > To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, November 21, 2003 7:14 AM
> > Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
> >
> >
> > > Jaroslaw,
> > > Awesome ! Checking it out now. Obviously this is another thing to go
in
> > > post 0.84 but this looks like a great start.
> > > Thanks !
> > >
> > > Ian
> > >
> > > >Hi!
> > > >
> > > >As I've promised some time ago on the list, I've implemented a
simple,
> > yet
> > > >very powerful, expression evaluator for NAnt. See below for a full
list
> > of
> > > >features.
> > > >You can now write quite sophisticated expressions, like:
> > > >
> > > >
> > > >...
> > > >
> > > >
> > > >I've added my parser to "NAnt.Core.ExpressionEval" namespace and I've
> > > >modified
> > > > and  tasks to support a new attribute called "test"
(named
> > after
> > > >XSLT ;-)
> > > >
> > > >It's ultra-easy to add new functions. You simply add new public C#
> > function
> > > >in "NAnt/Core/ExpressionEval/ExpressionEvaluator.cs" and it works!
> > > >
> > > >The code should be considered alpha-quality, but should work in most
> > cases.
> > > >I've taken some well-tested parts from another project of mine, yet
> some
> > > >parts are new and they may not work correctly in 100% cases.
> > > >
> > > >Can someone please take a look at this patch and commit to CVS if
it's
> > ok?
> > > >
> > > >Jarek
> > > >
> > > >P.S. No NUnit-style unit tests yet, but I'm working on them.
> > > >
> > > >Full list of features:
> > > >==
> > > >
> > > >Data types:
> > > >integer, double, string, boolean and date
> > > >
> > > >Operators:
> > > >and, or, not
> > > >=, <>, <, >, <=, >= (because NAnt is XML I'm considering renaming
> > them
> > > >to lt, gt, le, ge)
> > > >unary minus,
> > > >+,-,*,/,%(modulo) with natural precedence, braces (), property
> > access:
> > > >${propertyname}
> > > >
> > > >Functions:
> > > >propertyexists(name) - returns true when the property exists,
false
> > > >otherwise
> > > >propertyvalue(name) - returns the value of the named property,
> fails
> > > >when it's not present
> > > >
> > > >Conversion operators:
> > > >int(a) - converts a to integer (if possible) and returns the
value
> > > >double(a) - converts a to double (if possible) and returns the
> value
> > > >string(a) - converts a to string and returns the value
> > > >date(a) - converts a to date
> > > >
> > > >String functions:
> > > >
> > > >length(a) - returns the length of the string
> > > >substring(a,b,c) - equivalent to a.Substring(b,c) in .NET
> > > >tolower(s) - returns s converted to lower-case
> > > >toupper(s) - returns s converted to upper-case
> > > >

Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Jaroslaw Kowalski
It's not in yet, but I'm working on adding this to NAnt (startswith and
endswith will be there, too). Some preliminary version should be available
before this weekend in a separate branch of NAnt.

Expression evaluation will be supported in almost all places where you can
specify in NAnt. So instead of:



you will be able to write:



This will work in for all attributes where non-string values are expected
(if, timeout, unless, failonerror, verbose, and all task-specific attributes
like debug,optimize,etc.).

For strings, I'm planning to provide embedded expressions, like:



What do you think?

Jarek

- Original Message - 
From: "Martin Aliger" <[EMAIL PROTECTED]>
To: "Ian MacLean" <[EMAIL PROTECTED]>; "Jaroslaw Kowalski"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 2:26 PM
Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt


> Great! Superb! Maybe I'd love to see startwith and endwith string
functions
> in addition, but great start as Ian said :)
>
> Is it in already?
>
> I tried: [with nant-20031128]
>   
>   
>   
> ...
>
> and no luck :( :
>
> BUILD FAILED
>
> C:\temp\server\GINIS.NET.build(84,5):
>[if]  at least one if condition must be set (propertytrue,
> targetexists, etc...):
>
> Total time: 0.6 seconds.
>
> Martin
>
> - Original Message - 
> From: "Ian MacLean" <[EMAIL PROTECTED]>
> To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, November 21, 2003 7:14 AM
> Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
>
>
> > Jaroslaw,
> > Awesome ! Checking it out now. Obviously this is another thing to go in
> > post 0.84 but this looks like a great start.
> > Thanks !
> >
> > Ian
> >
> > >Hi!
> > >
> > >As I've promised some time ago on the list, I've implemented a simple,
> yet
> > >very powerful, expression evaluator for NAnt. See below for a full list
> of
> > >features.
> > >You can now write quite sophisticated expressions, like:
> > >
> > >
> > >...
> > >
> > >
> > >I've added my parser to "NAnt.Core.ExpressionEval" namespace and I've
> > >modified
> > > and  tasks to support a new attribute called "test" (named
> after
> > >XSLT ;-)
> > >
> > >It's ultra-easy to add new functions. You simply add new public C#
> function
> > >in "NAnt/Core/ExpressionEval/ExpressionEvaluator.cs" and it works!
> > >
> > >The code should be considered alpha-quality, but should work in most
> cases.
> > >I've taken some well-tested parts from another project of mine, yet
some
> > >parts are new and they may not work correctly in 100% cases.
> > >
> > >Can someone please take a look at this patch and commit to CVS if it's
> ok?
> > >
> > >Jarek
> > >
> > >P.S. No NUnit-style unit tests yet, but I'm working on them.
> > >
> > >Full list of features:
> > >==
> > >
> > >Data types:
> > >integer, double, string, boolean and date
> > >
> > >Operators:
> > >and, or, not
> > >=, <>, <, >, <=, >= (because NAnt is XML I'm considering renaming
> them
> > >to lt, gt, le, ge)
> > >unary minus,
> > >+,-,*,/,%(modulo) with natural precedence, braces (), property
> access:
> > >${propertyname}
> > >
> > >Functions:
> > >propertyexists(name) - returns true when the property exists, false
> > >otherwise
> > >propertyvalue(name) - returns the value of the named property,
fails
> > >when it's not present
> > >
> > >Conversion operators:
> > >int(a) - converts a to integer (if possible) and returns the value
> > >double(a) - converts a to double (if possible) and returns the
value
> > >string(a) - converts a to string and returns the value
> > >date(a) - converts a to date
> > >
> > >String functions:
> > >
> > >length(a) - returns the length of the string
> > >substring(a,b,c) - equivalent to a.Substring(b,c) in .NET
> > >tolower(s) - returns s converted to lower-case
> > >toupper(s) - returns s converted to upper-case
> > >contains(str,subs) - returns true when subs is a substring of str
> > >indexof(a,b) - equivalent to a.IndexOf(b) in .NET
> > >padleft(a,b,c) - equivalent to a.PadStart(a,b,c) in .NET
> > >padright(a,b,c) - equivalent to a.PadEnd(a,b,c) in .NET
> > >trim(a) - equivalent to a.Trim() in .NET
> > >trimstart(a) - equivalent to a.TrimStart() in .NET
> > >trimend(a) - equivalent to a.TrimEnd() in .NET
> > >
> > >Math functions:
> > >
> > >round(v)
> > >floor(v)
> > >ceiling(v)
> > >abs(v)
> > >
> > >File functions:
> > >
> > >getcreationtime(filename)
> > >getlastwritetime(file)
> > >getlastaccesstime(file)
> > >fileexists(file)
> > >filesize(file)
> > >
> > >Date functions:
> > >
> > >now()
> > >datediff(d1,d2) - returns date difference in seconds
> > >dateadd(d1,seconds) - returns d1 + seconds
> > >
> > >Here are some examples of things that are known to work, taken from my
> unit
> > >tests:
> > >
> > >Assert("1+2", 3);
> > >Assert("1+2+3"

[nant-dev] filesets

2003-12-02 Thread Martin Aliger



Hi again,
 
Some time ago I point to this attribute 
description in docs:
 http://nant.sourceforge.net/nightly/help/fundamentals/fog26.html


  
  

  [btw: compare to http://nant.sourceforge.net/nightly/help/types/fileset.html]
   




  
  
includes
comma-separated list of patterns of files that must 
  be included; all files are included when omitted.
No
  
excludes
comma-separated list of patterns of files that must 
  be excluded; no files (except default excludes) are excluded when 
omitted.
No
 
I like this functionality, but it is currently 
_not_ supported. Implement that comma-separared list in quite easy, but it is 
desired?
 
 
If we say not to implement this feature, how to do 
something like this? :  (i currently use it)
 
  
 
 ...
 
first part assemble comma-separated list of 
assemblies, which have corresponding .xml and I use that list in includes of 
ndoc.
 
 
Thanks for help in advance,
Martin


Re: Re[2]: [nant-dev] project references problems in task

2003-12-02 Thread Martin Aliger
Hi,

locking problems occurs only to assemblies bigger than 64kB. Do you test it
with larger assemblies?

here is some link to microsoft support:
http://support.microsoft.com/default.aspx?scid=kb;en-us;313512

Martin

- Original Message - 
From: "Ivan Tarasov" <[EMAIL PROTECTED]>
To: "Martin Aliger" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 12:39 PM
Subject: Re[2]: [nant-dev] project references problems in  task


> Hello Martin,
>
> MA> you are right - this is problem in current setup. I was also point to
that,
> MA> but there are some problems how to find references to assembly without
lock
> MA> them. Current framework sometimes locks assemblies when you load them
(even
> MA> into another appdomain). VS2003 has also problem with it [cannot copy
> MA> because another process use this file error]
>
> MA> If you have some another method how to find those references, send it
here!
> MA> [possible also as path to reference.cs]
>
> Thanks for the quick response, I didn't know about that problem with
> framework. I'm not sure if it is really a problem, since in almost all
> cases assemblies should not be written to more than once (I mean their
> creation time).
>
> In VS2003 I've had some locking problems when using my GUI component
> located in another project and this project was in current solution
> and the main project depended on it. In that case, the GUI component
> needs to be built first, but when it is being copied to the directory
> to which main project references, it fails. After some investigation I
> understood that Windows.Forms designer locks the .dll, thus I have to
> unload project which uses the component before building it. Probably,
> this is the case you are describing (or some variation of it).
>
> So, here is the patch. I'm quite new to .NET (3 months of experience
> in it), and I still cannot find needed classes which I want to use.
> So, please excuse me for using linear search in ArrayList instead of
> using some kind of "set" class (as it could do in C++).
>
> I've tested it on my projects and it worked (and I've still had no
> problems with locking), so I'm pretty sure it is better than copying
> all the files from the given directory.
>
> --- Patch to Reference.cs, from nightly build (28.11.03) ---
> 23a24
> > using System.Collections;
> 265c266
> < foreach (string referenceFile in
Directory.GetFiles(fi.DirectoryName, "*.dll")) {
> ---
> > foreach (string referenceFile in
GetAllReferencedModules(_referenceFile)) {
> 283d283
> <
> 309a310,336
> >
> > private string[] GetAllReferencedModules(string module) {
> > string fullPathToModule = Path.GetFullPath(module);
> > string moduleDirectory =
Path.GetDirectoryName(fullPathToModule);
> >
> > ArrayList referenceList = new ArrayList();
> > referenceList.Add(fullPathToModule);
> >
> > for (int currentModule = 0; currentModule <
referenceList.Count; currentModule++) {
> >
AppendReferencedModulesLocatedInGivenDirectory(moduleDirectory, (string)
referenceList[currentModule], referenceList);
> > }
> >
> > return (string[]) referenceList.ToArray(typeof(string));
> > }
> >
> > private void
AppendReferencedModulesLocatedInGivenDirectory(string moduleDirectory,
> >
string moduleName, ArrayList referenceList) {
> > Assembly module = Assembly.LoadFrom(moduleName);
> > AssemblyName[] referencedAssemblies =
module.GetReferencedAssemblies();
> >
> > foreach (AssemblyName referencedAssemblyName in
referencedAssemblies) {
> > string fullPathToReferencedAssembly =
string.Format(@"{0}\{1}.dll", moduleDirectory, referencedAssemblyName.Name);
> > // we only add referenced assemblies which are located
in given directory
> > if (File.Exists(fullPathToReferencedAssembly) &&
!referenceList.Contains(fullPathToReferencedAssembly))
> > referenceList.Add(fullPathToReferencedAssembly);
> > }
> > }
>  End of Patch  -
>
> -- 
> Best regards,
>  Ivanmailto:[EMAIL PROTECTED]
>
>
>
> ---
> 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
>



---
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:

Re: [nant-dev] PATCH: Expression evaluator for NAnt

2003-12-02 Thread Martin Aliger
Great! Superb! Maybe I'd love to see startwith and endwith string functions
in addition, but great start as Ian said :)

Is it in already?

I tried: [with nant-20031128]
  
  
  
...

and no luck :( :

BUILD FAILED

C:\temp\server\GINIS.NET.build(84,5):
   [if]  at least one if condition must be set (propertytrue,
targetexists, etc...):

Total time: 0.6 seconds.

Martin

- Original Message - 
From: "Ian MacLean" <[EMAIL PROTECTED]>
To: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 21, 2003 7:14 AM
Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt


> Jaroslaw,
> Awesome ! Checking it out now. Obviously this is another thing to go in
> post 0.84 but this looks like a great start.
> Thanks !
>
> Ian
>
> >Hi!
> >
> >As I've promised some time ago on the list, I've implemented a simple,
yet
> >very powerful, expression evaluator for NAnt. See below for a full list
of
> >features.
> >You can now write quite sophisticated expressions, like:
> >
> >
> >...
> >
> >
> >I've added my parser to "NAnt.Core.ExpressionEval" namespace and I've
> >modified
> > and  tasks to support a new attribute called "test" (named
after
> >XSLT ;-)
> >
> >It's ultra-easy to add new functions. You simply add new public C#
function
> >in "NAnt/Core/ExpressionEval/ExpressionEvaluator.cs" and it works!
> >
> >The code should be considered alpha-quality, but should work in most
cases.
> >I've taken some well-tested parts from another project of mine, yet some
> >parts are new and they may not work correctly in 100% cases.
> >
> >Can someone please take a look at this patch and commit to CVS if it's
ok?
> >
> >Jarek
> >
> >P.S. No NUnit-style unit tests yet, but I'm working on them.
> >
> >Full list of features:
> >==
> >
> >Data types:
> >integer, double, string, boolean and date
> >
> >Operators:
> >and, or, not
> >=, <>, <, >, <=, >= (because NAnt is XML I'm considering renaming
them
> >to lt, gt, le, ge)
> >unary minus,
> >+,-,*,/,%(modulo) with natural precedence, braces (), property
access:
> >${propertyname}
> >
> >Functions:
> >propertyexists(name) - returns true when the property exists, false
> >otherwise
> >propertyvalue(name) - returns the value of the named property, fails
> >when it's not present
> >
> >Conversion operators:
> >int(a) - converts a to integer (if possible) and returns the value
> >double(a) - converts a to double (if possible) and returns the value
> >string(a) - converts a to string and returns the value
> >date(a) - converts a to date
> >
> >String functions:
> >
> >length(a) - returns the length of the string
> >substring(a,b,c) - equivalent to a.Substring(b,c) in .NET
> >tolower(s) - returns s converted to lower-case
> >toupper(s) - returns s converted to upper-case
> >contains(str,subs) - returns true when subs is a substring of str
> >indexof(a,b) - equivalent to a.IndexOf(b) in .NET
> >padleft(a,b,c) - equivalent to a.PadStart(a,b,c) in .NET
> >padright(a,b,c) - equivalent to a.PadEnd(a,b,c) in .NET
> >trim(a) - equivalent to a.Trim() in .NET
> >trimstart(a) - equivalent to a.TrimStart() in .NET
> >trimend(a) - equivalent to a.TrimEnd() in .NET
> >
> >Math functions:
> >
> >round(v)
> >floor(v)
> >ceiling(v)
> >abs(v)
> >
> >File functions:
> >
> >getcreationtime(filename)
> >getlastwritetime(file)
> >getlastaccesstime(file)
> >fileexists(file)
> >filesize(file)
> >
> >Date functions:
> >
> >now()
> >datediff(d1,d2) - returns date difference in seconds
> >dateadd(d1,seconds) - returns d1 + seconds
> >
> >Here are some examples of things that are known to work, taken from my
unit
> >tests:
> >
> >Assert("1+2", 3);
> >Assert("1+2+3", 6);
> >Assert("1+2*3", 7);
> >Assert("2*1*3", 6);
> >Assert("1/2+3", 3);
> >Assert("5.0/(2+8)", 0.5);
> >Assert("double(5)/(2+8)", 0.5);
> >Assert("double(1)/2+3", 3.5);
> >Assert("1", 1);
> >Assert("1+2", 3);
> >Assert("1+2)+(2+1", 6);
> >Assert("1+2)/(2+1", 1);
> >Assert("length('')", 0);
> >Assert("length('')=0", true);
> >Assert("length('')=1", false);
> >Assert("length('test')", 4);
> >Assert("length('test')=4", true);
> >Assert("length('test')=5", false);
> >Assert("length('d''Artagnan')", 10);
> >Assert("length('d''Artagnan')=10", true);
> >Assert("length('d''Artagnan')=11", false);
> >Assert("-1", -1);
> >Assert("--1", 1);
> >Assert("'a' = 'a'", true);
> >Assert("'a' = 'b'", false);
> >Assert("'a' <> 'a'", false);
> >Assert("'a' <> 'b'", true);
> >Assert("1 = 1", true);
> >Assert("1 <> 1", false);
> >Assert("1 = 2", false);
> >Assert("1 <> 2", true);
> >Assert("1.0 = 1.0", true);
> >Assert("1.0 <> 1.0", false);
> >Assert("1.0 = 2.0", false);
> >Assert("1.0 <> 2.0", true);
> >Assert("true", true);
> >Assert("false", false);
> >Assert("true==true", true);
> >Assert("true==false", false);
> >Assert("true<>fal

[nant-dev] building nightbuilds

2003-12-02 Thread Martin Aliger
Hi all,

I was quite long away from nant development so I downloaded newest available
nightbuild. But build it from that zip is not so straightforward as it
should be (i'm ok, but new users?)

running build with 0.8.3 distribution version:

E:\src\extern\nant>"E:\Program Files\NANT\bin\NAnt.exe"
NAnt version 0.8.3 Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///E:/src/extern/nant/NAnt.build
Total time: 0 seconds.

BUILD FAILED

what about to add some check to required nant version into buildfile? and
write more informing message then.


running it as it is from downloaded bin directory:
---
E:\src\extern\nant>E:\src\extern\nant\bin\NAnt.exe
NAnt version 0.8.4.0 Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net

Framework 'net-1.0' does not exist or is not specified in the NAnt
configuration
 file. Defaulting to no known framework.
Buildfile: file:///E:/src/extern/nant/NAnt.build
Target(s) specified: test

BUILD FAILED

aha - i have only net-1.1 installed so i need to edit .config. again -
maybe add some message for newbies? or autodetect it somehow. I'm not sure
here...

Regards,
Martin

PS: "tests/NAnt.Core/NAnt.Core.build build" phase is failing for me



---
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


Re[2]: [nant-dev] project references problems in task

2003-12-02 Thread Ivan Tarasov
Hello Martin,

MA> you are right - this is problem in current setup. I was also point to that,
MA> but there are some problems how to find references to assembly without lock
MA> them. Current framework sometimes locks assemblies when you load them (even
MA> into another appdomain). VS2003 has also problem with it [cannot copy
MA> because another process use this file error]

MA> If you have some another method how to find those references, send it here!
MA> [possible also as path to reference.cs]

Thanks for the quick response, I didn't know about that problem with
framework. I'm not sure if it is really a problem, since in almost all
cases assemblies should not be written to more than once (I mean their
creation time).

In VS2003 I've had some locking problems when using my GUI component
located in another project and this project was in current solution
and the main project depended on it. In that case, the GUI component
needs to be built first, but when it is being copied to the directory
to which main project references, it fails. After some investigation I
understood that Windows.Forms designer locks the .dll, thus I have to
unload project which uses the component before building it. Probably,
this is the case you are describing (or some variation of it).

So, here is the patch. I'm quite new to .NET (3 months of experience
in it), and I still cannot find needed classes which I want to use.
So, please excuse me for using linear search in ArrayList instead of
using some kind of "set" class (as it could do in C++).

I've tested it on my projects and it worked (and I've still had no
problems with locking), so I'm pretty sure it is better than copying
all the files from the given directory.

--- Patch to Reference.cs, from nightly build (28.11.03) ---
23a24
> using System.Collections;
265c266
< foreach (string referenceFile in Directory.GetFiles(fi.DirectoryName, 
"*.dll")) {
---
> foreach (string referenceFile in 
> GetAllReferencedModules(_referenceFile)) {
283d283
< 
309a310,336
> 
> private string[] GetAllReferencedModules(string module) {
> string fullPathToModule = Path.GetFullPath(module);
> string moduleDirectory = Path.GetDirectoryName(fullPathToModule);
> 
> ArrayList referenceList = new ArrayList();
> referenceList.Add(fullPathToModule);
> 
> for (int currentModule = 0; currentModule < referenceList.Count; 
> currentModule++) {
> AppendReferencedModulesLocatedInGivenDirectory(moduleDirectory, 
> (string) referenceList[currentModule], referenceList);
> }
> 
> return (string[]) referenceList.ToArray(typeof(string));
> }
> 
> private void AppendReferencedModulesLocatedInGivenDirectory(string 
> moduleDirectory,
> string 
> moduleName, ArrayList referenceList) {
> Assembly module = Assembly.LoadFrom(moduleName);
> AssemblyName[] referencedAssemblies = module.GetReferencedAssemblies();
> 
> foreach (AssemblyName referencedAssemblyName in referencedAssemblies) {
> string fullPathToReferencedAssembly = string.Format(@"{0}\{1}.dll", 
> moduleDirectory, referencedAssemblyName.Name);
> // we only add referenced assemblies which are located in given 
> directory
> if (File.Exists(fullPathToReferencedAssembly) && 
> !referenceList.Contains(fullPathToReferencedAssembly))
> referenceList.Add(fullPathToReferencedAssembly);
> }
> }
 End of Patch  -

-- 
Best regards,
 Ivanmailto:[EMAIL PROTECTED]



---
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


Re: [nant-dev] project references problems in task

2003-12-02 Thread Martin Aliger
Hello,

you are right - this is problem in current setup. I was also point to that,
but there are some problems how to find references to assembly without lock
them. Current framework sometimes locks assemblies when you load them (even
into another appdomain). VS2003 has also problem with it [cannot copy
because another process use this file error]

If you have some another method how to find those references, send it here!
[possible also as path to reference.cs]

Regards,
Martin

- Original Message - 
From: "Ivan Tarasov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 11:25 AM
Subject: [nant-dev] project references problems in  task


> Hello nant-developers,
>
>   I have quite a big project which uses  task to build
>   certain .csproj projects. There is a build directory, some projects
>   are built into specific subdirectories of this build directory.
>
>   Consider following dir structure:
>
>   build
>   |
>   +-ProjectA
>
>   During the build I have some projects built directly into build
>   directory. ProjectA is built into the respective folder, but it
>   references some dll's in build directory and has CopyLocal set to
>   "true" for these references. Thus, as we can expect, these dll's
>   are copied to ProjectA directory. The problem is that not only these
>   dll's (and the dll's which they reference) are copied to ProjectA,
>   but all dll's in build directory!
>   Thus, I have lots of dll's in ProjectA which shouldn't be there.
>
>   VS2003 is smart enough to copy only those libraries, which are
>   referenced from the project. I've tracked down where the solution
>   task does it wrong (in the latest nightly build it is
>   Nant\src\NAnt.VSNet\Reference.cs:265-278.
>
>   I've written little program which finds all the referenced assemblies
>   in the current folder (for the given assembly) (it was just a
>   proof-of-concept). I'm going to add this code to Reference.cs (it
>   will add just two methods and a call to one of them instead of
>   "Directory.GetFiles(fi.DirectoryName, "*.dll")" in line 265, but I
>   need to clean the code up a little bit.
>
>   If anybody can comment upon that change, please let me know.
>   I will send the patch here after the clean-up.
>
> -- 
> Best regards,
>  Ivan  mailto:[EMAIL PROTECTED]
>
> * To err is human.  To really foul up you need a computer.
>
>
>
> ---
> 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
>



---
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


[nant-dev] project references problems in task

2003-12-02 Thread Ivan Tarasov
Hello nant-developers,

  I have quite a big project which uses  task to build
  certain .csproj projects. There is a build directory, some projects
  are built into specific subdirectories of this build directory.

  Consider following dir structure:

  build
  |
  +-ProjectA

  During the build I have some projects built directly into build
  directory. ProjectA is built into the respective folder, but it
  references some dll's in build directory and has CopyLocal set to
  "true" for these references. Thus, as we can expect, these dll's
  are copied to ProjectA directory. The problem is that not only these
  dll's (and the dll's which they reference) are copied to ProjectA,
  but all dll's in build directory!
  Thus, I have lots of dll's in ProjectA which shouldn't be there.

  VS2003 is smart enough to copy only those libraries, which are
  referenced from the project. I've tracked down where the solution
  task does it wrong (in the latest nightly build it is
  Nant\src\NAnt.VSNet\Reference.cs:265-278.

  I've written little program which finds all the referenced assemblies
  in the current folder (for the given assembly) (it was just a
  proof-of-concept). I'm going to add this code to Reference.cs (it
  will add just two methods and a call to one of them instead of
  "Directory.GetFiles(fi.DirectoryName, "*.dll")" in line 265, but I
  need to clean the code up a little bit.

  If anybody can comment upon that change, please let me know.
  I will send the patch here after the clean-up.

-- 
Best regards,
 Ivan  mailto:[EMAIL PROTECTED]

* To err is human.  To really foul up you need a computer.



---
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