Re: Announcing NAnt 0.91 Alpha1

"Martin Aliger" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nant.devel
Message-ID <[email protected]>
Hi NAnters,

looking into new 0.91 sources and I got there few patches locally which do
not make it into head yet. I hope I sent all of them to list (maybe some
only to Gert?).

Anyway - here are few minor ones (out of NAnt.MSBuild):

1) datetime_functions.patch
It just AIDS new function to allow datetime formatting (tostring with format
passed in)

2) element.patch
To support better error messages somewhere in Solution task I need to read
Location from non-descendant class. This allows read to public (write to
protected).

3) VSNet.patch
Adds VS2008 and VS2010. Plus minor change for Berger debugging on 2.0/4.

4) vcprojs
I'm no expert to C++ builds, but I got some code changes around to support
vcproj from VS2005 and VS2008 (need some work for VS2010).

Changes around: UsePrecompiledHeader, exception handling /EHS, managed
extenstions. Short changes, nothing big.


Martin Aliger

-----Original Message-----
From: Ryan Boggs [mailto:[email protected]] 
Sent: Sunday, May 30, 2010 4:03 AM
To: [email protected]; [email protected];
[email protected]; [email protected]
Subject: [nant-dev] Announcing NAnt 0.91 Alpha1

Announcing NAnt 0.91 Alpha1
We are proud to announce the first alpha release of NAnt 0.91, the
first official release with .NET 4.0 support.

The primary goal for this release is to improve support for .NET 4.0.
Please give this release a test and report any NAnt core specific bugs
back along with examples as soon as you can.

This release focuses on extending our already strong support for
multiple target frameworks, bringing improved flexibility and
performance.  A number of outstanding issues have been fixed as well.

A roadmap has been created to help illustrate the current release
plan.  Please note that this roadmap is a work in progress and is
subject to change depending on feature priorities, issues, and
developer's comfort level with the release:
https://sourceforge.net/apps/mediawiki/nant/index.php?title=Roadmap

Binary and source distributions are available for immediate download from:
http://sourceforge.net/project/showfiles.php?group_id=31650

The CVS tag for NAnt 0.91Alpha1 is:
rel-0-91-alpha1

Instruction for checking out sources from CVS are available here:
http://sourceforge.net/cvs/?group_id=31650

Discussion of NAnt occurs on the mailing list at
[email protected].

Bugs can be reported using the Bug Tracker at
http://sourceforge.net/projects/nant.

For more detailed progress on the inner workings of NAnt, check out
the NAnt Blog at https://sourceforge.net/apps/wordpress/nant/

About NAnt:
NAnt is a free .NET build tool, allowing applications to be built
targeting both Microsoft .NET and Mono while supporting both Windows
and Linux platforms.

Check the NAnt homepage for additional info at http://nant.sourceforge.net.

Thanks,
Ryan

----------------------------------------------------------------------------
--

_______________________________________________
nant-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-developers

------------------------------------------------------------------------------

_______________________________________________
nant-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-developers
datetime_functions.patch (application/octet-stream, 1.2 KB)
Index: DateTimeFunctions.cs
===================================================================
--- DateTimeFunctions.cs	(revision 123)
+++ DateTimeFunctions.cs	(working copy)
@@ -252,8 +252,27 @@
         [Function("to-string")]
         public static string ToString(DateTime value) {
             return value.ToString(CultureInfo.InvariantCulture);
+        }
+
+        /// <summary>
+        /// Converts the specified <see cref="DateTime" /> to its equivalent
+        /// string representation.
+        /// </summary>
+        /// <param name="value">A <see cref="DateTime" /> to convert.</param>
+        /// <param name="format">A format string.</param>
+        /// <returns>
+        /// A string representation of <paramref name="value" /> formatted
+        ///	using the specified format
+        /// </returns>
+        /// <remarks>
+        /// <paramref name="value" /> is formatted with the 
+        /// <see cref="DateTimeFormatInfo" /> for the invariant culture.
+        /// </remarks>
+        [Function("format-to-string")]
+        public static string ToString(DateTime value, string format)
+        {
+            return value.ToString(format, CultureInfo.InvariantCulture);
         }
