RE: [nant-dev] ResourceUtil rewind

2005-03-02 Thread Greco Giuseppe

 
 Greco Giuseppe wrote:
 
 what's about something like that? Giving the following resource files
 
   Global.resx
   Another.resx
   ... .resx
   
 
 we could have a separate resource manager for each resource file,
   
 
 This means storing *all* the resources in a single assembly
 
 I don't quite understand how your implementation is supposed to work. 
 The static constructor will only be called once so:
 
   static ResourceUtils() {
 Assembly assembly = Assembly.GetCallingAssembly();
 Global = new 
 ResourceManager(assembly.GetName().Name + GlobalResx, assembly);
 Another = new 
 ResourceManager(assembly.GetName().Name + AnotherResx, assembly);
 ...
 
 }
 
 will only allow the loading of resources whatever the calling 
 assembly is at type initialization time ( probably 
 NAnt.Core.dll ? ). This means that we would have to store 
 *all* resources for *all* asemblies in NAnt.Core. I thought 
 we agreed that it would be better to have each assembly store 
 its own localised resources ?
 

No, that was just a way to have more than one *.resx file per
assembly.

 
 solving also the problem with VS.NET:
 
   
 
 it has no bearing on the vs.net problem. That issue only 
 related to the 
 naming of the embedded resource structure - so Another.resx 
 still maps 
 to defaultnamespace.Another.resource in the final assembly ( when 
 built by vs.net ).
 

Exactly, meaning that in the example above we would have something
like

MyNamespace.Global.resource
MyNamespace.Another.resoruce
...

 
 
 I think that a variation on your register assemblies proposal 
 could work 
 well and be more flexible going forward:
 
 public sealed class ResourceUtils {
 private static ResourceManager _sharedResourceManager;
 private static Hashtable _resourceManagerDictionary = new 
 Hashtable();

 ...
 ...
 private static void RegisterAssembly(Assembly assembly) {
 lock (_resourceManagerDictionary) {
 
 _resourceManagerDictionary.Add(assembly.GetName().Name,
 new 
 ResourceManager(assembly.GetName().Name, assembly));
 }  
 }
 private static void RegisterSharedAssembly(Assembly assembly) {
 lock (_sharedResourceManager) {
 _sharedResourceManager = new 
 ResourceManager(assembly.GetName().Name, assembly);
 }
 }
 

I think the RegisterSharedAssembly() method is not necessary; we could
just always use the RegisterAssembly() method (adding also the shared
resource manager to the hashtable).

In any case the problem related to the naming of the embedded resource
structure
still remains... In the code above you assume this name always
corresponds to
the assembly name... but it does not (e.g.
MyNamespace.Another.resources).

  public static string GetString(string name, CultureInfo culture)  {
 string localizedString = null;
 ResourceManager resourceManager = null;
 Assembly assembly = Assembly.GetCallingAssembly();

 if ( ! 
 _resourceManagerDictionary.Contains(assembly.GetName().Name ) ) {
 lock (_resourceManagerDictionary) {
 RegisterAssembly(assembly);
 }
 }
 // get the required Manager
 resourceManager = 
 _resourceManagerDictionary[assembly.GetName().Name] as 
 ResourceManager;
 localizedString = resourceManager.GetString(name, 
 culture);

 // try the shared resources if we didn't find it in the 
 specific resource manager
 if ( localizedString == null  _sharedResourceManager != 
 null) {
 return _sharedResourceManager.GetString(name, 
 culture);
 }

 return localizedString;
 }
 
 }
 
 Since there are only 2 cases.
 - load resource from the current assembly
 - load the resource from the shared resource assembly
 
 and somewhere in NAnt startup sequence we'd call:
 
 ResourceUtils:RegisterSharedAssembly( Assembly.LoadFrom( 
 NAnt.SharedResources.dll ) );

ResourceUtils.RegisterAssembly(Assembly.LoadFrom(NAnt.SharedResources.d
ll));
would be enought... isn't it?

j3d.

 
 
 Ian
 


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered

[nant-dev] ResourceUtil rewind

2005-03-01 Thread Greco Giuseppe
Hi Ian,

what's about something like that? Giving the following
resource files

  Global.resx
  Another.resx
  ... .resx

we could have a separate resource manager for each resource file,
solving also the problem with VS.NET:

using System.Reflection;
using System.Resources;
using System.Globalization;