-
         #endregion Public Static Methods
     }
 }
element.patch (application/octet-stream, 578 B)
Index: Element.cs
===================================================================
--- Element.cs	(revision 123)
+++ Element.cs	(working copy)
@@ -174,9 +174,9 @@
         /// <value>
         /// The location in the build file where the element is defined.
         /// </value>
-        protected virtual Location Location {
-            get { return _location; }
-            set { _location = value; }
+        public virtual Location Location {
+            get { return _location; }
+            protected set { _location = value; }
         }
 
         /// <summary>
vsnet.patch (application/octet-stream, 1.6 KB)
Index: ProjectBase.cs
===================================================================
--- ProjectBase.cs	(revision 118)
+++ ProjectBase.cs	(working copy)
@@ -804,17 +804,27 @@
         /// <summary>
         /// Visual Studio.NET 2002
         /// </summary>
-        Rainier = 1,
+        Rainier = 70,
 
         /// <summary>
         /// Visual Studio.NET 2003
         /// </summary>
-        Everett = 2,
+        Everett = 71,
 
         /// <summary>
         /// Visual Studio 2005
         /// </summary>
-        Whidbey =3,
+        Whidbey = 80,
+
+        /// <summary>
+        /// Visual Studio 2008
+        /// </summary>
+        Orcas = 90,
+
+        /// <summary>
+        /// Visual Studio 2010
+        /// </summary>
+        Rosario = 100,
     }
 
     /// <summary>
Index: SolutionBase.cs
===================================================================
--- SolutionBase.cs	(revision 118)
+++ SolutionBase.cs	(working copy)
@@ -561,8 +561,16 @@
             }
 
             try {
+#if NET_2_0
+                Uri uri = null;
+                Uri.TryCreate(translatedPath, UriKind.Absolute, out uri);
+#else
                 Uri uri = new Uri(translatedPath);
-                if (uri.Scheme == Uri.UriSchemeFile) {
+#endif
+                if(uri==null) {
+                    translatedPath = FileUtils.GetFullPath(FileUtils.CombinePaths( 
+                        solutionDir, translatedPath));
+                } else if (uri.Scheme == Uri.UriSchemeFile) {
                     translatedPath = FileUtils.GetFullPath(FileUtils.CombinePaths(
                         solutionDir, uri.LocalPath));
                 } else {
vcprojs.patch (application/octet-stream, 6.9 KB)
Index: VcConfigurationBase.cs
===================================================================
--- VcConfigurationBase.cs	(revision 118)
+++ VcConfigurationBase.cs	(working copy)
@@ -115,10 +115,23 @@
                     "UsePrecompiledHeader");
                 if (usePCHString == null) {
                     return UsePrecompiledHeader.Unspecified;
+                }
+                int intVal = int.Parse(usePCHString, CultureInfo.InvariantCulture);
+
+                if (this.Project.ProductVersion >= ProductVersion.Whidbey)
+                {
+                    switch(intVal)
+                    {
+                        case 0 :
+                            return UsePrecompiledHeader.No;
+                        case 1:
+                            return UsePrecompiledHeader.Create;
+                        case 2:
+                            return UsePrecompiledHeader.Use;
+                    }                    
                 }
 
-                return (UsePrecompiledHeader) Enum.ToObject(typeof(UsePrecompiledHeader), 
-                    int.Parse(usePCHString, CultureInfo.InvariantCulture));
+                return (UsePrecompiledHeader) Enum.ToObject(typeof(UsePrecompiledHeader), intVal);
             }
         }
 
Index: VcProject.cs
===================================================================
--- VcProject.cs	(revision 118)
+++ VcProject.cs	(working copy)
@@ -707,13 +707,30 @@
                         addOptionsLine = reader.ReadLine();
                     }
                 }
+            }
+
+            //exception handling stuff
+            string exceptionHandling = fileConfig.GetToolSetting(VcConfigurationBase.CLCompilerTool, "ExceptionHandling");
+            if (exceptionHandling == null)
+            {
+                if (ProductVersion >= ProductVersion.Whidbey) exceptionHandling = "2";
+                else exceptionHandling = "false";
+            }
+            else exceptionHandling = exceptionHandling.ToLower();
+            switch(exceptionHandling)
+            {
+                case "0":
+                case "false":
+                    break;
+                case "1":
+                case "true":
+                    clTask.Arguments.Add(new Argument("/EHsc"));
+                    break;
+                case "2":
+                    clTask.Arguments.Add(new Argument("/EHa"));
+                    break;
             }
 
-            string exceptionHandling = fileConfig.GetToolSetting(VcConfigurationBase.CLCompilerTool, "ExceptionHandling");
-            if (exceptionHandling == null || string.Compare(exceptionHandling, "true", true, CultureInfo.InvariantCulture) == 0) {
-                clTask.Arguments.Add(new Argument("/EHsc"));
-            }
-
             string browseInformation = fileConfig.GetToolSetting(VcConfigurationBase.CLCompilerTool, "BrowseInformation");
             if (!StringUtils.IsNullOrEmpty(browseInformation) && browseInformation != "0") {
                 // determine file name of browse information file
@@ -1825,14 +1842,17 @@
                 return false;
             }
 
-            try {
-                GetProductVersion(docElement);
-                // no need to perform version check here as this is done in 
-                // GetProductVersion
-            } catch {
-                // product version could not be determined or is not supported
-                return false;
-            }
+            //MAL 2007/12/20
+            //this is double check - really needed? In addition, when version check fails, it gives odd error.
+            //2nd check is made in DetermineProductVersion (called from ProjectBase constructor)
+            //try {
+            //    GetProductVersion(docElement);
+            //    // no need to perform version check here as this is done in 
+            //    // GetProductVersion
+            //} catch {
+            //    // product version could not be determined or is not supported
+            //    return false;
+            //}
 
             return true;
         }
@@ -1879,7 +1899,9 @@
             // check if we're dealing with a valid version number
             Version productVersion = null;
             try {
-                productVersion = new Version(productVersionAttribute.Value);
+                string ver = productVersionAttribute.Value;
+                ver=ver.Replace(',', '.'); //Whidbey (8,00) and Orcas (9,00) are using comma instead of point
+                productVersion = new Version(ver);
             } catch (Exception ex) {
                 throw new BuildException(string.Format(CultureInfo.InvariantCulture,
                     "The value of the \"Version\" attribute ({0}) is not a valid"
@@ -1887,17 +1909,23 @@
                     Location.UnknownLocation, ex);
             }
 
-            if (productVersion.Major == 7) {
-                switch (productVersion.Minor) {
-                    case 0:
-                        return ProductVersion.Rainier;
-                    case 10:
-                        return ProductVersion.Everett;
-                }
+            switch(productVersion.Major) {
+                case 7:
+                    switch (productVersion.Minor) {
+                        case 0:
+                            return ProductVersion.Rainier;
+                        case 10:
+                            return ProductVersion.Everett;
+                    }
+                    break;
+                case 8:
+                    return ProductVersion.Whidbey;
+                case 9:
+                    return ProductVersion.Orcas;
             } 
 
             throw new BuildException(string.Format(CultureInfo.InvariantCulture,
-                "Visual Studio version \"{0\" is not supported.",
+                "Visual Studio version \"{0}\" is not supported.",
                 productVersion.ToString()), Location.UnknownLocation);
         }
 
Index: VcProjectConfiguration.cs
===================================================================
--- VcProjectConfiguration.cs	(revision 118)
+++ VcProjectConfiguration.cs	(working copy)
@@ -59,7 +59,20 @@
 
             string managedExtentions = GetXmlAttributeValue(elem, "ManagedExtensions");
             if (managedExtentions != null) {
-                _managedExtensions = string.Compare(managedExtentions.Trim(), "true", true, CultureInfo.InvariantCulture) == 0;
+                switch(managedExtentions.ToLower())
+                {
+                    case "false":
+                    case "0":
+                        _managedExtensions = false;
+                        break;
+                    case "true":
+                    case "1":
+                        _managedExtensions = true;
+                        break;
+                    default:
+                        throw new BuildException(String.Format("ManagedExtensions '{0}' is not supported yet.",managedExtentions));
+                }
+                
             }
 
             // get configuration type
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.