namespace NAnt.Core.Util
{
/// summary
/// Provides resource support to NAnt assemblies. This class cannot
be inherited.
/// /summary
internal sealed class ResourceUtils {
#region public fields
public static readonly ResourceManager Global;
pubilc static readonly ResourceManager Another;
...
#endregion public fields

#region private fields
private const string GlobalResx = .Global;
private const string AnotherResx = .Another;
...
#endregion private fields

#region private constructors
static ResourceUtils() {
Assembly assembly = Assembly.GetCallingAssembly();
Global = new ResourceManager(assembly.GetName().Name +
GlobalResx, assembly);
Another = new ResourceManager(assembly.GetName().Name +
AnotherResx, assembly);
...
}

private ResourceUtils() {}
#endregion private constructors
}
}

To get localized strings, one should write something like this:

string str1 = ResourceUtils.Global(NA1001_AnErrorMessage);
string str2 = ResourceUtils.Another(AnotherString);
string str3 = ...

What do you think about?
j3d.

Giuseppe Greco
Software Architect

Banca del Gottardo
via Trevano 2A
6901 Lugano
Swizterland

Phone: +41 91 808 16 79
Fax: +41 91 808 24 00
Web: www.gottardo.com


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


[nant-dev] ResourceUtils

2005-02-21 Thread Greco Giuseppe
Hi Ian,

I think it would be preferable to have a common
resource assembly (e.g. NAnt.Resources.dll).

Letting an assembly access resources of another
assembly and viceversa is not that elegant. Moreover,
it would be difficult to maintain messages consistently.

There are also performance issues; actually, the code
for getting a localized string is as following:

public static string GetString(string name, CultureInfo culture)
{
  if (resourceManager == null) {
lock (typeof(ResourceUtils)) {
  if (resourceManager == null) {
Assembly assembly = Assembly.GetCallingAssembly();
resourceManager = new ResourceManager(
  assembly.GetName().Name, assembly);
  }
}
  }

  return resourceManager.GetString(name, culture);
}

In the code above, the lock takes place only once (the first
time a string is retrieved), assuring good performance.

Adding the functionality to register additional assemblies,
the lock would take place always as demonstrated in the following
code chunk:

static ResourceUtils()
{
  resourceManagerDictionary = new ResourceManagerDictionary();
}

public static void RegisterAssembly(Assembly assembly)
{
  lock (resourceManagerDictionary) {
resourceManagerDictionary.Add(assembly.GetName().Name,
  new ResourceManager(assembly.GetName().Name, assembly))
  }
}

public static string GetString(string name, CultureInfo culture)
{
  string localizedString = null;
  ResourceManager resourceManager = null;

  lock (resourceManagerDictionary) {
foreach (DictionaryEntry entry in resourceManagerDictionary) {
  resourceManager = entry.Value as ResourceManager;
  localizedString = resourceManager.GetString(name, culture);

  if (localizedString != null) {
break;
  }
}
  }

  return localizedString;
}

The methods RegisterAssembly() and GetString() must be kept
synchronized...

What do you think about?

Giuseppe Greco
Software Architect

Banca del Gottardo
via Trevano 2A
6901 Lugano
Swizterland

Phone: +41 91 808 16 79
Fax: +41 91 808 24 00
Web: www.gottardo.com


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N - resx files

2005-02-17 Thread Greco Giuseppe

 How about somthing like 'NA1001' for errors and warnings.
 
   !--Build Error Strings --
   data name=NA1001
 valueCould not find a '{0}' file in '{1}'/value
 commentSome descriptive comment/comment
   /data

What about this? Could be a valid alternative?

Error messages:

  data name=Error_FileNotFound
valueCould not find a '{0}' file in '{1}'/value
commentSome descriptive comment/comment
  /data

or

  data name=E1001_FileNotFound
valueCould not find a '{0}' file in '{1}'/value
commentSome descriptive comment/comment
  /data

Warning messages:

  data name=Warning_Message
valueMessage text./value
commentSome descriptive comment/comment
  /data

or

  data name=W1001_Message
valueMessage text./value
commentSome descriptive comment/comment
  /data

Informational messages:

  data name=Info_Message
valueMessage text./value
commentSome descriptive comment/comment
  /data

or

  data name=I1001_Message
valueMessage text./value
commentSome descriptive comment/comment
  /data

 which would then produce the following output :
 ---
 
 BUILD FAILED
 
 Error: NA1001: Could not find a '*.build' file in 
 'C:\ianm\dev\test\csharp'
 
 For more information regarding the cause of the build 
 failure, run the 
 build again in debug mode.
 
 
 ---
 
 For other messages ( non error ) I don't know - is there a 
 standard way 
 of naming thems ?

For strings that are *NOT* messages I would say something like

  data name=String_WelcomeMessage
valueWelcome to NAnt!/value
commentSome descriptive comment/comment
  /data

or

  data name=S1001_WelcomeMessage
valueWelcome to NAnt!/value
commentSome descriptive comment/comment
  /data

 
 While we are doing this I'd like to collate a list of the 
 NAxxx ones so 
 that we can add a list of NAnt error messages to the documentation..
 
 2. Decide who does what
   
 
 Why don't we pick a couple of assemblies each and work through them ?
 

Ok, just let me know what assemblies you are working on. I'll start with
a small one: NAnt.DotNet.

 3. Fill the RESX skeletons
 
 4. Replace hardcoded string with ResourceUtils.GetString(string_id)
 
 5. Update the build files
   
 
 That will just be a case of adding the extra resources 
 child elements. 
 I'll do that today.

Ok,
j3d.

 
 
 ---
 SF email is sponsored by - The IT Product Guide
 Read honest  candid reviews on hundreds of IT Products from 
 real users. Discover which products truly live up to the 
 hype. Start reading now. 
 http://ads.osdn.com/?ad_id=6595alloc_id=14396 op=click
 
 ___
 
 nant-developers mailing list nant-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nant-developers
 


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N - resx files

2005-02-17 Thread Greco Giuseppe
 Hmm - well I'd like the keep the number in there - for 
 errors/warnings 
 at least. It will make finding the use of a given error 
 message easier 
 later on.

Okay, but tell me which one of the following formats:

  data name=NA1001
valueCould not find a '{0}' file in '{1}'/value
commentSome descriptive comment/comment
  /data

or

  !-- Error messages --
  data name=E1001
...
  /data

  !-- Warning messages --
  data name=W1001
...
  /data

  !-- Informational messages --
  data name=I1001
...
  /data

  !-- General strings --
  data name=S1001
...
  /data

Take your time to think about the best solution; if we later decide to
change that, it will be quite expensive...

j3d.


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N

2005-02-15 Thread Greco Giuseppe
Hi Ian,

 looks like the xmldoc attribute you mention in a later email 
 is the way 
 to get around this. We would invoke ndoc once for each 
 translated language.

Exactly...

 although we should be able to knock up a script to generate 
 stubs based 
 on the original english doc.
 

Of course...

 A thought I've had recently is that it could be cool to hack nDoc to 
 accept the monodoc xml format as input. There is no reason it 
 shouldn't 
 be possible as its functionally equivalent to the ms/ndoc format. The 
 advantage then is that there are some nice tools for editing 
 monodoc and 
 we would get the ability to view the nant help in the monodoc 
 gui. I'm 
 not sure if the monodoc gui is functional on win32 yet but I 
 think its 
 being worked on.

Mono source code does not contain documentation comments; XML stubs
are generated via reflection with assembler.exe/updater.exe. Miguel
told me that they want to keep user documentation separated from
source code, meaning the /doc feature of the C# compiler is useless...

MonoDoc generates a separate XML file for each *.cs file, while the
C# compiler just put all togheter in a single file. The main
disadvantage of the Mono approach is productivity. I honestly feel
more productive if I write the [english] SDK documentation while
coding, but the way MonoDoc works if more elegant.

I think we should take the best from the two world and finally
offer the killer application for generating SDK documentation.

 
 of course - quite apart from the documentation there is the 
 process of 
 making internal strings load from a resource file rather than being 
 hard-coded to english as they are now.
 

Attached to this email you'll find the RM.cs file, which implements
the localization mechanism. Here below is how to use it:

Old messages (as it is now):

  Console.Error.WriteLine(Invalid framework '{0}' specified., 
   cmdlineOptions.TargetFramework);

New messages:

  Console.Error.WriteLine(RM.GetString(Error_InvalidFramework), 
  cmdlineOptions.TargetFramework);

You need a copy of RM.cs for each assembly and you should set the
private field AssemblyName to the name of the current assembly.

Let me know if is OK.
j3d.

 
 Ian
 
 -
 Giuseppe Greco
 
 ::agamura::
 
 phone:  +41 (0)91 604 67 65
 mobile: +41 (0)79 602 99 27
 email:  [EMAIL PROTECTED]
 web:www.agamura.com
 
 
 
 ---
 SF email is sponsored by - The IT Product Guide
 Read honest  candid reviews on hundreds of IT Products from real 
 users. Discover which products truly live up to the hype. 
 Start reading 
 now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
 ___
 nant-developers mailing list nant-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nant-developers
   
 
 
 
 ---
 SF email is sponsored by - The IT Product Guide
 Read honest  candid reviews on hundreds of IT Products from 
 real users. Discover which products truly live up to the 
 hype. Start reading now. 
 http://ads.osdn.com/?ad_id=6595alloc_id=14396 op=click
 
 ___
 
 nant-developers mailing list nant-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nant-developers
 


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


RM.cs
Description: RM.cs


RE: [nant-dev] ndoc task

2005-02-15 Thread Greco Giuseppe
Ian,

 sounds like a good idea. Why don't you log a bug for it ?

Done.
j3d.

 
 
 -- DISCLAIMER 
 --
 This message (including any attachments) is confidential and may be
 privileged. If you have received it by mistake please notify 
 the sender
 by return e-mail and delete this message from your 
 system.Any unauthorised
 use or dissemination of this message in whole or in part is strictly
 prohibited. Please note that e-mails are susceptible to change.
 Banca del Gottardo (including its group companies) shall not 
 be liable for
 the improper or incomplete transmission of the information 
 contained in this
 communication nor for any delay in its receipt or damage to 
 your system.
 Under no circumstances this message can be considered as a 
 written acceptance
 or confirmation of an instruction/order given to Banca del Gottardo. 
 Instructions and orders cannot be accepted or confirmed via e-mail.
 Banca del Gottardo (or its group companies) does not 
 guarantee that the integrity
 of this communication has been maintained nor that this 
 communication is free of
 viruses, interceptions or interference.
 -
 
 
 
 ---
 SF email is sponsored by - The IT Product Guide
 Read honest  candid reviews on hundreds of IT Products from real 
 users. Discover which products truly live up to the hype. 
 Start reading 
 now. http://ads.osdn.com/?ad_ide95alloc_id396op=click
 ___
 nant-developers mailing list nant-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nant-developers
   
 
 


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N

2005-02-15 Thread Greco Giuseppe
Ian,

 looks ok - but why not get AssemblyName dynamically using :
 Assembly.GetCallingAssembly()  ?
 
 then you only need to define the RM class once in NAnt.Core.
 

It depends if you plan to create separate resource files for the
different NAnt assemblies. Furthermore, it depends also if you want
to embed the default resources (en-US) in the NAnt assemblies
themselves and then produce satelite assemblies (resource-only) for
additional translations only.

The AssemblyName field contains the root name of the resources
(e.g. MyResource.en-US.resources - MyResource), which is required
by the ResourceManager constructor; I think we should rename it to
BaseName.

j3d.


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N

2005-02-15 Thread Greco Giuseppe
Ian,

 looks ok - but why not get AssemblyName dynamically using :
 Assembly.GetCallingAssembly()  ?
 
 then you only need to define the RM class once in NAnt.Core.

You're right... attached to this email you'll find a better
version of RM.cs (RM stands for [R]esource[M]anager).

Let me know if it is Okay,
j3d.


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


RM.cs
Description: RM.cs


RE: [nant-dev] L16N

2005-02-15 Thread Greco Giuseppe
Ian,

 You're right... attached to this email you'll find a better 
 version of 
 RM.cs (RM stands for [R]esource[M]anager).
 
   
 
 I figured that one out :). We could probably call it 
 NAnt.Core.ResourceUtils or somthing like that.

That's up to you... but such a name is a little bit too long and
uncomfortable to be used often...

Furthermore a class name should be singular and represent just
an entity (Array, Window, Button, etc.).

 
 Let me know if it is Okay,
   
 
 Looks good. I'll start going thru the errors in NAnt.Core and 
 factoring 
 them into a resource file. I might look at defining error codes and 
 documenting them at the same time.

The first step would be to create the resource files
(NAnt.Core.en-US.resx,
NAnt.DotNet.Task.en-US.resx, etc.), then replace hardcoded strings with
RM.GetString(Message_Id) - or whatever name you want, and finally add
the following target into the different NAnt build files:

  target
name=build-resources
depends=init
description=Builds resource binaries
foreach
  item=String
  in=de-DE,en-US,es-ES,fr-FR,it-IT
  delim=,
  property=culture
  mkdir
dir=${build.dir}/${package.name}/lib/${culture}
failonerror=false /
  resgen
input=${assembly}.${culture}.resx
 
output=${build.dir}/${package.name}/lib/${culture}/${assembly}.${cultur
e}.resources /
/foreach
  /target

You should also modify the build target in order to let the C#
compiler
embed the default resource (en-US) in the NAnt assemblies (for other
languages
we generate satelite assemblies):

  target
name=build
depends=init build-resources
description=Builds the binaries for the current configuration
...
property
  name=default.resources
  value=en-US/${assembly}.en-US.resources,${assembly}.resources /
foreach
  item=String
  in=de-DE,es-ES,fr-FR,it-IT
  delim=,
  property=culture
  al
target=library
 
output=${build.dir}/${package.name}/lib/${culture}/${assembly}.resource
s.dll
culture=${culture}
sources basedir=${build.dir}/${package.name}/lib/${culture}
  include name=*.resources /
/sources
  /al
/foreach
csc ...
  ...
  arg
value=-res:${build.dir}/${package.name}/lib/${default.resources} /
/csc
  /target

If you want I can help you... just let's coordinate. Have you already
run sed to extract all the hardcoded string from the code?

j3d.

 
 Ian
 
 
 ---
 SF email is sponsored by - The IT Product Guide
 Read honest  candid reviews on hundreds of IT Products from 
 real users. Discover which products truly live up to the 
 hype. Start reading now. 
 http://ads.osdn.com/?ad_id=6595alloc_id=14396 op=click
 
 ___
 
 nant-developers mailing list nant-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nant-developers
 


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N

2005-02-15 Thread Greco Giuseppe
Ian,

I'm at work too... so I cannot start right now...

j3d.

 -Original Message-
 From: Ian MacLean [mailto:[EMAIL PROTECTED] 
 Sent: mercoledì, 16 febbraio 2005 08:40
 To: Greco Giuseppe
 Cc: nant-developers@lists.sourceforge.net
 Subject: Re: [nant-dev] L16N
 
 
 
 The first step would be to create the resource files 
 (NAnt.Core.en-US.resx, NAnt.DotNet.Task.en-US.resx, etc.),
 
 we can just start with NAnt.Core.resx for the default ( US english ) 
 language.
 
  then replace hardcoded strings with
 RM.GetString(Message_Id) - or whatever name you want, and 
 finally add 
 the following target into the different NAnt build files:
 
   target
 name=build-resources
 depends=init
 description=Builds resource binaries
 foreach
   item=String
   in=de-DE,en-US,es-ES,fr-FR,it-IT
   delim=,
   property=culture
   mkdir
 dir=${build.dir}/${package.name}/lib/${culture}
 failonerror=false /
   resgen
 input=${assembly}.${culture}.resx
  
 output=${build.dir}/${package.name}/lib/${culture}/${assembl
 y}.${cultu
 r
 e}.resources /
 /foreach
   /target
 
 You should also modify the build target in order to let the C# 
 compiler embed the default resource (en-US) in the NAnt 
 assemblies (for 
 other languages
 we generate satelite assemblies):
 
   target
 name=build
 depends=init build-resources
 description=Builds the binaries for the current configuration
 ...
 property
   name=default.resources
   
 value=en-US/${assembly}.en-US.resources,${assembly}.resources /
 foreach
   item=String
   in=de-DE,es-ES,fr-FR,it-IT
   delim=,
   property=culture
   al
 target=library
  
 output=${build.dir}/${package.name}/lib/${culture}/${assembl
 y}.resourc
 e
 s.dll
 culture=${culture}
 sources 
 basedir=${build.dir}/${package.name}/lib/${culture}
   include name=*.resources /
 /sources
   /al
 /foreach
 csc ...
   ...
   arg
 value=-res:${build.dir}/${package.name}/lib/${default.resources} /
 /csc
   
 
 we can use the resources child element for this - thats 
 what its for 
 :). You can even add the resx files ( even the international 
 ones ) to 
 that and the csc task will do the right thing - ie create child 
 directories for each culture and run the al task.
 
   /target
 
 If you want I can help you... just let's coordinate. Have 
 you already 
 run sed to extract all the hardcoded string from the code?
 
   
 
 Sure - thanks. I haven't got the NAnt source with me right 
 now ( at work 
 ) so no I haven't run sed. If you'd like to start on that - 
 by all means 
 go ahead.
 
 Ian
 
 


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


RE: [nant-dev] L16N

2005-02-15 Thread Greco Giuseppe
 
 csc ...
 ...
 resources   
 include name=*.resx/
 /resources
 /csc
 
 will work just fine.
 

Just a question: does the resource element automatically
embed the defalut resources into the assembly, or is the
arg element still necessary?

  csc ...
arg
 
value=-res:${build.dir}/${package.name}/lib/${default.resources} /
  /csc

j3d.



-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


[nant-dev] ndoc task

2005-02-14 Thread Greco Giuseppe
Hi all,

Why doesn't the ndoc task support the NDoc argument xmldoc
(see http://ndoc.sourceforge.net/usersguide.html)?

NAnt assumes that XML files generated by the C# compiler are
always located in the same directory as the compiled assemblies.

Don't you think that we should add the xmldoc element to the
ndoc task? That would also help when localizing SDK documentation.

What do you think about?
j3d.


-- DISCLAIMER --
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo. 
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the 
integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
-


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers


[nant-dev] Fileset references

2003-06-17 Thread Greco Giuseppe
Title: Fileset references





Hi all,


does anybody know how far is the implementation of
fileset refereces?


(see www.mail-archive.com/[EMAIL PROTECTED]/msg01418.html
for more info)


Gius_.


Giuseppe Greco
T-Systems CS AG
Birkenstrasse 21
8306 Brüttisellen


Phone: +41 (0) 1 805 57 20
Fax: +41 (0) 1 805 55 45
Email: [EMAIL PROTECTED]
Web: www.t-systems.ch





[nant-dev] install target

2003-06-10 Thread Greco Giuseppe
Title: install target





Hi all,


It would be nice to have an install target in
NAnt.build, so one could just type 'nant install'
or 'nant linux install' to install NAnt.


Here's my proposal:


1. Create a new install.config property set to win32 by default
 property name=install.config value=win32 / !-- win32|linux --


2. Create a named configurations
 target name=init-install
 description=Initializes intallation properties
 call target=${install.config}/
 /target


 target name=win32
 description=Configures a win32 install
 property name=install.config value=win32/
 property name=install.dir value=${sys.env.ProgramFiles}/
 /target


 target name=linux
 description=Configures a web install
 property name=install.config value=linux/
 property name=install.dir value=/usr/local/
 /target


3. Create the install and uninstall targets
 target name=install depends=init-install build sdk-doc
 description=Installs the current configuration
 mkdir dir=${install.dir} failonerror=false/
 copy todir=${install.dir} overwrite=true
 fileset basedir=${build.dir}
 includes name=**/
 excludes name=**/*.xml/
 /fileset
 /copy
 /target


 target name=uninstall depends=init-install
 description=Uninstalls the current configuration
 delete dir=${install.dir} failonerror=false/
 /target



Furthermore I think it is time to use the framework 1.1
as a default...


What's your opinion?


Gius_.


Giuseppe Greco
T-Systems CS AG
Birkenstrasse 21
8306 Bruttisellen


Phone: +41 (0) 1 805 57 20
Fax: +41 (0) 1 805 55 45
Email: [EMAIL PROTECTED]
Web: www.t-systems.ch





RE: [nant-dev] Problems with basedir beginning with ../

2003-06-10 Thread Greco Giuseppe
Title: RE: [nant-dev] Problems with basedir beginning with ../





Ian,


I'm sorry... The problem was that the ${build.dir} property
in a subproject was set to ${nant.project.basedir}/build, and the
resulting path was


../Core/home/genius/projects/gekkota/src/Gekkota/test/build/gekkota-debug/bin


instead of


../Core/build/gekkota-debug/bin


I usually set ${build.dir} to '${nant.project.basedir}/build' in the
build file located in the project's top directory, so that subprojects
put the results in the distribution directory when running nant from
there... but I set ${build.dir} to 'build' in the build files located in
each subproject, just to be able to work locally without having to go
back to the project's top directoy after each build.


So, in this case, I accidentally set ${build.dir} to
'${nant.project.basedir}/build' in a subproject.


I'm really sorry!!


Thanks,


Gius_.


 -Original Message-
 From: Ian MacLean [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, June 11, 2003 6:28 AM
 To: Greco Giuseppe
 Cc: Giuseppe Greco; NAnt Developers
 Subject: Re: [nant-dev] Problems with basedir beginning with ../
 
 
 does it work if you specify the full path to
 ../Core/${build.dir}/${package.name}/bin ?
 
 what does ../Core/${build.dir}/${package.name}/bin look like when the
 prpoerties are expanded ? - use echo to pipe it to sdtout
 
 I created a sample very similar to yours and the ../ notation 
 is working 
 fine.
 
 Also if you could run it thru the debugger and find the exact string 
 passed to System.IO.Path.GetFullPath(String path) that would 
 be helpful.
 
 Ian
  Ian,
  
  this is my target:
  
  target name=build depends=init
  csc target=exe debug=${build.debug}
  output=${build.dir}/${package.name}/bin/multicaster.test.exe
  sources basedir=test failonempty=true
  includes name=MulticasterTest.cs /
  /sources
  references basedir=../Core/${build.dir}/${package.name}/bin
  includes name=*.dll/
  /references
  /csc
  /target
  
  ... and these are the error messages produced by NAnt:
  
  INTERNAL ERROR
  
  System.NotSupportedException: The given path's format is 
 not supported.
  at 
 System.Security.Util.StringExpressionSet.CanonicalizePath(String 
  path, Boolean needFullPath)
  at 
 System.Security.Util.StringExpressionSet.AddExpressions(String[] 
  str, Boolean checkForDuplicates, Boolean needFullPath)
  
  at 
  
 System.Security.Permissions.FileIOPermission.AddPathList(FileI
 OPermissionAccess 
  access, String[] pathListOrig, Boolean checkForDuplicates, Boolean 
  needFullPath, Boolean copyPathList)
  
  at 
  
 System.Security.Permissions.FileIOPermission..ctor(FileIOPermi
 ssionAccess 
  access, String[] pathList, Boolean checkForDuplicates, 
 Boolean needFullPath)
  
  at System.IO.Path.GetFullPath(String path)
  at NAnt.Core.Project.GetFullPath(String path)
  at NAnt.Core.Types.FileSet.InitializeElement(XmlNode elementNode)
  at NAnt.Core.Element.Initialize(XmlNode elementNode)
  at 
 NAnt.Core.Element.CreateChildBuildElement(PropertyInfo propInf, 
  XmlNode xml)
  at NAnt.Core.Element.InitializeXml(XmlNode elementNode)
  at NAnt.Core.Element.Initialize(XmlNode elementNode)
  at NAnt.Core.Target.Execute()
  at NAnt.Core.Project.Execute(String targetName)
  at NAnt.Core.Project.Execute()
  at NAnt.Core.Project.Run()
  
  
  As you can see, NAnt doesn't accept the basedir specified
  for the refereces element. I've this problem on both Windows
  and Linux.
  
  Gius_.
  
   -Original Message-
   From: Ian MacLean [mailto:[EMAIL PROTECTED]]
   Sent: Sunday, June 08, 2003 1:35 PM
   To: Giuseppe Greco
   Cc: NAnt Developers
   Subject: Re: [nant-dev] Problems with basedir beginning with ../
  
  
   well I can't repooduce this behaviour with either the 
 csc task or the
   copy task on windows. I haven't tried linux yet. Can you
   please include
   the NAnt output when you run this buildfile ?
  
   Ian
  
Hi all,
   
I've a task like this:
   
csc target=exe debug=${build.debug}
output=${build.dir}/${package.name}/bin/multicaster.exe
sources
includes name=Multicaster.cs /
/sources
references 
 basedir=../Core/${build.dir}/${package.name}/bin
includes name=gekkota.core.dll/
includes name=gekkota.ssl.dll/
/references
/csc
   
As you can see, the basedir property of the references task
begins with ../ - to build this application I need some dlls
located on a different subproject:
   
src
+-Gekkota
+-Core
| ...
+-Test
...
   
The problem is that NAnt doesn't accept paths beginning with
../ (I've noticed the same problem with the copy and move
tasks).
   
As I run the task above, NAnt complies saying that this path
format is not supported.
   
The problem is on both Windows and Linux.
   
Gius_.

  
  
  
  
   ---
   This SF.net email is sponsored by: Etnus, makers of
   TotalView, The best
   thread

[nant-dev] RE: [Nant-users] docbook.xsl and nant

2003-06-10 Thread Greco Giuseppe
Title: RE: [Nant-users] docbook.xsl and nant





Ian,


The problem is that NAnt uses a not-validating XML reader
(see StyleTask.cs at line 240), while DocBook requires a
validating XML reader. As already discussed, the idea would
be to add a new property to the style task
(e.g. validate=true) and let NAnt validate XML documents
using the XMLValidatingReader class.


Gius_.



 -Original Message-
 From: Ian MacLean [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 10, 2003 9:44 AM
 To: Greco Giuseppe
 Cc: 'Jaroslaw Kowalski'; [EMAIL PROTECTED]
 Subject: Re: [Nant-users] docbook.xsl and nant
 
 
 Gius,
 Are you sure about that ? Have you tried a simple .net app using the 
 system.xml.dll xslt processor ? It may be that docbook.xsl is using 
 constructs and/or extensions not supported by the .net processor.
 
 Jarek,
 could you post a copy of your xml file and docbook.xsl so I 
 can take a 
 closer look at this. thanks
 
 Ian
 
  Jaroslaw,
  
  That doesn't work, since NAnt uses a not-validating XSLT processor.
  We should modify this somewhere in the future (StyleTask.cs), but
  right now, you have to relay to an external XSLT processor.
  
  Gius_.
  
   -Original Message-
   From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, June 10, 2003 8:56 AM
   To: [EMAIL PROTECTED]
   Subject: [Nant-users] docbook.xsl and nant
  
  
   I've tried to use nant's style task to convert very 
 simple docbook
   document to xhtml using docboox.xsl. No matter what I try, I
   always get
  
   Could not perform XSLT transformation.
  
   Does anybody have a working example of nant+docbook.xsl?
  
   Using xsltproc everything is fine. I can even add
   ?xml-stylesheet ? to my
   xml file and it displays properly in MSIE 6.0.
  
   Jarek
  
  
  
   ---
   This SF.net email is sponsored by: Etnus, makers of
   TotalView, The best
   thread debugger on the planet. Designed with thread 
 debugging features
   you've never dreamed of, try TotalView 6 free at www.etnus.com.
   ___
   Nant-users mailing list
   [EMAIL PROTECTED]
   https://lists.sourceforge.net/lists/listinfo/nant-users
  
  
 





RE: [nant-dev] cvs re-org

2003-06-05 Thread Greco Giuseppe
Title: RE: [nant-dev] cvs re-org





Great!


Have the pending patches been included
(e.g. bug-fix in the exec task)?


I included them in my local copy of NAnt last week,
so I need to know if I have to include them again...


Gius_.



 -Original Message-
 From: Ian MacLean [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 06, 2003 3:37 AM
 To: Nant-Developers (E-mail)
 Subject: [nant-dev] cvs re-org
 
 
 The cvs-reorg has been done on the cvs server. You'll need to 
 checkout 
 a completely fresh client as the directory structure has changed 
 significantly. There are a couple of other small changes pending but 
 they aren't nearly as large. Everything seems to be building 
 and running 
 cleanly.
 
 Ian
 
 
 
 ---
 This SF.net email is sponsored by: Etnus, makers of 
 TotalView, The best
 thread debugger on the planet. Designed with thread debugging features
 you've never dreamed of, try TotalView 6 free at www.etnus.com.
 ___
 Nant-developers mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/nant-developers
 





RE: [nant-dev] NAnt CVS Directories

2003-06-04 Thread Greco Giuseppe
Title: RE: [nant-dev] NAnt  CVS Directories





 wouldn't it be possible to check if a buildfile exists in 
 directory (using
 the available task with an if task) ?
 
 In my opinion, the exclude property has too limited 
 usability what will
 happen if you want to exclude two directories ?
 
 perhaps we should reconsider adding fileset support to the nant task


The "exclude" property could contain a list of space separated
directories... I like your idea (adding fileset), but we have to
consider that the foreach task doens't work just with directories;
exclude should apply to all the property supported by foreach
(File, Folder, String and Line).



Gius_.