You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(35) |
Nov
(7) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(73) |
Feb
(87) |
Mar
(96) |
Apr
(69) |
May
(36) |
Jun
(68) |
Jul
(55) |
Aug
(76) |
Sep
(8) |
Oct
(79) |
Nov
(8) |
Dec
(21) |
| 2003 |
Jan
(43) |
Feb
(82) |
Mar
(163) |
Apr
(294) |
May
(233) |
Jun
(159) |
Jul
(181) |
Aug
(214) |
Sep
(224) |
Oct
(226) |
Nov
(138) |
Dec
(312) |
| 2004 |
Jan
(48) |
Feb
(195) |
Mar
(112) |
Apr
(136) |
May
(182) |
Jun
(78) |
Jul
(288) |
Aug
(327) |
Sep
(156) |
Oct
(62) |
Nov
(241) |
Dec
(167) |
| 2005 |
Jan
(202) |
Feb
(109) |
Mar
(148) |
Apr
(113) |
May
(104) |
Jun
(130) |
Jul
(27) |
Aug
(4) |
Sep
(9) |
Oct
(36) |
Nov
(19) |
Dec
(11) |
| 2006 |
Jan
(1) |
Feb
(2) |
Mar
(58) |
Apr
(34) |
May
(15) |
Jun
(19) |
Jul
(19) |
Aug
(10) |
Sep
(26) |
Oct
(38) |
Nov
(19) |
Dec
(54) |
| 2007 |
Jan
(74) |
Feb
(39) |
Mar
(36) |
Apr
(48) |
May
(8) |
Jun
(16) |
Jul
(25) |
Aug
(59) |
Sep
(25) |
Oct
(38) |
Nov
(52) |
Dec
(82) |
| 2008 |
Jan
(16) |
Feb
(32) |
Mar
(51) |
Apr
(30) |
May
(21) |
Jun
(44) |
Jul
(41) |
Aug
(36) |
Sep
(22) |
Oct
(20) |
Nov
(67) |
Dec
(46) |
| 2009 |
Jan
(50) |
Feb
(25) |
Mar
(54) |
Apr
(70) |
May
(145) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
|
Feb
(39) |
Mar
(24) |
Apr
(81) |
May
(65) |
Jun
(2) |
Jul
(1) |
Aug
(5) |
Sep
(2) |
Oct
(13) |
Nov
(2) |
Dec
(5) |
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(8) |
Jun
(3) |
Jul
(2) |
Aug
(4) |
Sep
(6) |
Oct
(17) |
Nov
(1) |
Dec
(4) |
| 2012 |
Jan
(10) |
Feb
(6) |
Mar
(22) |
Apr
(35) |
May
(18) |
Jun
(2) |
Jul
(3) |
Aug
(6) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(9) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(4) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(53) |
| 2015 |
Jan
(17) |
Feb
(16) |
Mar
(1) |
Apr
(11) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <nan...@na...> - 2015-04-21 01:20:11
|
From: Ryan Boggs <rm...@us...>
---
doc/releasenotes.html | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/doc/releasenotes.html b/doc/releasenotes.html
index c06fcf6..5c1b6c4 100644
--- a/doc/releasenotes.html
+++ b/doc/releasenotes.html
@@ -139,6 +139,20 @@
</div>
<h4>Core</h4>
<div style="margin-left: 20px;">
+ <h5>Performance</h5>
+ <div style="margin-left: 20px;">
+ <p>Various performance improvements to reduce memory usage, and overall
+ performance during executions of long running tasks (<a href="https://github.com/nant/nant/pull/143">Issue #143)</a>
+ </p>
+ </div>
+ </div>
+ <div style="margin-left: 20px;">
+ <h5><a class="heading" href="help/functions/">Functions</a></h5>
+ <div style="margin-left: 20px;">
+ <p>Added <c>get-informational-version</c> function (<a href="https://github.com/nant/nant/pull/146">Issue #146</a>)</p>
+ </div>
+ </div>
+ <div style="margin-left: 20px;">
<h5><a class="heading" href="http://www.nunit.org">NUnit</a></h5>
<div style="margin-left: 20px;">
<p>
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:19
|
From: imakowski <ima...@gm...>
---
src/NAnt.Core/Element.cs | 21 +++++++++------------
src/NAnt.Core/Log.cs | 28 ++++++++++++++++++----------
src/NAnt.Core/Task.cs | 14 +++++++-------
src/NAnt.Core/Tasks/AttribTask.cs | 4 ++--
src/NAnt.Core/Tasks/DeleteTask.cs | 8 ++++----
src/NAnt.Core/Tasks/LoadTasks.cs | 2 +-
src/NAnt.Core/Tasks/MoveTask.cs | 2 +-
src/NAnt.Core/Tasks/SysInfo.cs | 4 ++--
src/NAnt.Core/Tasks/TouchTask.cs | 2 +-
src/NAnt.DotNet/Tasks/LicenseTask.cs | 2 +-
src/NAnt.VSNet/Tasks/SolutionTask.cs | 4 ++--
11 files changed, 48 insertions(+), 43 deletions(-)
diff --git a/src/NAnt.Core/Element.cs b/src/NAnt.Core/Element.cs
index c445158..6d3d510 100644
--- a/src/NAnt.Core/Element.cs
+++ b/src/NAnt.Core/Element.cs
@@ -229,13 +229,13 @@ namespace NAnt.Core {
/// Logs a message with the given priority.
/// </summary>
/// <param name="messageLevel">The message priority at which the specified message is to be logged.</param>
- /// <param name="message">The message to be logged.</param>
+ /// <param name="format">The message to be logged.</param>
/// <remarks>
/// The actual logging is delegated to the project.
/// </remarks>
- public virtual void Log(Level messageLevel, string message) {
+ public virtual void Log(Level messageLevel, string format) {
if (Project != null) {
- Project.Log(messageLevel, message);
+ Project.Log(messageLevel, format);
}
}
@@ -243,14 +243,14 @@ namespace NAnt.Core {
/// Logs a message with the given priority.
/// </summary>
/// <param name="messageLevel">The message priority at which the specified message is to be logged.</param>
- /// <param name="message">The message to log, containing zero or more format items.</param>
+ /// <param name="format">The message to log, containing zero or more format items.</param>
/// <param name="args">An <see cref="object" /> array containing zero or more objects to format.</param>
/// <remarks>
/// The actual logging is delegated to the project.
/// </remarks>
- public virtual void Log(Level messageLevel, string message, params object[] args) {
+ public virtual void Log(Level messageLevel, string format, params object[] args) {
if (Project != null) {
- Project.Log(messageLevel, message, args);
+ Project.Log(messageLevel, format, args);
}
}
@@ -872,8 +872,7 @@ namespace NAnt.Core {
throw new BuildException(obsoleteMessage,
Location);
} else {
- Element.Log(Level.Warning, Location.ToString()
- + " " + obsoleteMessage);
+ Element.Log(Level.Warning, "{0} {1}", Location.ToString(), obsoleteMessage);
}
}
} else {
@@ -1045,8 +1044,7 @@ namespace NAnt.Core {
throw new BuildException(obsoleteMessage,
Location);
} else {
- Element.Log(Level.Warning, Location.ToString()
- + " " + obsoleteMessage);
+ Element.Log(Level.Warning, "{0} {1}", Location.ToString(), obsoleteMessage);
}
}
@@ -1097,8 +1095,7 @@ namespace NAnt.Core {
throw new BuildException(obsoleteMessage,
Location);
} else {
- Element.Log(Level.Warning, Location.ToString()
- + " " + obsoleteMessage);
+ Element.Log(Level.Warning, "{0} {1}", Location.ToString(), obsoleteMessage);
}
}
diff --git a/src/NAnt.Core/Log.cs b/src/NAnt.Core/Log.cs
index 700f4b9..cb742aa 100644
--- a/src/NAnt.Core/Log.cs
+++ b/src/NAnt.Core/Log.cs
@@ -1372,7 +1372,7 @@ namespace NAnt.Core {
/// </summary>
/// <param name="value"></param>
public override void Write(string value) {
- _message += value;
+ _message.Append(value);
}
/// <summary>
@@ -1388,9 +1388,12 @@ namespace NAnt.Core {
/// </summary>
/// <param name="value">The string to write. If <paramref name="value" /> is a null reference, only the line termination characters are written.</param>
public override void WriteLine(string value) {
- _message += value;
- _task.Log(OutputLevel, _message);
- _message = string.Empty;
+ _message.Append(value);
+
+ if (_task.IsLogEnabledFor(OutputLevel))
+ _task.Log(OutputLevel, _message.ToString());
+
+ _message.Length = 0;
}
/// <summary>
@@ -1400,9 +1403,12 @@ namespace NAnt.Core {
/// <param name="line">The formatting string.</param>
/// <param name="args">The object array to write into format string.</param>
public override void WriteLine(string line, params object[] args) {
- _message += string.Format(CultureInfo.InvariantCulture, line, args);
- _task.Log(OutputLevel, _message);
- _message = string.Empty;
+ _message.AppendFormat((CultureInfo.InvariantCulture, line, args);
+
+ if(_task.IsLogEnabledFor(OutputLevel))
+ _task.Log(OutputLevel, _message.ToString());
+
+ _message.Length = 0;
}
/// <summary>
@@ -1410,8 +1416,10 @@ namespace NAnt.Core {
/// </summary>
public override void Flush() {
if (_message.Length != 0) {
- _task.Log(OutputLevel, _message);
- _message = string.Empty;
+ if(_task.IsLogEnabledFor(OutputLevel))
+ _task.Log(OutputLevel, _message.ToString());
+
+ _message.Length = 0;
}
}
@@ -1464,7 +1472,7 @@ namespace NAnt.Core {
private readonly Task _task;
private readonly Level _outputLevel;
- private string _message = string.Empty;
+ private StringBuilder _message = new StringBuilder();
#endregion Private Instance Fields
}
diff --git a/src/NAnt.Core/Task.cs b/src/NAnt.Core/Task.cs
index 18cfda6..1b32a99 100644
--- a/src/NAnt.Core/Task.cs
+++ b/src/NAnt.Core/Task.cs
@@ -221,7 +221,7 @@ namespace NAnt.Core {
/// Logs a message with the given priority.
/// </summary>
/// <param name="messageLevel">The message priority at which the specified message is to be logged.</param>
- /// <param name="message">The message to be logged.</param>
+ /// <param name="format">The message to be logged.</param>
/// <remarks>
/// <para>
/// The actual logging is delegated to the project.
@@ -243,15 +243,15 @@ namespace NAnt.Core {
/// as build listeners might be interested in receiving all messages.
/// </para>
/// </remarks>
- public override void Log(Level messageLevel, string message) {
+ public override void Log(Level messageLevel, string format) {
if (!IsLogEnabledFor(messageLevel)) {
return;
}
if (_verbose && messageLevel == Level.Verbose && Project.Threshold == Level.Info) {
- Project.Log(this, Level.Info, message);
+ Project.Log(this, Level.Info, format);
} else {
- Project.Log(this, messageLevel, message);
+ Project.Log(this, messageLevel, format);
}
}
@@ -259,7 +259,7 @@ namespace NAnt.Core {
/// Logs a formatted message with the given priority.
/// </summary>
/// <param name="messageLevel">The message priority at which the specified message is to be logged.</param>
- /// <param name="message">The message to log, containing zero or more format items.</param>
+ /// <param name="format">The message to log, containing zero or more format items.</param>
/// <param name="args">An <see cref="object" /> array containing zero or more objects to format.</param>
/// <remarks>
/// <para>
@@ -277,13 +277,13 @@ namespace NAnt.Core {
/// <see cref="Level.Info" />.
/// </para>
/// </remarks>
- public override void Log(Level messageLevel, string message, params object[] args) {
+ public override void Log(Level messageLevel, string format, params object[] args) {
if (!IsLogEnabledFor(messageLevel))
{
return;
}
- string logMessage = string.Format(CultureInfo.InvariantCulture, message, args);
+ string logMessage = string.Format(CultureInfo.InvariantCulture, format, args);
Log(messageLevel, logMessage);
}
diff --git a/src/NAnt.Core/Tasks/AttribTask.cs b/src/NAnt.Core/Tasks/AttribTask.cs
index 276669c..ddacaab 100644
--- a/src/NAnt.Core/Tasks/AttribTask.cs
+++ b/src/NAnt.Core/Tasks/AttribTask.cs
@@ -258,7 +258,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(msg, Location, ex);
} else {
- Log(Level.Verbose, msg + " " + ex.Message);
+ Log(Level.Verbose, "{0} {1}", msg, ex.Message);
}
}
}
@@ -298,7 +298,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(msg, Location, ex);
} else {
- Log(Level.Verbose, msg + " " + ex.Message);
+ Log(Level.Verbose, "{0} {1}", msg, ex.Message);
}
}
}
diff --git a/src/NAnt.Core/Tasks/DeleteTask.cs b/src/NAnt.Core/Tasks/DeleteTask.cs
index fecef35..05b61c6 100644
--- a/src/NAnt.Core/Tasks/DeleteTask.cs
+++ b/src/NAnt.Core/Tasks/DeleteTask.cs
@@ -217,7 +217,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(msg, Location, ex);
}
- Log(Level.Warning, msg + " " + ex.Message);
+ Log(Level.Warning, "{0} {1}", msg, ex.Message);
}
}
}
@@ -259,7 +259,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(msg, Location, ex);
}
- Log(Level.Verbose, msg + " " + ex.Message);
+ Log(Level.Verbose, "{0} {1}", msg, ex.Message);
}
}
DeleteDirectory(path);
@@ -271,7 +271,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(msg, Location, ex);
}
- Log(Level.Warning, msg + " " + ex.Message);
+ Log(Level.Warning, "{0} {1}", msg, ex.Message);
}
}
@@ -295,7 +295,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(msg, Location, ex);
}
- Log(Level.Warning, msg + " " + ex.Message);
+ Log(Level.Warning, "{0} {1}", msg, ex.Message);
}
}
diff --git a/src/NAnt.Core/Tasks/LoadTasks.cs b/src/NAnt.Core/Tasks/LoadTasks.cs
index ab1dc20..ecfe143 100644
--- a/src/NAnt.Core/Tasks/LoadTasks.cs
+++ b/src/NAnt.Core/Tasks/LoadTasks.cs
@@ -149,7 +149,7 @@ namespace NAnt.Core.Tasks {
if (FailOnError) {
throw new BuildException(message, Location, ex);
} else {
- Log(Level.Error, message + " " + ex.Message);
+ Log(Level.Error, "{0} {1}", message, ex.Message);
}
}
}
diff --git a/src/NAnt.Core/Tasks/MoveTask.cs b/src/NAnt.Core/Tasks/MoveTask.cs
index e49901e..1e8a14c 100644
--- a/src/NAnt.Core/Tasks/MoveTask.cs
+++ b/src/NAnt.Core/Tasks/MoveTask.cs
@@ -201,7 +201,7 @@ namespace NAnt.Core.Tasks {
if (sourcePath.Equals(destinationPath, StringComparison.InvariantCulture))
{
- Log(Level.Warning, "Skipping self-move of {0}." + sourcePath);
+ Log(Level.Warning, "Skipping self-move of {{0}}.{0}", sourcePath);
continue;
}
diff --git a/src/NAnt.Core/Tasks/SysInfo.cs b/src/NAnt.Core/Tasks/SysInfo.cs
index cdbd494..38bee74 100644
--- a/src/NAnt.Core/Tasks/SysInfo.cs
+++ b/src/NAnt.Core/Tasks/SysInfo.cs
@@ -180,7 +180,7 @@ namespace NAnt.Core.Tasks {
/// Executes the task.
/// </summary>
protected override void ExecuteTask() {
- Log(Level.Info, "Setting system information properties under " + Prefix + "*");
+ Log(Level.Info, "Setting system information properties under {0}*", Prefix);
// set properties
Properties[Prefix + "clr.version"] = Environment.Version.ToString();
@@ -218,7 +218,7 @@ namespace NAnt.Core.Tasks {
foreach (DictionaryEntry entry in Properties) {
string name = (string) entry.Key;
if (name.StartsWith(Prefix)) {
- Log(Level.Info, name + " = " + entry.Value.ToString());
+ Log(Level.Info, "{0} = {1}", name, entry.Value.ToString());
}
}
}
diff --git a/src/NAnt.Core/Tasks/TouchTask.cs b/src/NAnt.Core/Tasks/TouchTask.cs
index ebe453f..0ac9258 100644
--- a/src/NAnt.Core/Tasks/TouchTask.cs
+++ b/src/NAnt.Core/Tasks/TouchTask.cs
@@ -189,7 +189,7 @@ namespace NAnt.Core.Tasks {
}
// swallow any errors and move on
- Log(Level.Verbose, msg + " " + ex.Message);
+ Log(Level.Verbose, "{0} {1}", msg, ex.Message);
}
}
diff --git a/src/NAnt.DotNet/Tasks/LicenseTask.cs b/src/NAnt.DotNet/Tasks/LicenseTask.cs
index 2645e97..e15d439 100644
--- a/src/NAnt.DotNet/Tasks/LicenseTask.cs
+++ b/src/NAnt.DotNet/Tasks/LicenseTask.cs
@@ -567,7 +567,7 @@ namespace NAnt.DotNet.Tasks {
continue;
}
- licenseTask.Log(Level.Verbose, line + ": ");
+ licenseTask.Log(Level.Verbose, "{0}: ", line);
// Strip off the assembly name, if it exists
string typeName;
diff --git a/src/NAnt.VSNet/Tasks/SolutionTask.cs b/src/NAnt.VSNet/Tasks/SolutionTask.cs
index b3e4088..7a6af4d 100644
--- a/src/NAnt.VSNet/Tasks/SolutionTask.cs
+++ b/src/NAnt.VSNet/Tasks/SolutionTask.cs
@@ -447,14 +447,14 @@ namespace NAnt.VSNet.Tasks {
if (Projects.FileNames.Count > 0) {
Log(Level.Verbose, "Included projects:" );
foreach (string projectFile in Projects.FileNames) {
- Log(Level.Verbose, " - " + projectFile);
+ Log(Level.Verbose, " - {0}", projectFile);
}
}
if (ReferenceProjects.FileNames.Count > 0) {
Log(Level.Verbose, "Reference projects:");
foreach (string projectFile in ReferenceProjects.FileNames) {
- Log(Level.Verbose, " - " + projectFile);
+ Log(Level.Verbose, " - {0}", projectFile);
}
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:17
|
From: imakowski <ima...@gm...>
---
src/NAnt.Core/Log.cs | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/NAnt.Core/Log.cs b/src/NAnt.Core/Log.cs
index cb742aa..560f71d 100644
--- a/src/NAnt.Core/Log.cs
+++ b/src/NAnt.Core/Log.cs
@@ -1403,7 +1403,7 @@ namespace NAnt.Core {
/// <param name="line">The formatting string.</param>
/// <param name="args">The object array to write into format string.</param>
public override void WriteLine(string line, params object[] args) {
- _message.AppendFormat((CultureInfo.InvariantCulture, line, args);
+ _message.AppendFormat(CultureInfo.InvariantCulture, line, args);
if(_task.IsLogEnabledFor(OutputLevel))
_task.Log(OutputLevel, _message.ToString());
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:17
|
From: imakowski <ima...@gm...>
---
src/NAnt.Core/Task.cs | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/NAnt.Core/Task.cs b/src/NAnt.Core/Task.cs
index 38b65f5..f7db2eb 100644
--- a/src/NAnt.Core/Task.cs
+++ b/src/NAnt.Core/Task.cs
@@ -278,6 +278,11 @@ namespace NAnt.Core {
/// </para>
/// </remarks>
public override void Log(Level messageLevel, string message, params object[] args) {
+ if (!IsLogEnabledFor(messageLevel))
+ {
+ return;
+ }
+
string logMessage = string.Format(CultureInfo.InvariantCulture, message, args);
Log(messageLevel, logMessage);
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:17
|
From: imakowski <ima...@gm...>
---
src/NAnt.Compression/Tasks/UnTarTask.cs | 8 ++++----
src/NAnt.DotNet/Tasks/VbcTask.cs | 2 +-
src/NAnt.MSBuild/MSBuildReference.cs | 2 +-
src/NAnt.VSNet/Resource.cs | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/NAnt.Compression/Tasks/UnTarTask.cs b/src/NAnt.Compression/Tasks/UnTarTask.cs
index f7deaab..7dba80b 100644
--- a/src/NAnt.Compression/Tasks/UnTarTask.cs
+++ b/src/NAnt.Compression/Tasks/UnTarTask.cs
@@ -96,9 +96,8 @@ namespace NAnt.Compression.Tasks {
/// Extracts the files from the archive.
/// </summary>
protected override void ExecuteTask() {
- Stream fs = null;
- Stream instream = null;
-
+ Stream fs = null;
+
try {
// ensure archive exists
if (!SrcFile.Exists)
@@ -108,7 +107,8 @@ namespace NAnt.Compression.Tasks {
fs = SrcFile.OpenRead();
- // wrap inputstream with corresponding compression method
+ // wrap inputstream with corresponding compression method
+ Stream instream;
switch (CompressionMethod) {
case TarCompressionMethod.GZip:
instream = new GZipInputStream(fs);
diff --git a/src/NAnt.DotNet/Tasks/VbcTask.cs b/src/NAnt.DotNet/Tasks/VbcTask.cs
index 4c519f4..ed16cb6 100644
--- a/src/NAnt.DotNet/Tasks/VbcTask.cs
+++ b/src/NAnt.DotNet/Tasks/VbcTask.cs
@@ -481,7 +481,7 @@ namespace NAnt.DotNet.Tasks {
WriteOption(writer, "imports", imports);
}
- if (OptionCompare != null && OptionCompare.ToUpper(CultureInfo.InvariantCulture) != "FALSE") {
+ if (OptionCompare != null && !OptionCompare.Equals("FALSE", StringComparison.InvariantCultureIgnoreCase)) {
WriteOption(writer, "optioncompare", OptionCompare);
}
diff --git a/src/NAnt.MSBuild/MSBuildReference.cs b/src/NAnt.MSBuild/MSBuildReference.cs
index 56cbf7d..fc063c0 100644
--- a/src/NAnt.MSBuild/MSBuildReference.cs
+++ b/src/NAnt.MSBuild/MSBuildReference.cs
@@ -36,7 +36,7 @@ namespace NAnt.MSBuild {
}
public MSBuildReferenceHelper(string priv, bool privatedefault) {
- _isPrivateSpecified = (priv != null && priv.Length>0);
+ _isPrivateSpecified = !string.IsNullOrEmpty(priv);
if (_isPrivateSpecified) {
_isPrivate = (priv.ToLower() == "true");
}
diff --git a/src/NAnt.VSNet/Resource.cs b/src/NAnt.VSNet/Resource.cs
index f952da1..1a5630b 100644
--- a/src/NAnt.VSNet/Resource.cs
+++ b/src/NAnt.VSNet/Resource.cs
@@ -84,7 +84,7 @@ namespace NAnt.VSNet {
/// </value>
public bool IsResX {
get {
- return InputFile.Extension.ToLower(CultureInfo.InvariantCulture) == ".resx";
+ return InputFile.Extension.Equals(".resx", StringComparison.OrdinalIgnoreCase);
}
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:17
|
From: imakowski <ima...@gm...>
---
src/NAnt.Console/ConsoleStub.cs | 4 ++--
src/NAnt.Core/PathScanner.cs | 2 +-
src/NAnt.Core/Task.cs | 4 ++--
src/NAnt.SourceControl/Tasks/AbstractCvsTask.cs | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/NAnt.Console/ConsoleStub.cs b/src/NAnt.Console/ConsoleStub.cs
index f70d0fa..41685a7 100644
--- a/src/NAnt.Console/ConsoleStub.cs
+++ b/src/NAnt.Console/ConsoleStub.cs
@@ -187,9 +187,9 @@ namespace NAnt.Console {
}
if (helper == null || helper.ExitCode == -1) {
- logger.Debug(string.Format(
+ logger.DebugFormat(
CultureInfo.InvariantCulture,
- "Return Code null or -1"));
+ "Return Code null or -1");
throw new ApplicationException("No return code set!");
} else {
diff --git a/src/NAnt.Core/PathScanner.cs b/src/NAnt.Core/PathScanner.cs
index 0147286..20c5b97 100644
--- a/src/NAnt.Core/PathScanner.cs
+++ b/src/NAnt.Core/PathScanner.cs
@@ -159,7 +159,7 @@ namespace NAnt.Core {
// In case of UnauthorizedAccessException,
// log the issue as a warning and move on to
// the next path.
- logger.Warn( "Access to the path \"" + scanPath + "\" is denied.", e );
+ logger.Warn( string.Format("Access to the path \"{0}\" is denied.", scanPath), e );
continue;
}
}
diff --git a/src/NAnt.Core/Task.cs b/src/NAnt.Core/Task.cs
index f7db2eb..18cfda6 100644
--- a/src/NAnt.Core/Task.cs
+++ b/src/NAnt.Core/Task.cs
@@ -176,10 +176,10 @@ namespace NAnt.Core {
Project.OnTaskStarted(this, new BuildEventArgs(this));
ExecuteTask();
} catch (Exception ex) {
- logger.Error(string.Format(
+ logger.ErrorFormat(
CultureInfo.InvariantCulture,
ResourceUtils.GetString("NA1077"),
- Name), ex);
+ Name, ex);
if (FailOnError) {
throw;
diff --git a/src/NAnt.SourceControl/Tasks/AbstractCvsTask.cs b/src/NAnt.SourceControl/Tasks/AbstractCvsTask.cs
index 6c08abf..0d2734a 100644
--- a/src/NAnt.SourceControl/Tasks/AbstractCvsTask.cs
+++ b/src/NAnt.SourceControl/Tasks/AbstractCvsTask.cs
@@ -230,8 +230,8 @@ namespace NAnt.SourceControl.Tasks {
}
_exeNameTemp = vcsFile.FullName;
}
- Logger.Debug("_sharpcvslibExeName: " + _sharpcvslibExeName);
- Logger.Debug("_exeNameTemp: " + _exeNameTemp);
+ Logger.DebugFormat("_sharpcvslibExeName: {0}", _sharpcvslibExeName);
+ Logger.DebugFormat("_exeNameTemp: {0}", _exeNameTemp);
Properties[PropExeName] = _exeNameTemp;
return _exeNameTemp;
}
@@ -468,7 +468,7 @@ namespace NAnt.SourceControl.Tasks {
}
}
- Logger.Debug("number of arguments: " + Arguments.Count);
+ Logger.DebugFormat("number of arguments: {0}", Arguments.Count);
// if set, pass cvsroot to command line tool
if (Root != null) {
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:12
|
From: imakowski <ima...@gm...>
---
src/NAnt.Console/ConsoleStub.cs | 122 +++++++++++++++++--------------------
src/NAnt.Core/Element.cs | 33 ++++------
src/NAnt.Core/TargetCollection.cs | 9 +--
src/NAnt.Core/Task.cs | 7 +-
src/NAnt.Core/TypeFactory.cs | 10 ++--
src/NAnt.Core/Types/FileSet.cs | 32 +++++++---
6 files changed, 104 insertions(+), 109 deletions(-)
diff --git a/src/NAnt.Console/ConsoleStub.cs b/src/NAnt.Console/ConsoleStub.cs
index 82fab95..7caa380 100644
--- a/src/NAnt.Console/ConsoleStub.cs
+++ b/src/NAnt.Console/ConsoleStub.cs
@@ -83,47 +83,42 @@ namespace NAnt.Console {
string privateBinPath = ConstructPrivateBinPath(runtimeFramework,
AppDomain.CurrentDomain.BaseDirectory);
- if (nantShadowCopyFilesSetting != null && bool.Parse(nantShadowCopyFilesSetting) == true) {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ if (nantShadowCopyFilesSetting != null && bool.Parse(nantShadowCopyFilesSetting) == true) {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"Shadowing files({0}) -- cleanup={1}",
- nantShadowCopyFilesSetting,
- nantCleanupShadowCopyFilesSetting));
-
+ nantShadowCopyFilesSetting, nantCleanupShadowCopyFilesSetting);
+
System.AppDomainSetup myDomainSetup = new System.AppDomainSetup();
- myDomainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ myDomainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"NAntDomain.PrivateBinPath={0}",
- myDomainSetup.PrivateBinPath));
-
+ myDomainSetup.PrivateBinPath);
+
myDomainSetup.PrivateBinPath = privateBinPath;
myDomainSetup.ApplicationName = "NAnt";
// copy the config file location
- myDomainSetup.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ myDomainSetup.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"NAntDomain.ConfigurationFile={0}",
- myDomainSetup.ConfigurationFile));
-
+ myDomainSetup.ConfigurationFile);
+
// yes, cache the files
myDomainSetup.ShadowCopyFiles = "true";
// shadowcopy everything in base directory of appdomain and
// privatebinpath
myDomainSetup.ShadowCopyDirectories = myDomainSetup.ApplicationBase
- + Path.PathSeparator + myDomainSetup.PrivateBinPath;
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ + Path.PathSeparator + myDomainSetup.PrivateBinPath;
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"NAntDomain.ShadowCopyDirectories={0}",
- myDomainSetup.ShadowCopyDirectories));
-
+ myDomainSetup.ShadowCopyDirectories);
+
// try to cache in .\cache folder, if that fails, let the system
// figure it out.
string cachePath = Path.Combine(myDomainSetup.ApplicationBase, "cache");
@@ -136,31 +131,28 @@ namespace NAnt.Console {
} finally {
if(cachePathInfo != null) {
myDomainSetup.CachePath = cachePathInfo.FullName;
- }
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ }
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"NAntDomain.CachePath={0}",
- myDomainSetup.CachePath));
+ myDomainSetup.CachePath);
}
// create the domain.
PermissionSet myDomainPermSet = new PermissionSet(PermissionState.Unrestricted);
executionAD = AppDomain.CreateDomain(myDomainSetup.ApplicationName, AppDomain.CurrentDomain.Evidence,
- myDomainSetup, myDomainPermSet);
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ myDomainSetup, myDomainPermSet);
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"NAntDomain.SetupInfo:\n{0}",
- executionAD.SetupInformation));
+ executionAD.SetupInformation);
}
- // use helper object to hold (and serialize) args for callback.
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ // use helper object to hold (and serialize) args for callback.
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"Creating HelperArgs({0})",
- args.ToString()));
-
+ args.ToString());
+
HelperArguments helper = new HelperArguments(args,
privateBinPath);
@@ -168,26 +160,23 @@ namespace NAnt.Console {
// unload if remote/new appdomain
if (!cd.Equals(executionAD)) {
- string cachePath = executionAD.SetupInformation.CachePath;
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ string cachePath = executionAD.SetupInformation.CachePath;
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"Unloading '{0}' AppDomain",
- executionAD.FriendlyName));
-
+ executionAD.FriendlyName);
+
AppDomain.Unload(executionAD);
- if (nantCleanupShadowCopyFilesSetting != null && bool.Parse(nantCleanupShadowCopyFilesSetting) == true) {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ if (nantCleanupShadowCopyFilesSetting != null && bool.Parse(nantCleanupShadowCopyFilesSetting) == true) {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"Unloading '{0}' AppDomain",
- executionAD.FriendlyName));
- try {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ executionAD.FriendlyName);
+ try {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"Cleaning up CacheFiles in '{0}'",
- cachePath));
-
+ cachePath);
+
Directory.Delete(cachePath, true);
} catch (FileNotFoundException ex) {
logger.Error("Files not found.", ex);
@@ -203,12 +192,11 @@ namespace NAnt.Console {
"Return Code null or -1"));
throw new ApplicationException("No return code set!");
- } else {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ } else {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"Return Code = {0}",
- helper.ExitCode));
-
+ helper.ExitCode);
+
return helper.ExitCode;
}
}
@@ -416,9 +404,10 @@ namespace NAnt.Console {
// add framework specific entries to privatebinpath
if (_probePaths != null) {
- foreach (string probePath in _probePaths.Split(Path.PathSeparator)) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture,
- "Adding '{0}' to private bin path.", probePath));
+ foreach (string probePath in _probePaths.Split(Path.PathSeparator)) {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Adding '{0}' to private bin path.",
+ probePath);
AppDomain.CurrentDomain.AppendPrivatePath(probePath);
}
}
@@ -445,12 +434,11 @@ namespace NAnt.Console {
}
// invoke the Main method and pass the command-line arguments as parameter.
- _exitCode = (int) mainMethodInfo.Invoke(null, new object[] {_args});
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ _exitCode = (int) mainMethodInfo.Invoke(null, new object[] {_args});
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
"'{0}' returned {1}",
- mainMethodInfo.ToString(), ExitCode));
+ mainMethodInfo.ToString(), ExitCode);
}
#endregion Public Instance Methods
diff --git a/src/NAnt.Core/Element.cs b/src/NAnt.Core/Element.cs
index 8945448..ac36a0f 100644
--- a/src/NAnt.Core/Element.cs
+++ b/src/NAnt.Core/Element.cs
@@ -828,13 +828,11 @@ namespace NAnt.Core {
Attribute.GetCustomAttribute(propertyInfo, typeof(BuildAttributeAttribute),
false);
- if (buildAttribute != null) {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ if (buildAttribute != null) {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
ResourceUtils.GetString("String_FoundAttribute"),
- buildAttribute.Name,
- propertyInfo.DeclaringType.FullName));
-
+ buildAttribute.Name, propertyInfo.DeclaringType.FullName);
+
if (ElementXml != null) {
// locate attribute in build file
attributeNode = ElementXml.Attributes[buildAttribute.Name];
@@ -845,13 +843,11 @@ namespace NAnt.Core {
UnprocessedAttributes.Remove(attributeNode.Name);
// if we don't process the xml then skip on
- if (!buildAttribute.ProcessXml) {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ if (!buildAttribute.ProcessXml) {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
ResourceUtils.GetString("String_SkippingAttribute"),
- buildAttribute.Name,
- propertyInfo.DeclaringType.FullName));
-
+ buildAttribute.Name, propertyInfo.DeclaringType.FullName);
+
// consider this property done
return true;
}
@@ -898,15 +894,12 @@ namespace NAnt.Core {
// section of the NAnt configuration file
if (attributeNode == null) {
attributeNode = frameworkAttributeNode;
- }
-
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ }
+
+ logger.DebugFormat(CultureInfo.InvariantCulture,
ResourceUtils.GetString("String_SettingValue"),
- propertyInfo.Name,
- attributeValue,
- propertyInfo.DeclaringType.Name));
-
+ propertyInfo.Name, attributeValue, propertyInfo.DeclaringType.Name);
+
if (propertyInfo.CanWrite) {
// get the type of the property
Type propertyType = propertyInfo.PropertyType;
diff --git a/src/NAnt.Core/TargetCollection.cs b/src/NAnt.Core/TargetCollection.cs
index cd41e26..d56fe1f 100644
--- a/src/NAnt.Core/TargetCollection.cs
+++ b/src/NAnt.Core/TargetCollection.cs
@@ -36,11 +36,10 @@ namespace NAnt.Core {
throw new BuildException("Null Target!");
}
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
- ResourceUtils.GetString("String_AddingTarget"),
- t.Name));
-
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ ResourceUtils.GetString("String_AddingTarget"),
+ t.Name);
+
// check for existing target with same name.
if (Find(t.Name) == null) {
return base.Add(t);
diff --git a/src/NAnt.Core/Task.cs b/src/NAnt.Core/Task.cs
index fe8369b..367cc51 100644
--- a/src/NAnt.Core/Task.cs
+++ b/src/NAnt.Core/Task.cs
@@ -167,11 +167,10 @@ namespace NAnt.Core {
/// Executes the task unless it is skipped.
/// </summary>
public void Execute() {
- logger.Debug(string.Format(
- CultureInfo.InvariantCulture,
+ logger.DebugFormat(CultureInfo.InvariantCulture,
ResourceUtils.GetString("String_TaskExecute"),
- Name));
-
+ Name);
+
if (IfDefined && !UnlessDefined) {
try {
Project.OnTaskStarted(this, new BuildEventArgs(this));
diff --git a/src/NAnt.Core/TypeFactory.cs b/src/NAnt.Core/TypeFactory.cs
index bc93901..02ddaef 100644
--- a/src/NAnt.Core/TypeFactory.cs
+++ b/src/NAnt.Core/TypeFactory.cs
@@ -569,11 +569,11 @@ namespace NAnt.Core {
logger.Info(string.Format(CultureInfo.InvariantCulture,
ResourceUtils.GetString("String_CreatingDataTypeBaseBuilder"), type.Name));
DataTypeBaseBuilder dtb = new DataTypeBaseBuilder(extensionAssembly, type.FullName);
- if (DataTypeBuilders[dtb.DataTypeName] == null) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture,
- ResourceUtils.GetString("String_AddingDataType"), dtb.DataTypeName,
- GetAssemblyLocation(dtb.Assembly), dtb.ClassName));
-
+ if (DataTypeBuilders[dtb.DataTypeName] == null) {
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ ResourceUtils.GetString("String_AddingDataType"),
+ dtb.DataTypeName, GetAssemblyLocation(dtb.Assembly), dtb.ClassName);
+
DataTypeBuilders.Add(dtb);
}
diff --git a/src/NAnt.Core/Types/FileSet.cs b/src/NAnt.Core/Types/FileSet.cs
index a603f5c..75eba03 100644
--- a/src/NAnt.Core/Types/FileSet.cs
+++ b/src/NAnt.Core/Types/FileSet.cs
@@ -484,13 +484,19 @@ namespace NAnt.Core.Types {
foreach (Include include in value) {
if (include.IfDefined && !include.UnlessDefined) {
if (include.AsIs) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Including AsIs=", include.Pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Including AsIs=",
+ include.Pattern);
AsIs.Add(include.Pattern);
} else if (include.FromPath) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Including FromPath=", include.Pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Including FromPath=",
+ include.Pattern);
PathFiles.Add(include.Pattern);
} else {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Including pattern", include.Pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Including pattern",
+ include.Pattern);
Includes.Add(include.Pattern);
}
}
@@ -515,7 +521,9 @@ namespace NAnt.Core.Types {
set {
foreach (Exclude exclude in value) {
if (exclude.IfDefined && !exclude.UnlessDefined) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Excluding pattern", exclude.Pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Excluding pattern",
+ exclude.Pattern);
Excludes.Add(exclude.Pattern);
}
}
@@ -545,17 +553,23 @@ namespace NAnt.Core.Types {
if (includesFile.IfDefined && !includesFile.UnlessDefined) {
if (includesFile.AsIs) {
foreach (string pattern in includesFile.Patterns) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Including AsIs=", pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Including AsIs=",
+ pattern);
AsIs.Add(pattern);
}
} else if (includesFile.FromPath) {
foreach (string pattern in includesFile.Patterns) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Including FromPath=", pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Including FromPath=",
+ pattern);
PathFiles.Add(pattern);
}
} else {
foreach (string pattern in includesFile.Patterns) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Including Pattern=", pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Including Pattern=",
+ pattern);
Includes.Add(pattern);
}
}
@@ -574,7 +588,9 @@ namespace NAnt.Core.Types {
foreach (ExcludesFile excludesFile in value) {
if (excludesFile.IfDefined && !excludesFile.UnlessDefined) {
foreach (string pattern in excludesFile.Patterns) {
- logger.Debug(string.Format(CultureInfo.InvariantCulture, "Excluding=", pattern));
+ logger.DebugFormat(CultureInfo.InvariantCulture,
+ "Excluding=",
+ pattern);
Excludes.Add(pattern);
}
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:11
|
From: imakowski <ima...@gm...>
---
src/NAnt.Compression/Tasks/ExpandBaseTask.cs | 2 +-
src/NAnt.Core/Log.cs | 2 +-
src/NAnt.Core/Project.cs | 4 ++--
src/NAnt.VSNet/VcProject.cs | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/NAnt.Compression/Tasks/ExpandBaseTask.cs b/src/NAnt.Compression/Tasks/ExpandBaseTask.cs
index 60448a8..373e4d2 100644
--- a/src/NAnt.Compression/Tasks/ExpandBaseTask.cs
+++ b/src/NAnt.Compression/Tasks/ExpandBaseTask.cs
@@ -90,7 +90,7 @@ namespace NAnt.Compression.Tasks {
// extract the entry
using (FileStream sw = new FileStream(destFile.FullName, FileMode.Create, FileAccess.Write)) {
int size = 2048;
- byte[] data = new byte[2048];
+ byte[] data = new byte[size];
while (true) {
size = inputStream.Read(data, 0, data.Length);
diff --git a/src/NAnt.Core/Log.cs b/src/NAnt.Core/Log.cs
index e5a140c..700f4b9 100644
--- a/src/NAnt.Core/Log.cs
+++ b/src/NAnt.Core/Log.cs
@@ -688,7 +688,7 @@ namespace NAnt.Core {
string label = String.Empty;
if (e.Task != null && !EmacsMode) {
- label = "[" + (e.Target == null ? string.Empty : e.Target.Name + " ") + e.Task.Name + "] ";
+ label = string.Format("[{0}{1}] ", (e.Target == null ? string.Empty : e.Target.Name + " "), e.Task.Name);
label = label.PadLeft(e.Project.IndentationSize);
}
diff --git a/src/NAnt.Core/Project.cs b/src/NAnt.Core/Project.cs
index a5082b3..e2d62ab 100644
--- a/src/NAnt.Core/Project.cs
+++ b/src/NAnt.Core/Project.cs
@@ -1698,7 +1698,7 @@ namespace NAnt.Core {
// dependency tree, not just on the Targets that depend on the
// build Target.
TopologicalTargetSort(root, targets, state, visiting, executeTargets);
- Log(Level.Debug, "Build sequence for target `" + root + "' is " + executeTargets);
+ Log(Level.Debug, "Build sequence for target `{0}' is {1}", root, executeTargets);
foreach (Target target in targets) {
string st = (string) state[target.Name];
@@ -1709,7 +1709,7 @@ namespace NAnt.Core {
}
}
- Log(Level.Debug, "Complete build sequence is " + executeTargets);
+ Log(Level.Debug, "Complete build sequence is {0}", executeTargets);
return executeTargets;
}
diff --git a/src/NAnt.VSNet/VcProject.cs b/src/NAnt.VSNet/VcProject.cs
index 6943194..6eb7e90 100644
--- a/src/NAnt.VSNet/VcProject.cs
+++ b/src/NAnt.VSNet/VcProject.cs
@@ -1507,7 +1507,7 @@ namespace NAnt.VSNet {
string mapFileName = projectConfig.GetToolSetting(VcConfigurationBase.LinkerTool, "MapFileName");
if (!String.IsNullOrEmpty(mapFileName)) {
- mapArg.Line = "/MAP:" + LinkTask.QuoteArgumentValue(mapFileName);;
+ mapArg.Line = "/MAP:" + LinkTask.QuoteArgumentValue(mapFileName);
} else {
mapArg.Line = "/MAP";
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:11
|
From: imakowski <ima...@gm...>
---
src/NAnt.Core/ConsoleDriver.cs | 43 ++++++++++++++++---------------
src/NAnt.Core/Project.cs | 9 ++++--
src/NAnt.Core/Types/FileSet.cs | 8 +++--
src/NAnt.Core/XmlLogger.cs | 8 +----
src/NAnt.VSNet/ProjectReferenceBase.cs | 2 +-
5 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/src/NAnt.Core/ConsoleDriver.cs b/src/NAnt.Core/ConsoleDriver.cs
index a4ec06d..6b313f4 100755
--- a/src/NAnt.Core/ConsoleDriver.cs
+++ b/src/NAnt.Core/ConsoleDriver.cs
@@ -423,17 +423,18 @@ namespace NAnt.Core {
if (loggerType == null) {
throw new TypeLoadException(string.Format(CultureInfo.InvariantCulture,
ResourceUtils.GetString("NA1006"), typeName));
- }
-
- object buildLogger = Activator.CreateInstance(loggerType);
-
- if (!typeof(IBuildLogger).IsAssignableFrom(buildLogger.GetType())) {
- throw new ArgumentException(
- string.Format(CultureInfo.InvariantCulture, "{0} does not implement {1}.",
- buildLogger.GetType().FullName, typeof(IBuildLogger).FullName));
- }
-
- return (IBuildLogger) buildLogger;
+ }
+
+ object logger = Activator.CreateInstance(loggerType);
+
+ IBuildLogger buildLogger = logger as IBuildLogger;
+
+ if (buildLogger != null)
+ return buildLogger;
+
+ throw new ArgumentException(
+ string.Format(CultureInfo.InvariantCulture, "{0} does not implement {1}.",
+ logger.GetType().FullName, typeof(IBuildLogger).FullName));
}
/// <summary>
@@ -457,15 +458,15 @@ namespace NAnt.Core {
ResourceUtils.GetString("NA1006"), typeName));
}
- object buildListener = Activator.CreateInstance(listenerType);
-
- if (!typeof(IBuildListener).IsAssignableFrom(buildListener.GetType())) {
- throw new ArgumentException(
- string.Format(CultureInfo.InvariantCulture, "{0} does not implement {1}.",
- buildListener.GetType().FullName, typeof(IBuildListener).FullName));
- }
-
- return (IBuildListener) buildListener;
+ object listener = Activator.CreateInstance(listenerType);
+
+ IBuildListener buildListener = listener as IBuildListener;
+ if (buildListener != null)
+ return buildListener;
+
+ throw new ArgumentException(
+ string.Format(CultureInfo.InvariantCulture, "{0} does not implement {1}.",
+ listener.GetType().FullName, typeof(IBuildListener).FullName));
}
#endregion Public Static Methods
@@ -514,7 +515,7 @@ namespace NAnt.Core {
// DefaultLogger, or if logfile was specified on command-line.
// Setting the OutputWriter of the DefaultLogger to Console.Out
// would cause issues with unit tests.
- if (!typeof(DefaultLogger).IsAssignableFrom(buildLogger.GetType()) || cmdlineOptions.LogFile != null) {
+ if (!(buildLogger is DefaultLogger) || cmdlineOptions.LogFile != null) {
buildLogger.OutputWriter = outputWriter;
}
diff --git a/src/NAnt.Core/Project.cs b/src/NAnt.Core/Project.cs
index 9b9fa0c..a5082b3 100644
--- a/src/NAnt.Core/Project.cs
+++ b/src/NAnt.Core/Project.cs
@@ -1335,9 +1335,12 @@ namespace NAnt.Core {
TargetFinished -= new BuildEventHandler(listener.TargetFinished);
TaskStarted -= new BuildEventHandler(listener.TaskStarted);
TaskFinished -= new BuildEventHandler(listener.TaskFinished);
- MessageLogged -= new BuildEventHandler(listener.MessageLogged);
- if (typeof(IBuildLogger).IsAssignableFrom(listener.GetType())) {
- ((IBuildLogger)listener).Flush();
+ MessageLogged -= new BuildEventHandler(listener.MessageLogged);
+
+ IBuildLogger buildLogger = listener as IBuildLogger;
+
+ if (buildLogger != null) {
+ buildLogger.Flush();
}
}
diff --git a/src/NAnt.Core/Types/FileSet.cs b/src/NAnt.Core/Types/FileSet.cs
index 8e805c1..a603f5c 100644
--- a/src/NAnt.Core/Types/FileSet.cs
+++ b/src/NAnt.Core/Types/FileSet.cs
@@ -308,9 +308,11 @@ namespace NAnt.Core.Types {
[TaskAttribute("basedir")]
public virtual DirectoryInfo BaseDirectory {
get {
- if (_baseDirectory == null) {
- if (Parent != null && typeof(FileSet).IsAssignableFrom(Parent.GetType())) {
- return ((FileSet) Parent).BaseDirectory;
+ if (_baseDirectory == null)
+ {
+ FileSet parent = Parent as FileSet;
+ if (parent != null) {
+ return parent.BaseDirectory;
} else if (Project != null) {
return new DirectoryInfo(Project.BaseDirectory);
}
diff --git a/src/NAnt.Core/XmlLogger.cs b/src/NAnt.Core/XmlLogger.cs
index 456fd98..fc4a4bc 100644
--- a/src/NAnt.Core/XmlLogger.cs
+++ b/src/NAnt.Core/XmlLogger.cs
@@ -389,12 +389,8 @@ namespace NAnt.Core {
// build success
return;
}
- else {
- BuildException buildException = null;
-
- if (typeof (BuildException).IsAssignableFrom(exception.GetType())) {
- buildException = (BuildException) exception;
- }
+ else {
+ BuildException buildException = exception as BuildException;
if (buildException != null) {
// start build error node
diff --git a/src/NAnt.VSNet/ProjectReferenceBase.cs b/src/NAnt.VSNet/ProjectReferenceBase.cs
index d1d080f..d4aa1e2 100644
--- a/src/NAnt.VSNet/ProjectReferenceBase.cs
+++ b/src/NAnt.VSNet/ProjectReferenceBase.cs
@@ -143,7 +143,7 @@ namespace NAnt.VSNet {
StringCollection assemblyReferences = null;
// check if parent is a VB.NET project
- if (typeof(VBProject).IsAssignableFrom(Parent.GetType())) {
+ if (Parent is VBProject) {
assemblyReferences = Project.GetAssemblyReferences(solutionConfiguration);
} else {
assemblyReferences = new StringCollection();
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:11
|
From: imakowski <ima...@gm...>
---
src/NAnt.Console/ConsoleStub.cs | 11 +++++------
src/NAnt.Core/Element.cs | 16 ++++++++--------
src/NAnt.Core/Task.cs | 5 ++---
src/NAnt.Core/Tasks/NAntSchemaTask.cs | 7 +++++--
src/NAnt.Core/TypeFactory.cs | 7 ++++---
src/NAnt.Core/Types/FileSet.cs | 16 ++++++++++++----
6 files changed, 36 insertions(+), 26 deletions(-)
diff --git a/src/NAnt.Console/ConsoleStub.cs b/src/NAnt.Console/ConsoleStub.cs
index 7caa380..f70d0fa 100644
--- a/src/NAnt.Console/ConsoleStub.cs
+++ b/src/NAnt.Console/ConsoleStub.cs
@@ -415,13 +415,12 @@ namespace NAnt.Console {
MethodInfo mainMethodInfo = null;
//load the core by name!
- Assembly nantCore = AppDomain.CurrentDomain.Load("NAnt.Core");
-
- logger.Info(string.Format(
- CultureInfo.InvariantCulture,
+ Assembly nantCore = AppDomain.CurrentDomain.Load("NAnt.Core");
+
+ logger.InfoFormat(CultureInfo.InvariantCulture,
"NAnt.Core Loaded: {0}",
- nantCore.FullName));
-
+ nantCore.FullName);
+
//get the ConsoleDriver by name
Type consoleDriverType = nantCore.GetType("NAnt.Core.ConsoleDriver", true, true);
diff --git a/src/NAnt.Core/Element.cs b/src/NAnt.Core/Element.cs
index ac36a0f..c445158 100644
--- a/src/NAnt.Core/Element.cs
+++ b/src/NAnt.Core/Element.cs
@@ -908,13 +908,11 @@ namespace NAnt.Core {
object[] validateAttributes = (ValidatorAttribute[])
Attribute.GetCustomAttributes(propertyInfo, typeof(ValidatorAttribute));
try {
- foreach (ValidatorAttribute validator in validateAttributes) {
- logger.Info(string.Format(
- CultureInfo.InvariantCulture,
+ foreach (ValidatorAttribute validator in validateAttributes) {
+ logger.InfoFormat(CultureInfo.InvariantCulture,
ResourceUtils.GetString("String_ValidatingElement"),
- validator.GetType().Name, ElementXml.Name,
- attributeNode.Name));
-
+ validator.GetType().Name, ElementXml.Name, attributeNode.Name);
+
validator.Validate(attributeValue);
}
} catch (ValidationException ve) {
@@ -1456,8 +1454,10 @@ namespace NAnt.Core {
Element.GetType().FullName), Location);
} else {
// fake the getter as null so we process the rest like there is no getter
- getter = null;
- logger.Info(string.Format(CultureInfo.InvariantCulture,"{0}_get() returned null; will go the route of set method to populate.", propInf.Name));
+ getter = null;
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ "{0}_get() returned null; will go the route of set method to populate.",
+ propInf.Name);
}
} else {
elementType = childElement.GetType();
diff --git a/src/NAnt.Core/Task.cs b/src/NAnt.Core/Task.cs
index 367cc51..38b65f5 100644
--- a/src/NAnt.Core/Task.cs
+++ b/src/NAnt.Core/Task.cs
@@ -368,10 +368,9 @@ namespace NAnt.Core {
Attribute.GetCustomAttributes(propertyInfo, typeof(ValidatorAttribute));
try {
foreach (ValidatorAttribute validator in validateAttributes) {
- logger.Info(string.Format(
- CultureInfo.InvariantCulture,
+ logger.InfoFormat(CultureInfo.InvariantCulture,
ResourceUtils.GetString("NA1074"),
- attributeValue, Name, validator.GetType().Name));
+ attributeValue, Name, validator.GetType().Name);
validator.Validate(attributeValue);
}
diff --git a/src/NAnt.Core/Tasks/NAntSchemaTask.cs b/src/NAnt.Core/Tasks/NAntSchemaTask.cs
index 8703073..c7c48e2 100755
--- a/src/NAnt.Core/Tasks/NAntSchemaTask.cs
+++ b/src/NAnt.Core/Tasks/NAntSchemaTask.cs
@@ -470,8 +470,11 @@ namespace NAnt.Core.Tasks {
logger.Info(args.ToString());
- if (source != null) {
- logger.Info(string.Format(CultureInfo.InvariantCulture, "{0}", source.Name));
+ if (source != null)
+ {
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ "{0}",
+ source.Name);
}
}
diff --git a/src/NAnt.Core/TypeFactory.cs b/src/NAnt.Core/TypeFactory.cs
index 02ddaef..91e35f9 100644
--- a/src/NAnt.Core/TypeFactory.cs
+++ b/src/NAnt.Core/TypeFactory.cs
@@ -565,9 +565,10 @@ namespace NAnt.Core {
ElementNameAttribute elementNameAttribute = (ElementNameAttribute)
Attribute.GetCustomAttribute(type, typeof(ElementNameAttribute));
- if (type.IsSubclassOf(typeof(DataTypeBase)) && !type.IsAbstract && elementNameAttribute != null) {
- logger.Info(string.Format(CultureInfo.InvariantCulture,
- ResourceUtils.GetString("String_CreatingDataTypeBaseBuilder"), type.Name));
+ if (type.IsSubclassOf(typeof(DataTypeBase)) && !type.IsAbstract && elementNameAttribute != null) {
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ ResourceUtils.GetString("String_CreatingDataTypeBaseBuilder"),
+ type.Name);
DataTypeBaseBuilder dtb = new DataTypeBaseBuilder(extensionAssembly, type.FullName);
if (DataTypeBuilders[dtb.DataTypeName] == null) {
logger.DebugFormat(CultureInfo.InvariantCulture,
diff --git a/src/NAnt.Core/Types/FileSet.cs b/src/NAnt.Core/Types/FileSet.cs
index 75eba03..d9610a2 100644
--- a/src/NAnt.Core/Types/FileSet.cs
+++ b/src/NAnt.Core/Types/FileSet.cs
@@ -614,11 +614,15 @@ namespace NAnt.Core.Types {
newestFile = fileInfo;
}
if (!fileInfo.Exists) {
- logger.Info(string.Format(CultureInfo.InvariantCulture, "File '{0}' does not exist (and is not newer than {1})", fileName, newestFile));
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ "File '{0}' does not exist (and is not newer than {1})",
+ fileName, newestFile);
continue;
}
if (newestFile != null && fileInfo.LastWriteTime > newestFile.LastWriteTime) {
- logger.Info(string.Format(CultureInfo.InvariantCulture, "'{0}' was newer than {1}", fileName, newestFile));
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ "'{0}' was newer than {1}",
+ fileName, newestFile);
newestFile = fileInfo;
}
}
@@ -847,11 +851,15 @@ namespace NAnt.Core.Types {
if (Path.IsPathRooted(fileName)) {
FileInfo fileInfo = new FileInfo(fileName);
if (!fileInfo.Exists) {
- logger.Info(string.Format(CultureInfo.InvariantCulture, "File '{0}' no longer exist (so the target might need to be updated)", fileName, targetLastWriteTime));
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ "File '{0}' no longer exist (so the target might need to be updated)",
+ fileName, targetLastWriteTime);
return fileName;
}
if (fileInfo.LastWriteTime > targetLastWriteTime) {
- logger.Info(string.Format(CultureInfo.InvariantCulture, "'{0}' was newer than {1}", fileName, targetLastWriteTime));
+ logger.InfoFormat(CultureInfo.InvariantCulture,
+ "'{0}' was newer than {1}",
+ fileName, targetLastWriteTime);
return fileName;
}
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-04-21 01:10:10
|
From: imakowski <ima...@gm...>
---
.../Attributes/StringValidatorAttribute.cs | 2 +-
src/NAnt.Core/TypeFactory.cs | 2 +-
src/NAnt.SourceControl/Tasks/RTagTask.cs | 2 +-
src/NAnt.SourceControl/Tasks/TagTask.cs | 2 +-
src/NAnt.VSNet/SolutionBase.cs | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/NAnt.Core/Attributes/StringValidatorAttribute.cs b/src/NAnt.Core/Attributes/StringValidatorAttribute.cs
index 5c9d7a8..523686d 100644
--- a/src/NAnt.Core/Attributes/StringValidatorAttribute.cs
+++ b/src/NAnt.Core/Attributes/StringValidatorAttribute.cs
@@ -113,7 +113,7 @@ namespace NAnt.Core.Attributes {
string msg = string.Format("String {0} does not match expression {1}.",
value, Expression);
if (null != this.ExpressionErrorMessage &&
- string.Empty != this.ExpressionErrorMessage) {
+ this.ExpressionErrorMessage.Length > 0) {
msg = this.ExpressionErrorMessage;
}
throw new ValidationException(msg);
diff --git a/src/NAnt.Core/TypeFactory.cs b/src/NAnt.Core/TypeFactory.cs
index 38533b1..bc93901 100644
--- a/src/NAnt.Core/TypeFactory.cs
+++ b/src/NAnt.Core/TypeFactory.cs
@@ -616,7 +616,7 @@ namespace NAnt.Core {
if (acceptType) {
string prefix = functionSetAttribute.Prefix;
- if (prefix != null && prefix != String.Empty) {
+ if (prefix != null && prefix.Length > 0) {
prefix += "::";
} else {
task.Log(Level.Warning, "Ignoring functions in type \"{0}\":"
diff --git a/src/NAnt.SourceControl/Tasks/RTagTask.cs b/src/NAnt.SourceControl/Tasks/RTagTask.cs
index 819152a..909d416 100644
--- a/src/NAnt.SourceControl/Tasks/RTagTask.cs
+++ b/src/NAnt.SourceControl/Tasks/RTagTask.cs
@@ -214,7 +214,7 @@ namespace NAnt.SourceControl.Tasks {
/// </summary>
protected override void AppendSubCommandArgs() {
base.AppendSubCommandArgs ();
- if (this.Tag != null && this.Tag != string.Empty) {
+ if (this.Tag != null && this.Tag.Length > 0) {
this.AddArg(this.Tag);
}
}
diff --git a/src/NAnt.SourceControl/Tasks/TagTask.cs b/src/NAnt.SourceControl/Tasks/TagTask.cs
index 0536be3..81ae4f2 100644
--- a/src/NAnt.SourceControl/Tasks/TagTask.cs
+++ b/src/NAnt.SourceControl/Tasks/TagTask.cs
@@ -240,7 +240,7 @@ namespace NAnt.SourceControl.Tasks {
/// </summary>
protected override void AppendSubCommandArgs() {
base.AppendSubCommandArgs ();
- if (this.Tag != null && this.Tag != string.Empty) {
+ if (this.Tag != null && this.Tag.Length > 0) {
this.AddArg(this.Tag);
}
}
diff --git a/src/NAnt.VSNet/SolutionBase.cs b/src/NAnt.VSNet/SolutionBase.cs
index 111e8a7..2db6d1f 100644
--- a/src/NAnt.VSNet/SolutionBase.cs
+++ b/src/NAnt.VSNet/SolutionBase.cs
@@ -396,7 +396,7 @@ namespace NAnt.VSNet {
// skip the project
continue;
}
- if (p.Guid == null || p.Guid == string.Empty) {
+ if (p.Guid == null || p.Guid.Length == 0) {
p.Guid = FindGuidFromPath(projectPath);
}
--
1.7.7
|
|
From: <nan...@na...> - 2015-03-31 20:37:55
|
From: Josh McCullough <jos...@gm...>
---
src/NAnt.Core/Functions/AssemblyFunctions.cs | 47 +++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/src/NAnt.Core/Functions/AssemblyFunctions.cs b/src/NAnt.Core/Functions/AssemblyFunctions.cs
index 6e0f19d..93e764c 100644
--- a/src/NAnt.Core/Functions/AssemblyFunctions.cs
+++ b/src/NAnt.Core/Functions/AssemblyFunctions.cs
@@ -125,7 +125,52 @@ namespace NAnt.Core.Functions {
/// </returns>
[Function("get-location")]
public static string GetLocation(Assembly assembly) {
- return assembly.Location;
+ return assembly.Location;
+ }
+
+ /// <summary>
+ /// Gets the value of the <see cref="AssemblyInformationalVersionAttribute"/> for the specified assembly.
+ /// </summary>
+ /// <param name="assembly">The assembly to get an <see cref="AssemblyInformationalVersionAttribute"/> for.</param>
+ /// <returns>The InformationalVersion from the <see cref="AssemblyInformationalVersionAttribute"/>.</returns>
+ [Function("get-informational-version")]
+ public static string GetInformationalVersion(Assembly assembly) {
+ return GetAttributeProperty(assembly, typeof(AssemblyInformationalVersionAttribute), "InformationalVersion");
+ }
+
+ /// <summary>
+ /// Gets a custom attribute from the specified assembly.
+ /// </summary>
+ /// <param name="assembly">The assembly from which to get the custom attribute.</param>
+ /// <param name="attributeAssemblyPath">The assembly which contains the custom attribute type.</param>
+ /// <param name="attributeTypeName">The name of the custom attribute type.</param>
+ /// <param name="propertyName">The name of the property to retreive from the custom attribute instance.</param>
+ /// <returns>The specified property from the custom attribute, as a string.</returns>
+ [Function("get-attribute-property")]
+ public static string GetAttributeProperty(Assembly assembly, string attributeAssemblyPath, string attributeTypeName, string propertyName) {
+ Assembly attributeAssembly = Assembly.LoadFile(attributeAssemblyPath);
+
+ return GetAttributeProperty(assembly, attributeAssembly, attributeTypeName, propertyName);
+ }
+
+ private static string GetAttributeProperty(Assembly assembly, Assembly attributeAssembly, string attributeTypeName, string propertyName) {
+ Type attributeType = attributeAssembly.GetType(attributeTypeName, true);
+
+ return GetAttributeProperty(assembly, attributeType, propertyName);
+ }
+
+ private static string GetAttributeProperty(Assembly assembly, Type attributeType, string propertyName) {
+ PropertyInfo property = attributeType.GetProperty(propertyName, BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static);
+ object[] attributes = assembly.GetCustomAttributes(attributeType, true);
+
+ if (attributes != null && attributes.Length > 0) {
+ object attribute = attributes[0];
+ object value = property.GetValue(attribute, null);
+
+ return Convert.ToString(value);
+ }
+
+ return null;
}
#endregion Public Static Methods
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-12 01:20:09
|
From: Ryan Boggs <rm...@gm...>
---
src/NAnt.Core/Element.cs | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/NAnt.Core/Element.cs b/src/NAnt.Core/Element.cs
index 373618c..8945448 100644
--- a/src/NAnt.Core/Element.cs
+++ b/src/NAnt.Core/Element.cs
@@ -312,7 +312,16 @@ namespace NAnt.Core {
}
InitializeXml(elementNode, properties, framework);
-
+
+ // If the current instance implements IConditional, check to make sure
+ // that IfDefined is true and UnlessDefined is false before initializing
+ // the rest of this instance
+ IConditional c = this as IConditional;
+ if (c != null && !(c.IfDefined && !c.UnlessDefined))
+ {
+ return;
+ }
+
// allow inherited classes a chance to do some custom initialization
InitializeElement(elementNode);
Initialize();
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-07 11:00:10
|
From: Charles Chan <cha...@us...> Fix URL to TeamCity project page. --- README.md | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d378d89..065473b 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ Files Compilation and Installation ============================ -* Windows (net-2.0): [](teamcity.codebetter.com/project.html?projectId=NAnt&guest=1) -* Windows (mono-2.0): [](teamcity.codebetter.com/project.html?projectId=NAnt&guest=1) +* Windows (net-2.0): [](http://teamcity.codebetter.com/project.html?projectId=NAnt&guest=1) +* Windows (mono-2.0): [](http://teamcity.codebetter.com/project.html?projectId=NAnt&guest=1) * Linux: [](https://travis-ci.org/nant/nant) Overview -- 1.7.7 |
|
From: <nan...@na...> - 2015-02-06 03:40:10
|
From: Dominik Guder <os...@gu...> --- README.md | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/README.md b/README.md index 6c57017..d378d89 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,10 @@ Files Compilation and Installation ============================ - +* Windows (net-2.0): [](teamcity.codebetter.com/project.html?projectId=NAnt&guest=1) +* Windows (mono-2.0): [](teamcity.codebetter.com/project.html?projectId=NAnt&guest=1) +* Linux: [](https://travis-ci.org/nant/nant) + Overview -------- The compilation process uses NAnt to build NAnt. -- 1.7.7 |
|
From: <nan...@na...> - 2015-02-03 01:40:09
|
From: Ryan Boggs <rm...@gm...>
---
doc/releasenotes.html | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/doc/releasenotes.html b/doc/releasenotes.html
index 07ca886..c06fcf6 100644
--- a/doc/releasenotes.html
+++ b/doc/releasenotes.html
@@ -55,6 +55,16 @@
<h3>Bug Fixes</h3>
<h4>Tasks</h4>
<div style="margin-left: 20px;">
+ <h5><a class="heading" href="help/tasks/">Tasks</a></h5>
+ <div style="margin-left: 20px;">
+ <p>
+ Make sure that the <c>if</c> and <c>unless</c> attributes are evaluated
+ before trying to expand properties elsewhere within the task.
+ (Issue <a href="https://github.com/nant/nant/issues/110">#110</a>)
+ </p>
+ </div>
+ </div>
+ <div style="margin-left: 20px;">
<h5><a class="heading" href="help/tasks/foreach.html">Foreach</a></h5>
<div style="margin-left: 20px;">
<p>
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-03 01:30:18
|
From: Ryan Boggs <rm...@gm...>
---
NAnt.build | 47 ++++++++++----------
src/NAnt.DotNet/NAnt.DotNet.build | 11 ++---
.../NDoc.Documenter.NAnt.build | 7 +--
tests/NAnt.Compression/NAnt.Compression.build | 11 ++---
tests/NAnt.Console/NAnt.Console.build | 9 ++--
tests/NAnt.Core/NAnt.Core.build | 9 ++--
tests/NAnt.DotNet/NAnt.DotNet.build | 11 ++---
tests/NAnt.MSNet/NAnt.MSNet.build | 9 ++--
tests/NAnt.SourceControl/NAnt.SourceControl.build | 9 ++--
tests/NAnt.VSNet/NAnt.VSNet.build | 11 ++---
tests/NAnt.VisualCpp/NAnt.VisualCpp.build | 11 ++---
tests/NAnt.Win32/NAnt.Win32.build | 11 ++---
12 files changed, 72 insertions(+), 84 deletions(-)
diff --git a/NAnt.build b/NAnt.build
index 68cc47d..599137f 100644
--- a/NAnt.build
+++ b/NAnt.build
@@ -88,7 +88,6 @@
<target name="init" description="Initializes build properties">
<call target="${project.config}" />
<call target="set-framework-configuration" />
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}"/>
</target>
<target name="create-common-assemblyinfo" if="${create.assemblyinfo}">
<!-- ensure src/CommonAssemblyInfo.cs is writable if it already exists -->
@@ -129,16 +128,16 @@
<target name="build.common" depends="init, create-common-assemblyinfo">
<echo message="Build Directory is ${build.dir}" />
<!-- ensure bin directory exists -->
- <mkdir dir="${build.dir.bin}" />
+ <mkdir dir="${build.dir}/bin" />
<!-- ensure lib directory exists -->
- <mkdir dir="${build.dir.bin}/lib" />
+ <mkdir dir="${build.dir}/bin/lib" />
<!-- copy third party executables -->
- <copy todir="${build.dir.bin}">
+ <copy todir="${build.dir}/bin">
<fileset basedir="bin">
<include name="scvs.exe" />
</fileset>
</copy>
- <copy todir="${build.dir.bin}">
+ <copy todir="${build.dir}/bin">
<fileset basedir="lib/common/neutral">
<!-- copy log4net assembly, workaround for Mono bug #57602 -->
<include name="log4net.dll" />
@@ -147,7 +146,7 @@
</fileset>
</copy>
<!-- copy third party assemblies -->
- <copy todir="${build.dir.bin}/lib">
+ <copy todir="${build.dir}/bin/lib">
<fileset basedir="lib">
<include name="**/*" />
<exclude name="common/neutral/log4net.dll" />
@@ -207,7 +206,7 @@
<!-- test the newly built NAnt -->
<target name="test" depends="build" description="Tests current configuration">
<echo message="Running unit tests with just built version of NAnt." />
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -217,7 +216,7 @@
</exec>
</target>
<target name="test-core" depends="build">
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -227,7 +226,7 @@
</exec>
</target>
<target name="test-dotnet" depends="build">
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -237,7 +236,7 @@
</exec>
</target>
<target name="test-sourcecontrol" depends="build">
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -247,7 +246,7 @@
</exec>
</target>
<target name="test-visualcpp" depends="build">
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -257,7 +256,7 @@
</exec>
</target>
<target name="test-compression" depends="build">
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -338,8 +337,8 @@
<!-- generate user documentation -->
<target name="userdoc" depends="build" description="Builds user documentation">
- <echo message="Creating task and type documentation from ${build.dir.bin}" />
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <echo message="Creating task and type documentation from ${build.dir}/bin" />
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
@@ -355,7 +354,7 @@
<targetfiles>
<include name="${build.dir}/doc/help/*.html" />
</targetfiles>
- <sourcefiles basedir="${build.dir.bin}">
+ <sourcefiles basedir="${build.dir}/bin">
<!-- make sure the tasks/types are not new -->
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
@@ -366,7 +365,7 @@
</uptodate>
<if test="${not(help.uptodate)}">
<ndoc>
- <assemblies basedir="${build.dir.bin}">
+ <assemblies basedir="${build.dir}/bin">
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
@@ -407,8 +406,8 @@
<echo message="User documentation: file://${build.dir}/doc/index.html" />
</target>
<target name="sdkdoc" depends="build" description="Builds SDK documentation">
- <echo message="Creating SDK Documentation for ${build.dir.bin}/${nant.console.name}.exe" />
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <echo message="Creating SDK Documentation for ${build.dir}/bin/${nant.console.name}.exe" />
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
@@ -424,7 +423,7 @@
<targetfiles>
<include name="${build.dir}/doc/sdk/*.chm" />
</targetfiles>
- <sourcefiles basedir="${build.dir.bin}">
+ <sourcefiles basedir="${build.dir}/bin">
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
@@ -434,7 +433,7 @@
</uptodate>
<if test="${not(sdk.uptodate)}">
<ndoc>
- <assemblies basedir="${build.dir.bin}">
+ <assemblies basedir="${build.dir}/bin">
<include name="NAnt.Core.dll" />
<include name="NAnt.*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
@@ -500,7 +499,7 @@
</target>
<target name="schema" depends="build">
- <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -557,10 +556,10 @@
<target name="package-common" depends="test, userdoc, sdkdoc, schema">
<!-- move config file -->
- <move file="${build.dir.bin}/NAnt.exe.config" tofile="${build.dir.bin}/${nant.console.name}.exe.config" />
+ <move file="${build.dir}/bin/NAnt.exe.config" tofile="${build.dir}/bin/${nant.console.name}.exe.config" />
<!-- remove non-release files -->
<delete>
- <fileset basedir="${build.dir.bin}">
+ <fileset basedir="${build.dir}/bin">
<include name="NAnt.Console.*" />
<!-- remove test assemblies -->
<include name="*.Tests.*" />
@@ -757,7 +756,7 @@
</fileset>
</delete>
<copy todir="bin" overwrite="true">
- <fileset basedir="${build.dir.bin}/">
+ <fileset basedir="${build.dir}/bin/">
<include name="NAnt*" />
<exclude name="*Test*" />
<exclude name="${nant.console.name}.xml" />
diff --git a/src/NAnt.DotNet/NAnt.DotNet.build b/src/NAnt.DotNet/NAnt.DotNet.build
index 5d03069..7c6bea9 100644
--- a/src/NAnt.DotNet/NAnt.DotNet.build
+++ b/src/NAnt.DotNet/NAnt.DotNet.build
@@ -8,9 +8,8 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build main assembly -->
- <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir.bin}/${project::get-name()}Tasks.dll" doc="${build.dir.bin}/${project::get-name()}Tasks.xml">
+ <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}Tasks.dll" doc="${build.dir}/bin/${project::get-name()}Tasks.xml">
<nowarn>
<!-- do not report deprecation warnings -->
<warning number="0612" />
@@ -21,10 +20,10 @@
<!-- common assembly-level attributes -->
<include name="../CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.ExtendedUI.dll')}" />
- <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.Core.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${nant::scan-probing-paths(build.dir + '/bin','NDoc.ExtendedUI.dll')}" />
+ <include name="${nant::scan-probing-paths(build.dir + '/bin','NDoc.Core.dll')}" />
</references>
<resources prefix="NAnt.DotNet" dynamicprefix="true">
<include name="Resources/**/*" />
diff --git a/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build b/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
index b15f6d9..2de6374 100644
--- a/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
+++ b/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
@@ -8,7 +8,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build main assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.dll" doc="${build.dir}/bin/${project::get-name()}.xml">
<nowarn>
@@ -23,10 +22,10 @@
<include name="*.cs" />
<include name="../CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}" failonempty="true">
+ <references basedir="${build.dir}/bin" failonempty="true">
<include name="NAnt.Core.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.ExtendedUI.dll')}" />
- <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.Core.dll')}" />
+ <include name="${nant::scan-probing-paths('NDoc.ExtendedUI.dll')}" />
+ <include name="${nant::scan-probing-paths('NDoc.Core.dll')}" />
<include name="System.Web.dll" />
</references>
<resources basedir="Resources" prefix="Documenter.xslt.">
diff --git a/tests/NAnt.Compression/NAnt.Compression.build b/tests/NAnt.Compression/NAnt.Compression.build
index e0dae2c..ec104e8 100644
--- a/tests/NAnt.Compression/NAnt.Compression.build
+++ b/tests/NAnt.Compression/NAnt.Compression.build
@@ -6,8 +6,7 @@
* build.debug - (true|false) debug build?
* current.build.defines - framework-specific build defines
-->
- <target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
+ <target name="build">
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -19,10 +18,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.Console/NAnt.Console.build b/tests/NAnt.Console/NAnt.Console.build
index ad0c943..4e2e27b 100644
--- a/tests/NAnt.Console/NAnt.Console.build
+++ b/tests/NAnt.Console/NAnt.Console.build
@@ -8,7 +8,6 @@
* nant.console.name - assembly name for NAnt Console
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${nant.console.name}.Tests.dll">
<nowarn>
@@ -20,10 +19,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.Core/NAnt.Core.build b/tests/NAnt.Core/NAnt.Core.build
index 6c9805d..b93116c 100644
--- a/tests/NAnt.Core/NAnt.Core.build
+++ b/tests/NAnt.Core/NAnt.Core.build
@@ -7,7 +7,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -21,10 +20,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'netDumbster.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <include name="${nant::scan-probing-paths('netDumbster.dll')}" />
</references>
<resources failonempty="true" basedir="Resources" dynamicprefix="true" prefix="XML:">
<include name="**/*.xml"/>
diff --git a/tests/NAnt.DotNet/NAnt.DotNet.build b/tests/NAnt.DotNet/NAnt.DotNet.build
index aa09b3f..5389240 100644
--- a/tests/NAnt.DotNet/NAnt.DotNet.build
+++ b/tests/NAnt.DotNet/NAnt.DotNet.build
@@ -7,7 +7,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<property name="vjc.location" value="${path::combine(framework::get-sdk-directory(framework::get-target-framework()), 'vjc.exe')}" />
<property name="jsc.location" value="${path::combine(framework::get-sdk-directory(framework::get-target-framework()), 'jsc.exe')}" />
@@ -26,11 +25,11 @@
<exclude name="Tasks/VjcTaskTest.cs" unless="${file::exists(vjc.location)}" />
<exclude name="Tasks/JscTaskTest.cs" unless="${file::exists(jsc.location)}" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll"/>
- <include name="NAnt.Core.Tests.dll"/>
- <include name="${project::get-name()}Tasks.dll"/>
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll"/>
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll"/>
+ <include name="${build.dir}/bin/${project::get-name()}Tasks.dll"/>
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.MSNet/NAnt.MSNet.build b/tests/NAnt.MSNet/NAnt.MSNet.build
index 2ae3420..9baf7ac 100644
--- a/tests/NAnt.MSNet/NAnt.MSNet.build
+++ b/tests/NAnt.MSNet/NAnt.MSNet.build
@@ -7,7 +7,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build" if="${framework::get-family(framework::get-target-framework()) == 'net'}">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -19,10 +18,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.SourceControl/NAnt.SourceControl.build b/tests/NAnt.SourceControl/NAnt.SourceControl.build
index cf66209..cc8d2e9 100644
--- a/tests/NAnt.SourceControl/NAnt.SourceControl.build
+++ b/tests/NAnt.SourceControl/NAnt.SourceControl.build
@@ -7,7 +7,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -19,10 +18,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.VSNet/NAnt.VSNet.build b/tests/NAnt.VSNet/NAnt.VSNet.build
index bc02166..7a84c7c 100644
--- a/tests/NAnt.VSNet/NAnt.VSNet.build
+++ b/tests/NAnt.VSNet/NAnt.VSNet.build
@@ -7,7 +7,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -19,11 +18,11 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="NAnt.VisualCpp.Tests.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${build.dir}/bin/NAnt.VisualCpp.Tests.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.VisualCpp/NAnt.VisualCpp.build b/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
index baedd0f..8d78a8d 100644
--- a/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
+++ b/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
@@ -7,7 +7,6 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -19,11 +18,11 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="NAnt.VisualCppTasks.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${build.dir}/bin/NAnt.VisualCppTasks.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.Win32/NAnt.Win32.build b/tests/NAnt.Win32/NAnt.Win32.build
index a4965cd..48099a7 100644
--- a/tests/NAnt.Win32/NAnt.Win32.build
+++ b/tests/NAnt.Win32/NAnt.Win32.build
@@ -6,8 +6,7 @@
* build.debug - (true|false) debug build?
* current.build.defines - framework-specific build defines
-->
- <target name="build">
- <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
+ <target name="build">
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -19,10 +18,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir.bin}">
- <include name="NAnt.Core.dll" />
- <include name="NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <references>
+ <include name="${build.dir}/bin/NAnt.Core.dll" />
+ <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
</references>
</csc>
</target>
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-03 01:30:17
|
From: Ryan Boggs <rm...@gm...>
---
src/NAnt.Core/Types/FileSet.cs | 4 ++--
src/NAnt.DotNet/Types/AssemblyAttribute.cs | 2 +-
src/NAnt.DotNet/Types/CompilerWarning.cs | 2 +-
src/NAnt.DotNet/Types/NamespaceImport.cs | 2 +-
src/NAnt.DotNet/Types/Package.cs | 2 +-
src/NAnt.NUnit/NUnit2/Types/Category.cs | 2 +-
src/NAnt.VSNet/Types/WebMap.cs | 2 +-
src/NAnt.VisualCpp/Types/Library.cs | 2 +-
src/NAnt.VisualCpp/Types/Symbol.cs | 2 +-
9 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/NAnt.Core/Types/FileSet.cs b/src/NAnt.Core/Types/FileSet.cs
index 7d97e00..8e805c1 100644
--- a/src/NAnt.Core/Types/FileSet.cs
+++ b/src/NAnt.Core/Types/FileSet.cs
@@ -846,7 +846,7 @@ namespace NAnt.Core.Types {
// These classes provide a way of getting the Element task to initialize
// the values from the build file.
- public class Exclude : Element {
+ public class Exclude : Element, IConditional{
#region Private Instance Fields
private string _pattern;
@@ -966,7 +966,7 @@ namespace NAnt.Core.Types {
#endregion Override implementation of Exclude
}
- public class ExcludesFile : Element {
+ public class ExcludesFile : Element, IConditional {
#region Private Instance Fields
private bool _ifDefined = true;
diff --git a/src/NAnt.DotNet/Types/AssemblyAttribute.cs b/src/NAnt.DotNet/Types/AssemblyAttribute.cs
index 05edb17..e7e1f48 100644
--- a/src/NAnt.DotNet/Types/AssemblyAttribute.cs
+++ b/src/NAnt.DotNet/Types/AssemblyAttribute.cs
@@ -28,7 +28,7 @@ namespace NAnt.DotNet.Types {
/// </summary>
[ElementName("attribute")]
[Serializable()]
- public class AssemblyAttribute : Element {
+ public class AssemblyAttribute : Element, IConditional {
#region Private Instance Fields
private string _typeName;
diff --git a/src/NAnt.DotNet/Types/CompilerWarning.cs b/src/NAnt.DotNet/Types/CompilerWarning.cs
index ab64661..8e768b2 100644
--- a/src/NAnt.DotNet/Types/CompilerWarning.cs
+++ b/src/NAnt.DotNet/Types/CompilerWarning.cs
@@ -24,7 +24,7 @@ namespace NAnt.DotNet.Types {
/// <summary>
/// Represents a compiler warning.
/// </summary>
- public class CompilerWarning : Element {
+ public class CompilerWarning : Element, IConditional {
#region Private Instance Fields
private string _number;
diff --git a/src/NAnt.DotNet/Types/NamespaceImport.cs b/src/NAnt.DotNet/Types/NamespaceImport.cs
index 7acf312..3c68bde 100644
--- a/src/NAnt.DotNet/Types/NamespaceImport.cs
+++ b/src/NAnt.DotNet/Types/NamespaceImport.cs
@@ -27,7 +27,7 @@ namespace NAnt.DotNet.Types {
/// </summary>
[Serializable()]
[ElementName("import")]
- public class NamespaceImport : Element {
+ public class NamespaceImport : Element, IConditional {
#region Private Instance Fields
private string _namespace;
diff --git a/src/NAnt.DotNet/Types/Package.cs b/src/NAnt.DotNet/Types/Package.cs
index c8da15f..908b277 100644
--- a/src/NAnt.DotNet/Types/Package.cs
+++ b/src/NAnt.DotNet/Types/Package.cs
@@ -24,7 +24,7 @@ namespace NAnt.DotNet.Types {
/// <summary>
/// Represents a package.
/// </summary>
- public class Package : Element {
+ public class Package : Element, IConditional {
#region Private Instance Fields
private string _name;
diff --git a/src/NAnt.NUnit/NUnit2/Types/Category.cs b/src/NAnt.NUnit/NUnit2/Types/Category.cs
index f6f1412..3329031 100644
--- a/src/NAnt.NUnit/NUnit2/Types/Category.cs
+++ b/src/NAnt.NUnit/NUnit2/Types/Category.cs
@@ -25,7 +25,7 @@ namespace NAnt.NUnit2.Types {
/// <summary>
/// Represents a certain group of test cases or fixtures.
/// </summary>
- public class Category : Element {
+ public class Category : Element, IConditional {
#region Private Instance Fields
private string _name;
diff --git a/src/NAnt.VSNet/Types/WebMap.cs b/src/NAnt.VSNet/Types/WebMap.cs
index df4fc98..a1955f4 100644
--- a/src/NAnt.VSNet/Types/WebMap.cs
+++ b/src/NAnt.VSNet/Types/WebMap.cs
@@ -30,7 +30,7 @@ namespace NAnt.VSNet.Types {
/// path.
/// </summary>
[Serializable()]
- public class WebMap : Element {
+ public class WebMap : Element, IConditional {
#region Private Instance Fields
private string _url;
diff --git a/src/NAnt.VisualCpp/Types/Library.cs b/src/NAnt.VisualCpp/Types/Library.cs
index 221378b..bd2d233 100644
--- a/src/NAnt.VisualCpp/Types/Library.cs
+++ b/src/NAnt.VisualCpp/Types/Library.cs
@@ -26,7 +26,7 @@ namespace NAnt.VisualCpp.Types {
/// <summary>
/// Represents a library.
/// </summary>
- public class Library : Element {
+ public class Library : Element, IConditional {
#region Private Instance Fields
private string _libraryName;
diff --git a/src/NAnt.VisualCpp/Types/Symbol.cs b/src/NAnt.VisualCpp/Types/Symbol.cs
index 2bee650..6edad1d 100644
--- a/src/NAnt.VisualCpp/Types/Symbol.cs
+++ b/src/NAnt.VisualCpp/Types/Symbol.cs
@@ -26,7 +26,7 @@ namespace NAnt.VisualCpp.Types {
/// <summary>
/// Represents a symbol.
/// </summary>
- public class Symbol : Element {
+ public class Symbol : Element, IConditional {
#region Private Instance Fields
private string _symbolName;
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-03 01:30:17
|
From: Dominik Guder <os...@gu...>
---
.travis.yml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index ee7891f..3152043 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,5 +14,5 @@ env:
script:
- mono --version
- - make clean run-test TARGET=$TARGET MCS=$MCS
+ - make clean run-test TARGET=$TARGET MCS="$MCS"
\ No newline at end of file
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-03 01:30:17
|
From: Dominik Guder <os...@gu...> --- .travis.yml | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index dba7a56..ee7891f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,11 @@ install: - sudo apt-key add /tmp/mono.gpg - sudo sh -c "echo 'deb http://download.mono-project.com/repo/debian wheezy main' >> /etc/apt/sources.list.d/mono-xamarin.list" - sudo apt-get update -qq - - sudo apt-get install -qq mono-devel mono-gmcs mono-dmcs mono-vbnc nuget libgdiplus=2.10-3 + - sudo apt-get install -qq mono-devel mono-vbnc nuget libgdiplus=2.10-3 env: - - TARGET=mono-2.0 MCS=gmcs - - TARGET=mono-4.0 MCS=dmcs + - TARGET=mono-2.0 MCS="mcs -sdk:2" + - TARGET=mono-4.0 MCS="mcs -sdk:4" script: - mono --version -- 1.7.7 |
|
From: <nan...@na...> - 2015-02-03 01:30:16
|
From: Dominik Guder <os...@gu...> --- .travis.yml | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4dc177..dba7a56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,12 @@ install: - sudo sh -c "echo 'deb http://download.mono-project.com/repo/debian wheezy main' >> /etc/apt/sources.list.d/mono-xamarin.list" - sudo apt-get update -qq - sudo apt-get install -qq mono-devel mono-gmcs mono-dmcs mono-vbnc nuget libgdiplus=2.10-3 - + +env: + - TARGET=mono-2.0 MCS=gmcs + - TARGET=mono-4.0 MCS=dmcs + script: - - mono --version - - make clean run-test TARGET=mono-2.0 + - mono --version + - make clean run-test TARGET=$TARGET MCS=$MCS \ No newline at end of file -- 1.7.7 |
From: Ryan Boggs <rm...@gm...>
---
NAnt.build | 47 ++++----
src/NAnt.Core/Configuration/ConditionalElement.cs | 101 ------------------
src/NAnt.Core/Configuration/DirectoryName.cs | 71 +++++++++++--
src/NAnt.Core/Element.cs | 87 ++++++++++++++--
src/NAnt.Core/IConditional.cs | 43 ++++++++
src/NAnt.Core/NAnt.Core.csproj | 4 +-
src/NAnt.Core/Task.cs | 2 +-
src/NAnt.Core/Types/Argument.cs | 2 +-
src/NAnt.Core/Types/Credential.cs | 2 +-
src/NAnt.Core/Types/EnvironmentVariable.cs | 2 +-
src/NAnt.Core/Types/Formatter.cs | 2 +-
src/NAnt.Core/Types/Option.cs | 2 +-
src/NAnt.Core/Types/PathElement.cs | 2 +-
src/NAnt.Core/Types/Pattern.cs | 2 +-
src/NAnt.Core/Types/Proxy.cs | 2 +-
src/NAnt.Core/Types/Token.cs | 2 +-
src/NAnt.Core/Types/XmlNamespace.cs | 2 +-
src/NAnt.Core/Types/XsltExtensionObject.cs | 2 +-
src/NAnt.Core/Types/XsltParameter.cs | 2 +-
src/NAnt.DotNet/NAnt.DotNet.build | 11 +-
.../NDoc.Documenter.NAnt.build | 7 +-
tests/NAnt.Compression/NAnt.Compression.build | 11 +-
tests/NAnt.Console/NAnt.Console.build | 9 +-
tests/NAnt.Core/ElementTest.cs | 111 +++++++++++++++++++-
tests/NAnt.Core/NAnt.Core.build | 9 +-
tests/NAnt.Core/Tasks/EchoTest.cs | 13 +++
tests/NAnt.Core/Tasks/PropertyTest.cs | 21 ++++-
tests/NAnt.DotNet/NAnt.DotNet.build | 11 +-
tests/NAnt.MSNet/NAnt.MSNet.build | 9 +-
tests/NAnt.SourceControl/NAnt.SourceControl.build | 9 +-
tests/NAnt.VSNet/NAnt.VSNet.build | 11 +-
tests/NAnt.VisualCpp/NAnt.VisualCpp.build | 11 +-
tests/NAnt.Win32/NAnt.Win32.build | 11 +-
33 files changed, 423 insertions(+), 210 deletions(-)
delete mode 100644 src/NAnt.Core/Configuration/ConditionalElement.cs
create mode 100644 src/NAnt.Core/IConditional.cs
diff --git a/NAnt.build b/NAnt.build
index 599137f..68cc47d 100644
--- a/NAnt.build
+++ b/NAnt.build
@@ -88,6 +88,7 @@
<target name="init" description="Initializes build properties">
<call target="${project.config}" />
<call target="set-framework-configuration" />
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}"/>
</target>
<target name="create-common-assemblyinfo" if="${create.assemblyinfo}">
<!-- ensure src/CommonAssemblyInfo.cs is writable if it already exists -->
@@ -128,16 +129,16 @@
<target name="build.common" depends="init, create-common-assemblyinfo">
<echo message="Build Directory is ${build.dir}" />
<!-- ensure bin directory exists -->
- <mkdir dir="${build.dir}/bin" />
+ <mkdir dir="${build.dir.bin}" />
<!-- ensure lib directory exists -->
- <mkdir dir="${build.dir}/bin/lib" />
+ <mkdir dir="${build.dir.bin}/lib" />
<!-- copy third party executables -->
- <copy todir="${build.dir}/bin">
+ <copy todir="${build.dir.bin}">
<fileset basedir="bin">
<include name="scvs.exe" />
</fileset>
</copy>
- <copy todir="${build.dir}/bin">
+ <copy todir="${build.dir.bin}">
<fileset basedir="lib/common/neutral">
<!-- copy log4net assembly, workaround for Mono bug #57602 -->
<include name="log4net.dll" />
@@ -146,7 +147,7 @@
</fileset>
</copy>
<!-- copy third party assemblies -->
- <copy todir="${build.dir}/bin/lib">
+ <copy todir="${build.dir.bin}/lib">
<fileset basedir="lib">
<include name="**/*" />
<exclude name="common/neutral/log4net.dll" />
@@ -206,7 +207,7 @@
<!-- test the newly built NAnt -->
<target name="test" depends="build" description="Tests current configuration">
<echo message="Running unit tests with just built version of NAnt." />
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -216,7 +217,7 @@
</exec>
</target>
<target name="test-core" depends="build">
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -226,7 +227,7 @@
</exec>
</target>
<target name="test-dotnet" depends="build">
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -236,7 +237,7 @@
</exec>
</target>
<target name="test-sourcecontrol" depends="build">
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -246,7 +247,7 @@
</exec>
</target>
<target name="test-visualcpp" depends="build">
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -256,7 +257,7 @@
</exec>
</target>
<target name="test-compression" depends="build">
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -337,8 +338,8 @@
<!-- generate user documentation -->
<target name="userdoc" depends="build" description="Builds user documentation">
- <echo message="Creating task and type documentation from ${build.dir}/bin" />
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <echo message="Creating task and type documentation from ${build.dir.bin}" />
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
@@ -354,7 +355,7 @@
<targetfiles>
<include name="${build.dir}/doc/help/*.html" />
</targetfiles>
- <sourcefiles basedir="${build.dir}/bin">
+ <sourcefiles basedir="${build.dir.bin}">
<!-- make sure the tasks/types are not new -->
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
@@ -365,7 +366,7 @@
</uptodate>
<if test="${not(help.uptodate)}">
<ndoc>
- <assemblies basedir="${build.dir}/bin">
+ <assemblies basedir="${build.dir.bin}">
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
@@ -406,8 +407,8 @@
<echo message="User documentation: file://${build.dir}/doc/index.html" />
</target>
<target name="sdkdoc" depends="build" description="Builds SDK documentation">
- <echo message="Creating SDK Documentation for ${build.dir}/bin/${nant.console.name}.exe" />
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <echo message="Creating SDK Documentation for ${build.dir.bin}/${nant.console.name}.exe" />
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
@@ -423,7 +424,7 @@
<targetfiles>
<include name="${build.dir}/doc/sdk/*.chm" />
</targetfiles>
- <sourcefiles basedir="${build.dir}/bin">
+ <sourcefiles basedir="${build.dir.bin}">
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
@@ -433,7 +434,7 @@
</uptodate>
<if test="${not(sdk.uptodate)}">
<ndoc>
- <assemblies basedir="${build.dir}/bin">
+ <assemblies basedir="${build.dir.bin}">
<include name="NAnt.Core.dll" />
<include name="NAnt.*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
@@ -499,7 +500,7 @@
</target>
<target name="schema" depends="build">
- <exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
+ <exec program="${build.dir.bin}/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
@@ -556,10 +557,10 @@
<target name="package-common" depends="test, userdoc, sdkdoc, schema">
<!-- move config file -->
- <move file="${build.dir}/bin/NAnt.exe.config" tofile="${build.dir}/bin/${nant.console.name}.exe.config" />
+ <move file="${build.dir.bin}/NAnt.exe.config" tofile="${build.dir.bin}/${nant.console.name}.exe.config" />
<!-- remove non-release files -->
<delete>
- <fileset basedir="${build.dir}/bin">
+ <fileset basedir="${build.dir.bin}">
<include name="NAnt.Console.*" />
<!-- remove test assemblies -->
<include name="*.Tests.*" />
@@ -756,7 +757,7 @@
</fileset>
</delete>
<copy todir="bin" overwrite="true">
- <fileset basedir="${build.dir}/bin/">
+ <fileset basedir="${build.dir.bin}/">
<include name="NAnt*" />
<exclude name="*Test*" />
<exclude name="${nant.console.name}.xml" />
diff --git a/src/NAnt.Core/Configuration/ConditionalElement.cs b/src/NAnt.Core/Configuration/ConditionalElement.cs
deleted file mode 100644
index 642c9e5..0000000
--- a/src/NAnt.Core/Configuration/ConditionalElement.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-using System.Reflection;
-using System.Xml;
-using NAnt.Core.Attributes;
-
-namespace NAnt.Core.Configuration {
- [Serializable]
- internal class ConditionalElement : Element {
- #region Private Instance Fields
-
- private bool _ifDefined = true;
- private bool _unlessDefined;
-
- #endregion Private Instance Fields
-
- #region Protected Instance Constructors
-
- protected override void InitializeXml(XmlNode elementNode, PropertyDictionary properties, FrameworkInfo framework) {
- XmlNode = elementNode;
-
- ConditionalConfigurator configurator = new ConditionalConfigurator(
- this, elementNode, properties, framework);
- configurator.Initialize();
- }
-
- #endregion Protected Instance Constructors
-
- #region Protected Instance Properties
-
- [TaskAttribute("if")]
- protected bool IfDefined {
- get { return _ifDefined; }
- set { _ifDefined = value; }
- }
-
- [TaskAttribute("unless")]
- protected bool UnlessDefined {
- get { return _unlessDefined; }
- set { _unlessDefined = value; }
- }
-
- #endregion Protected Instance Properties
-
- #region Internal Instance Properties
-
- internal bool Enabled {
- get {
- return IfDefined && !UnlessDefined;
- }
- }
-
- #endregion Internal Instance Properties
-
- #region Override implementation of Element
-
- #endregion Override implementation of Element
-
- class ConditionalConfigurator : AttributeConfigurator {
- public ConditionalConfigurator(ConditionalElement element, XmlNode elementNode, PropertyDictionary properties, FrameworkInfo targetFramework) :
- base (element, elementNode, properties, targetFramework) {
- Type currentType = element.GetType();
-
- PropertyInfo ifdefined = currentType.GetProperty("IfDefined",
- BindingFlags.NonPublic | BindingFlags.Instance);
- InitializeAttribute(ifdefined);
-
- if (!element.IfDefined) {
- _enabled = false;
- } else {
- PropertyInfo unlessDefined = currentType.GetProperty(
- "UnlessDefined",
- BindingFlags.NonPublic | BindingFlags.Instance);
- InitializeAttribute(unlessDefined);
- _enabled = !element.UnlessDefined;
- }
-
- if (!_enabled) {
- // since we will not be processing other attributes or
- // child nodes, clear these collections to avoid
- // errors for unrecognized attributes/elements
- UnprocessedAttributes.Clear();
- UnprocessedChildNodes.Clear();
- }
- }
-
- protected override bool InitializeAttribute(PropertyInfo propertyInfo) {
- if (!_enabled)
- return true;
- return base.InitializeAttribute (propertyInfo);
- }
-
- protected override void InitializeOrderedChildElements() {
- if (!_enabled)
- return;
- base.InitializeOrderedChildElements ();
- }
-
- private readonly bool _enabled = true;
- }
- }
-}
diff --git a/src/NAnt.Core/Configuration/DirectoryName.cs b/src/NAnt.Core/Configuration/DirectoryName.cs
index a3ae779..f21fad4 100644
--- a/src/NAnt.Core/Configuration/DirectoryName.cs
+++ b/src/NAnt.Core/Configuration/DirectoryName.cs
@@ -3,13 +3,68 @@ using NAnt.Core.Attributes;
namespace NAnt.Core.Configuration {
[Serializable]
- internal class DirectoryName : ConditionalElement {
- private string _name;
-
- [TaskAttribute("name", Required=true)]
- public string DirName {
- get { return _name; }
- set { _name = value; }
- }
+ internal class DirectoryName : Element, IConditional {
+ private string _name;
+ private bool _ifDefined = true;
+ private bool _unlessDefined;
+
+ #region Public Instance Properties
+
+ [TaskAttribute("name", Required = true)]
+ public string DirName
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ #endregion
+
+ #region Protected Instance Properties
+
+ [TaskAttribute("if")]
+ [BooleanValidator()]
+ protected bool IfDefined
+ {
+ get { return _ifDefined; }
+ set { _ifDefined = value; }
+ }
+
+ [TaskAttribute("unless")]
+ [BooleanValidator()]
+ protected bool UnlessDefined
+ {
+ get { return _unlessDefined; }
+ set { _unlessDefined = value; }
+ }
+
+ #endregion Protected Instance Properties
+
+ #region Internal Instance Properties
+
+ internal bool Enabled
+ {
+ get
+ {
+ return IfDefined && !UnlessDefined;
+ }
+ }
+
+ #endregion Internal Instance Properties
+
+ #region Explicit Interface Implementation
+
+ bool IConditional.IfDefined
+ {
+ get { return _ifDefined; }
+ set { _ifDefined = value; }
+ }
+
+ bool IConditional.UnlessDefined
+ {
+ get { return _unlessDefined; }
+ set { _unlessDefined = value; }
+ }
+
+ #endregion
}
}
diff --git a/src/NAnt.Core/Element.cs b/src/NAnt.Core/Element.cs
index 7a13ffc..373618c 100644
--- a/src/NAnt.Core/Element.cs
+++ b/src/NAnt.Core/Element.cs
@@ -326,10 +326,21 @@ namespace NAnt.Core {
/// Initializes all build attributes and child elements.
/// </summary>
protected virtual void InitializeXml(XmlNode elementNode, PropertyDictionary properties, FrameworkInfo framework) {
- _xmlNode = elementNode;
-
- AttributeConfigurator configurator = new AttributeConfigurator(
- this, elementNode, properties, framework);
+ _xmlNode = elementNode;
+
+ IConditional conditional = this as IConditional;
+ AttributeConfigurator configurator;
+
+ if (conditional != null)
+ {
+ configurator =
+ new ConditionalConfigurator(this, elementNode, properties, framework);
+ }
+ else
+ {
+ configurator =
+ new AttributeConfigurator(this, elementNode, properties, framework);
+ }
configurator.Initialize();
}
@@ -755,8 +766,8 @@ namespace NAnt.Core {
string attributeValue = null;
XmlNode frameworkAttributeNode = null;
- #region Initialize property using framework configuration
-
+ #region Initialize property using framework configuration
+
FrameworkConfigurableAttribute frameworkAttribute = (FrameworkConfigurableAttribute)
Attribute.GetCustomAttribute(propertyInfo, typeof(FrameworkConfigurableAttribute),
false);
@@ -1123,10 +1134,11 @@ namespace NAnt.Core {
Element childElement = InitializeBuildElement(childNode,
elementType);
- // check if element should actually be added
- ConditionalElement conditional = childElement as ConditionalElement;
- if (conditional != null && !conditional.Enabled) {
- continue;
+ // check if element should actually be added
+ IConditional conditional = childElement as IConditional;
+ if (conditional != null && !(conditional.IfDefined && !conditional.UnlessDefined))
+ {
+ continue;
}
// set element in array
@@ -1776,6 +1788,61 @@ namespace NAnt.Core {
private interface IAttributeSetter {
void Set(XmlNode attributeNode, Element parent, PropertyInfo property, string value);
}
+ }
+
+
+ private class ConditionalConfigurator : AttributeConfigurator
+ {
+ public ConditionalConfigurator(Element element, XmlNode elementNode, PropertyDictionary properties, FrameworkInfo targetFramework) :
+ base(element, elementNode, properties, targetFramework)
+ {
+ IConditional conditional = element as IConditional;
+ if (conditional == null) return;
+
+ Type currentType = element.GetType();
+ BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Public |
+ BindingFlags.Instance;
+
+ PropertyInfo ifdefined = currentType.GetProperty("IfDefined", flags);
+
+ InitializeAttribute(ifdefined);
+ if (!conditional.IfDefined)
+ {
+ _enabled = false;
+ }
+ else
+ {
+ PropertyInfo unlessDefined =
+ currentType.GetProperty("UnlessDefined", flags);
+ InitializeAttribute(unlessDefined);
+ _enabled = !conditional.UnlessDefined;
+ }
+
+ if (!_enabled)
+ {
+ // since we will not be processing other attributes or
+ // child nodes, clear these collections to avoid
+ // errors for unrecognized attributes/elements
+ UnprocessedAttributes.Clear();
+ UnprocessedChildNodes.Clear();
+ }
+ }
+
+ protected override bool InitializeAttribute(PropertyInfo propertyInfo)
+ {
+ if (!_enabled)
+ return true;
+ return base.InitializeAttribute(propertyInfo);
+ }
+
+ protected override void InitializeOrderedChildElements()
+ {
+ if (!_enabled)
+ return;
+ base.InitializeOrderedChildElements();
+ }
+
+ private readonly bool _enabled = true;
}
}
}
diff --git a/src/NAnt.Core/IConditional.cs b/src/NAnt.Core/IConditional.cs
new file mode 100644
index 0000000..8392fff
--- /dev/null
+++ b/src/NAnt.Core/IConditional.cs
@@ -0,0 +1,43 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001-2015 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ryan Boggs (rm...@us...)
+
+namespace NAnt.Core
+{
+ /// <summary>
+ /// Provides indicators to <see cref="NAnt.Core.Element"/> based classes that
+ /// tells <see cref="NAnt.Core.Element"/> that conditional checks should be
+ /// evaluated before processing.
+ /// </summary>
+ public interface IConditional
+ {
+ #region Properties
+
+ /// <summary>
+ /// Indicates whether or not the implementing class should execute.
+ /// </summary>
+ bool IfDefined { get; set; }
+
+ /// <summary>
+ /// Indicates whether or not the implementing class should NOT execute.
+ /// </summary>
+ bool UnlessDefined { get; set; }
+
+ #endregion
+ }
+}
diff --git a/src/NAnt.Core/NAnt.Core.csproj b/src/NAnt.Core/NAnt.Core.csproj
index b32d074..200cbe7 100644
--- a/src/NAnt.Core/NAnt.Core.csproj
+++ b/src/NAnt.Core/NAnt.Core.csproj
@@ -87,6 +87,7 @@
<Compile Include="FrameworkInfoDictionary.cs" />
<Compile Include="FrameworkTypes.cs" />
<Compile Include="FunctionSetBase.cs" />
+ <Compile Include="IConditional.cs" />
<Compile Include="Location.cs" />
<Compile Include="LocationMap.cs" />
<Compile Include="Log.cs" />
@@ -123,7 +124,6 @@
<Compile Include="Attributes\TaskAttributeAttribute.cs" />
<Compile Include="Attributes\TaskNameAttribute.cs" />
<Compile Include="Attributes\ValidatorAttribute.cs" />
- <Compile Include="Configuration\ConditionalElement.cs" />
<Compile Include="Configuration\DirectoryName.cs" />
<Compile Include="Configuration\DirList.cs" />
<Compile Include="Configuration\ManagedExecutionMode.cs" />
@@ -269,4 +269,4 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
-</Project>
+</Project>
\ No newline at end of file
diff --git a/src/NAnt.Core/Task.cs b/src/NAnt.Core/Task.cs
index 782d8d5..fe8369b 100644
--- a/src/NAnt.Core/Task.cs
+++ b/src/NAnt.Core/Task.cs
@@ -38,7 +38,7 @@ namespace NAnt.Core {
/// A task is a piece of code that can be executed.
/// </remarks>
[Serializable()]
- public abstract class Task : Element {
+ public abstract class Task : Element, IConditional {
#region Private Static Fields
private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/src/NAnt.Core/Types/Argument.cs b/src/NAnt.Core/Types/Argument.cs
index 0ab66c5..3cc956b 100644
--- a/src/NAnt.Core/Types/Argument.cs
+++ b/src/NAnt.Core/Types/Argument.cs
@@ -65,7 +65,7 @@ namespace NAnt.Core.Types {
/// </example>
[Serializable]
[ElementName("arg")]
- public class Argument : Element {
+ public class Argument : Element, IConditional {
#region Private Instance Fields
private FileInfo _file;
diff --git a/src/NAnt.Core/Types/Credential.cs b/src/NAnt.Core/Types/Credential.cs
index 8066f0d..6daf145 100644
--- a/src/NAnt.Core/Types/Credential.cs
+++ b/src/NAnt.Core/Types/Credential.cs
@@ -27,7 +27,7 @@ namespace NAnt.Core.Types {
/// Provides credentials for password-based authentication schemes.
/// </summary>
[ElementName("credential")]
- public class Credential : DataTypeBase {
+ public class Credential : DataTypeBase, IConditional {
#region Private Instance Fields
private string _domain;
diff --git a/src/NAnt.Core/Types/EnvironmentVariable.cs b/src/NAnt.Core/Types/EnvironmentVariable.cs
index c1b1055..ccd6106 100644
--- a/src/NAnt.Core/Types/EnvironmentVariable.cs
+++ b/src/NAnt.Core/Types/EnvironmentVariable.cs
@@ -28,7 +28,7 @@ namespace NAnt.Core.Types {
/// </summary>
[Serializable()]
[ElementName("env")]
- public class EnvironmentVariable : Element {
+ public class EnvironmentVariable : Element, IConditional {
#region Private Instance Fields
private string _name;
diff --git a/src/NAnt.Core/Types/Formatter.cs b/src/NAnt.Core/Types/Formatter.cs
index 4ff0f54..8101979 100644
--- a/src/NAnt.Core/Types/Formatter.cs
+++ b/src/NAnt.Core/Types/Formatter.cs
@@ -21,7 +21,7 @@ using NAnt.Core.Attributes;
namespace NAnt.Core.Types {
[ElementName("formatter")]
- public class Formatter : Element {
+ public class Formatter : Element, IConditional {
#region Private Instance Fields
private string _property;
diff --git a/src/NAnt.Core/Types/Option.cs b/src/NAnt.Core/Types/Option.cs
index 38972c6..3e4b332 100644
--- a/src/NAnt.Core/Types/Option.cs
+++ b/src/NAnt.Core/Types/Option.cs
@@ -25,7 +25,7 @@ namespace NAnt.Core.Types {
/// Represents an option.
/// </summary>
[ElementName("option")]
- public class Option : Element {
+ public class Option : Element, IConditional {
#region Private Instance Fields
private string _name;
diff --git a/src/NAnt.Core/Types/PathElement.cs b/src/NAnt.Core/Types/PathElement.cs
index 13c84e9..ea0e83d 100644
--- a/src/NAnt.Core/Types/PathElement.cs
+++ b/src/NAnt.Core/Types/PathElement.cs
@@ -29,7 +29,7 @@ namespace NAnt.Core.Types {
/// </summary>
[Serializable()]
[ElementName("pathelement")]
- public class PathElement : Element {
+ public class PathElement : Element, IConditional {
#region Private Instance Fields
private FileInfo _file;
diff --git a/src/NAnt.Core/Types/Pattern.cs b/src/NAnt.Core/Types/Pattern.cs
index aae6d05..3ca8144 100644
--- a/src/NAnt.Core/Types/Pattern.cs
+++ b/src/NAnt.Core/Types/Pattern.cs
@@ -23,7 +23,7 @@ namespace NAnt.Core.Types {
/// <summary>
/// Pattern which is used by a <see cref="PatternSet"/> to include or exclude specific files.
/// </summary>
- public class Pattern : Element {
+ public class Pattern : Element, IConditional {
#region Private Instance Fields
private string _patternName;
diff --git a/src/NAnt.Core/Types/Proxy.cs b/src/NAnt.Core/Types/Proxy.cs
index 36656c0..c779339 100644
--- a/src/NAnt.Core/Types/Proxy.cs
+++ b/src/NAnt.Core/Types/Proxy.cs
@@ -28,7 +28,7 @@ namespace NAnt.Core.Types {
/// resources.
/// </summary>
[ElementName("proxy")]
- public class Proxy : DataTypeBase {
+ public class Proxy : DataTypeBase, IConditional {
#region Private Instance Fields
private string _host;
diff --git a/src/NAnt.Core/Types/Token.cs b/src/NAnt.Core/Types/Token.cs
index a15b7be..9362728 100644
--- a/src/NAnt.Core/Types/Token.cs
+++ b/src/NAnt.Core/Types/Token.cs
@@ -23,7 +23,7 @@ namespace NAnt.Core.Types {
/// ReplaceTokens filter token.
/// </summary>
[ElementName("token")]
- public class Token : Element {
+ public class Token : Element, IConditional {
#region Private Instance Fields
private string _key;
diff --git a/src/NAnt.Core/Types/XmlNamespace.cs b/src/NAnt.Core/Types/XmlNamespace.cs
index 5d9f0bf..a6c5949 100644
--- a/src/NAnt.Core/Types/XmlNamespace.cs
+++ b/src/NAnt.Core/Types/XmlNamespace.cs
@@ -26,7 +26,7 @@ namespace NAnt.Core.Types {
/// Represents an XML namespace.
/// </summary>
[ElementName("namespace")]
- public class XmlNamespace : Element {
+ public class XmlNamespace : Element, IConditional {
#region Private Instance Fields
private string _prefix;
diff --git a/src/NAnt.Core/Types/XsltExtensionObject.cs b/src/NAnt.Core/Types/XsltExtensionObject.cs
index 7b5382f..2a9d095 100644
--- a/src/NAnt.Core/Types/XsltExtensionObject.cs
+++ b/src/NAnt.Core/Types/XsltExtensionObject.cs
@@ -32,7 +32,7 @@ namespace NAnt.Core.Types {
/// four basic XPath data types of number, string, Boolean or node set.
/// </summary>
[ElementName("xsltextensionobject")]
- public class XsltExtensionObject : Element {
+ public class XsltExtensionObject : Element, IConditional {
#region Private Instance Fields
private string _namespaceUri = string.Empty;
diff --git a/src/NAnt.Core/Types/XsltParameter.cs b/src/NAnt.Core/Types/XsltParameter.cs
index d7eece4..22ed87b 100644
--- a/src/NAnt.Core/Types/XsltParameter.cs
+++ b/src/NAnt.Core/Types/XsltParameter.cs
@@ -24,7 +24,7 @@ namespace NAnt.Core.Types {
/// Represents an XSLT parameter.
/// </summary>
[ElementName("xsltparameter")]
- public class XsltParameter : Element {
+ public class XsltParameter : Element, IConditional {
#region Private Instance Fields
private string _name = string.Empty;
diff --git a/src/NAnt.DotNet/NAnt.DotNet.build b/src/NAnt.DotNet/NAnt.DotNet.build
index 7c6bea9..5d03069 100644
--- a/src/NAnt.DotNet/NAnt.DotNet.build
+++ b/src/NAnt.DotNet/NAnt.DotNet.build
@@ -8,8 +8,9 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build main assembly -->
- <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}Tasks.dll" doc="${build.dir}/bin/${project::get-name()}Tasks.xml">
+ <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir.bin}/${project::get-name()}Tasks.dll" doc="${build.dir.bin}/${project::get-name()}Tasks.xml">
<nowarn>
<!-- do not report deprecation warnings -->
<warning number="0612" />
@@ -20,10 +21,10 @@
<!-- common assembly-level attributes -->
<include name="../CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${nant::scan-probing-paths(build.dir + '/bin','NDoc.ExtendedUI.dll')}" />
- <include name="${nant::scan-probing-paths(build.dir + '/bin','NDoc.Core.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.ExtendedUI.dll')}" />
+ <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.Core.dll')}" />
</references>
<resources prefix="NAnt.DotNet" dynamicprefix="true">
<include name="Resources/**/*" />
diff --git a/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build b/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
index 2de6374..b15f6d9 100644
--- a/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
+++ b/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
@@ -8,6 +8,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build main assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.dll" doc="${build.dir}/bin/${project::get-name()}.xml">
<nowarn>
@@ -22,10 +23,10 @@
<include name="*.cs" />
<include name="../CommonAssemblyInfo.cs" />
</sources>
- <references basedir="${build.dir}/bin" failonempty="true">
+ <references basedir="${build.dir.bin}" failonempty="true">
<include name="NAnt.Core.dll" />
- <include name="${nant::scan-probing-paths('NDoc.ExtendedUI.dll')}" />
- <include name="${nant::scan-probing-paths('NDoc.Core.dll')}" />
+ <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.ExtendedUI.dll')}" />
+ <include name="${nant::scan-probing-paths(build.dir.bin,'NDoc.Core.dll')}" />
<include name="System.Web.dll" />
</references>
<resources basedir="Resources" prefix="Documenter.xslt.">
diff --git a/tests/NAnt.Compression/NAnt.Compression.build b/tests/NAnt.Compression/NAnt.Compression.build
index ec104e8..e0dae2c 100644
--- a/tests/NAnt.Compression/NAnt.Compression.build
+++ b/tests/NAnt.Compression/NAnt.Compression.build
@@ -6,7 +6,8 @@
* build.debug - (true|false) debug build?
* current.build.defines - framework-specific build defines
-->
- <target name="build">
+ <target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -18,10 +19,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.Console/NAnt.Console.build b/tests/NAnt.Console/NAnt.Console.build
index 4e2e27b..ad0c943 100644
--- a/tests/NAnt.Console/NAnt.Console.build
+++ b/tests/NAnt.Console/NAnt.Console.build
@@ -8,6 +8,7 @@
* nant.console.name - assembly name for NAnt Console
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${nant.console.name}.Tests.dll">
<nowarn>
@@ -19,10 +20,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.Core/ElementTest.cs b/tests/NAnt.Core/ElementTest.cs
index d2e22ff..a1c3f23 100644
--- a/tests/NAnt.Core/ElementTest.cs
+++ b/tests/NAnt.Core/ElementTest.cs
@@ -17,8 +17,8 @@
//
// Tomas Restrepo (to...@mv...)
-using System;
-using System.ComponentModel;
+using System;
+using System.ComponentModel;
using NUnit.Framework;
using NAnt.Core;
@@ -101,6 +101,49 @@ namespace Tests.NAnt.Core {
}
}
+ /// <summary>
+ /// This is a test class to make sure that the if/unless conditionals
+ /// are processed as expected.
+ /// </summary>
+ [TaskName("conditionaltest")]
+ class ConditionalElementTestTask : Task
+ {
+ #region Public Static Fields
+
+ internal const string PropName = "quote";
+
+ #endregion
+
+ #region Private Instance Fields
+
+ private string _quote;
+
+ #endregion
+
+ #region Public Instance Properties
+
+ [TaskAttribute("quote")]
+ public string Quote
+ {
+ get { return _quote; }
+ set { _quote = value; }
+ }
+
+ #endregion
+
+ #region Override implementation of Task
+
+ protected override void ExecuteTask() {
+ string result = String.Format("The quote is \"{0}\".", Quote ?? String.Empty);
+ Log(Level.Info, result);
+
+ Properties.Add(PropName, result);
+
+ }
+
+ #endregion Override implementation of Task
+ }
+
/*
/// <summary>
/// A simple task with a null element to test failures.
@@ -306,6 +349,70 @@ namespace Tests.NAnt.Core {
RunBuild(build);
}
+ [TestCase("I did not inhale", true)]
+ [TestCase("I did inhale", false)]
+ [TestCase("${does.not.exist}", false)]
+ public void Test_IfAttribute(string quote, bool ifAttr)
+ {
+ const string build = @"<?xml version='1.0' ?>
+ <project name='testing' default='test'>
+ <target name='test'>
+ <conditionaltest quote='{0}' if='{1}'/>
+ </target>
+ </project>";
+
+ Project project = CreateFilebasedProject(String.Format(build, quote, ifAttr));
+ ExecuteProject(project);
+
+ if (ifAttr)
+ {
+ Assert.IsTrue(project.Properties.Contains(ConditionalElementTestTask.PropName),
+ String.Format("Project does not contain expected property: '{0}'",
+ ConditionalElementTestTask.PropName));
+ string result = project.Properties[ConditionalElementTestTask.PropName];
+ Assert.IsTrue(result.Contains(quote),
+ String.Format("Result does not contain quote: '{0}' | '{1}'", result, quote));
+ }
+ else
+ {
+ Assert.IsFalse(project.Properties.Contains(ConditionalElementTestTask.PropName),
+ String.Format("Project does contain unexpected property: '{0}'",
+ ConditionalElementTestTask.PropName));
+ }
+ }
+
+ [TestCase("I did not inhale", false)]
+ [TestCase("I did inhale", true)]
+ [TestCase("${does.not.exist}", true)]
+ public void Test_UnlessAttribute(string quote, bool unlessAttr)
+ {
+ const string build = @"<?xml version='1.0' ?>
+ <project name='testing' default='test'>
+ <target name='test'>
+ <conditionaltest quote='{0}' unless='{1}'/>
+ </target>
+ </project>";
+
+ Project project = CreateFilebasedProject(String.Format(build, quote, unlessAttr));
+ ExecuteProject(project);
+
+ if (unlessAttr)
+ {
+ Assert.IsFalse(project.Properties.Contains(ConditionalElementTestTask.PropName),
+ String.Format("Project does contain unexpected property: '{0}'",
+ ConditionalElementTestTask.PropName));
+ }
+ else
+ {
+ Assert.IsTrue(project.Properties.Contains(ConditionalElementTestTask.PropName),
+ String.Format("Project does not contain expected property: '{0}'",
+ ConditionalElementTestTask.PropName));
+ string result = project.Properties[ConditionalElementTestTask.PropName];
+ Assert.IsTrue(result.Contains(quote),
+ String.Format("Result does not contain quote: '{0}' | '{1}'", result, quote));
+ }
+ }
+
#endregion Public Instance Methods
}
}
diff --git a/tests/NAnt.Core/NAnt.Core.build b/tests/NAnt.Core/NAnt.Core.build
index b93116c..6c9805d 100644
--- a/tests/NAnt.Core/NAnt.Core.build
+++ b/tests/NAnt.Core/NAnt.Core.build
@@ -7,6 +7,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -20,10 +21,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
- <include name="${nant::scan-probing-paths('netDumbster.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'netDumbster.dll')}" />
</references>
<resources failonempty="true" basedir="Resources" dynamicprefix="true" prefix="XML:">
<include name="**/*.xml"/>
diff --git a/tests/NAnt.Core/Tasks/EchoTest.cs b/tests/NAnt.Core/Tasks/EchoTest.cs
index bf2930e..74a3a03 100644
--- a/tests/NAnt.Core/Tasks/EchoTest.cs
+++ b/tests/NAnt.Core/Tasks/EchoTest.cs
@@ -691,6 +691,19 @@ namespace Tests.NAnt.Core.Tasks {
Assert.IsTrue(listener.HasMessageBeenLogged (string.Empty, true), "#1");
}
+ /// <summary>
+ /// Test to make sure that the if statement of the echo task evaluates the property before
+ /// trying to output text.
+ /// </summary>
+ [Test]
+ public void Test_EchoIfAttribute()
+ {
+ string xml =
+ "<project><echo message='This should not output: ${does.not.exist}' if=\"${property::exists(\'does.not.exist\')}\"/></project>";
+ string result = RunBuild(xml);
+ Assert.IsFalse(result.Contains("This should not output:"));
+ }
+
[Test]
public void Log_Message_Whitespace() {
string msg;
diff --git a/tests/NAnt.Core/Tasks/PropertyTest.cs b/tests/NAnt.Core/Tasks/PropertyTest.cs
index a75baec..4f150ca 100644
--- a/tests/NAnt.Core/Tasks/PropertyTest.cs
+++ b/tests/NAnt.Core/Tasks/PropertyTest.cs
@@ -18,8 +18,8 @@
// Scott Hernandez (Sco...@ho...)
using System;
-using System.Globalization;
-using System.Threading;
+using System.Globalization;
+using System.Threading;
using NUnit.Framework;
using NAnt.Core;
@@ -247,5 +247,22 @@ namespace Tests.NAnt.Core.Tasks {
Assert.IsNotNull(inner.RawMessage, "#5");
}
}
+
+ /// <summary>
+ /// Test to make sure that the _unless_ xml attribute works as expected for
+ /// the property task (and other tasks as well)
+ /// </summary>
+ [Test]
+ public void Test_PropertyUnlessAttribute()
+ {
+ string xml = "<project name='PropTests'>" +
+ "<property name='myMonth' value='january'/>" +
+ "<property name='myMonth' value='december' unless=\"${myMonth == \'january\'}\"/>" +
+ "<echo message='${myMonth}'/>" +
+ "</project>";
+ string result = RunBuild(xml);
+ Assert.IsTrue(result.Contains("january"));
+ Assert.IsFalse(result.Contains("december"));
+ }
}
}
diff --git a/tests/NAnt.DotNet/NAnt.DotNet.build b/tests/NAnt.DotNet/NAnt.DotNet.build
index 5389240..aa09b3f 100644
--- a/tests/NAnt.DotNet/NAnt.DotNet.build
+++ b/tests/NAnt.DotNet/NAnt.DotNet.build
@@ -7,6 +7,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<property name="vjc.location" value="${path::combine(framework::get-sdk-directory(framework::get-target-framework()), 'vjc.exe')}" />
<property name="jsc.location" value="${path::combine(framework::get-sdk-directory(framework::get-target-framework()), 'jsc.exe')}" />
@@ -25,11 +26,11 @@
<exclude name="Tasks/VjcTaskTest.cs" unless="${file::exists(vjc.location)}" />
<exclude name="Tasks/JscTaskTest.cs" unless="${file::exists(jsc.location)}" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll"/>
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll"/>
- <include name="${build.dir}/bin/${project::get-name()}Tasks.dll"/>
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll"/>
+ <include name="NAnt.Core.Tests.dll"/>
+ <include name="${project::get-name()}Tasks.dll"/>
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.MSNet/NAnt.MSNet.build b/tests/NAnt.MSNet/NAnt.MSNet.build
index 9baf7ac..2ae3420 100644
--- a/tests/NAnt.MSNet/NAnt.MSNet.build
+++ b/tests/NAnt.MSNet/NAnt.MSNet.build
@@ -7,6 +7,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build" if="${framework::get-family(framework::get-target-framework()) == 'net'}">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -18,10 +19,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.SourceControl/NAnt.SourceControl.build b/tests/NAnt.SourceControl/NAnt.SourceControl.build
index cc8d2e9..cf66209 100644
--- a/tests/NAnt.SourceControl/NAnt.SourceControl.build
+++ b/tests/NAnt.SourceControl/NAnt.SourceControl.build
@@ -7,6 +7,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -18,10 +19,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.VSNet/NAnt.VSNet.build b/tests/NAnt.VSNet/NAnt.VSNet.build
index 7a84c7c..bc02166 100644
--- a/tests/NAnt.VSNet/NAnt.VSNet.build
+++ b/tests/NAnt.VSNet/NAnt.VSNet.build
@@ -7,6 +7,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -18,11 +19,11 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${build.dir}/bin/NAnt.VisualCpp.Tests.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="NAnt.VisualCpp.Tests.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.VisualCpp/NAnt.VisualCpp.build b/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
index 8d78a8d..baedd0f 100644
--- a/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
+++ b/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
@@ -7,6 +7,7 @@
* current.build.defines - framework-specific build defines
-->
<target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -18,11 +19,11 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${build.dir}/bin/NAnt.VisualCppTasks.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="NAnt.VisualCppTasks.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
diff --git a/tests/NAnt.Win32/NAnt.Win32.build b/tests/NAnt.Win32/NAnt.Win32.build
index 48099a7..a4965cd 100644
--- a/tests/NAnt.Win32/NAnt.Win32.build
+++ b/tests/NAnt.Win32/NAnt.Win32.build
@@ -6,7 +6,8 @@
* build.debug - (true|false) debug build?
* current.build.defines - framework-specific build defines
-->
- <target name="build">
+ <target name="build">
+ <property name="build.dir.bin" value="${path::combine(build.dir, 'bin')}" unless="${property::exists('build.dir.bin')}"/>
<!-- build test assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.Tests.dll">
<nowarn>
@@ -18,10 +19,10 @@
<!-- common assembly-level attributes -->
<include name="../../src/CommonAssemblyInfo.cs" />
</sources>
- <references>
- <include name="${build.dir}/bin/NAnt.Core.dll" />
- <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
- <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+ <references basedir="${build.dir.bin}">
+ <include name="NAnt.Core.dll" />
+ <include name="NAnt.Core.Tests.dll" />
+ <include name="${nant::scan-probing-paths(build.dir.bin, 'nunit.framework.dll')}" />
</references>
</csc>
</target>
--
1.7.7
|
|
From: <nan...@na...> - 2015-02-03 01:30:12
|
From: Dominik Guder <os...@gu...> --- .travis.yml | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81e6e3d..d4dc177 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,13 @@ language: c install: - - sudo apt-get install mono-devel mono-gmcs mono-vbnc - -script: + - curl -sLo /tmp/mono.gpg http://download.mono-project.com/repo/xamarin.gpg + - sudo apt-key add /tmp/mono.gpg + - sudo sh -c "echo 'deb http://download.mono-project.com/repo/debian wheezy main' >> /etc/apt/sources.list.d/mono-xamarin.list" + - sudo apt-get update -qq + - sudo apt-get install -qq mono-devel mono-gmcs mono-dmcs mono-vbnc nuget libgdiplus=2.10-3 + +script: + - mono --version - make clean run-test TARGET=mono-2.0 \ No newline at end of file -- 1.7.7 |
|
From: <nan...@na...> - 2015-02-03 01:30:11
|
From: Dominik Guder <os...@gu...>
---
.travis.yml | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 64ff24b..81e6e3d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,9 @@
language: c
+install:
+ - sudo apt-get install mono-devel mono-gmcs mono-vbnc
+
script:
- make clean run-test TARGET=mono-2.0
\ No newline at end of file
--
1.7.7
|
From: Ryan Boggs <rm...@gm...>
---
src/NAnt.Core/Configuration/DirectoryName.cs | 12 ------------
tests/NAnt.Core/ElementTest.cs | 1 -
tests/NAnt.Core/Tasks/PropertyTest.cs | 3 +--
3 files changed, 1 insertions(+), 15 deletions(-)
diff --git a/src/NAnt.Core/Configuration/DirectoryName.cs b/src/NAnt.Core/Configuration/DirectoryName.cs
index f21fad4..63fc6a2 100644
--- a/src/NAnt.Core/Configuration/DirectoryName.cs
+++ b/src/NAnt.Core/Configuration/DirectoryName.cs
@@ -39,18 +39,6 @@ namespace NAnt.Core.Configuration {
#endregion Protected Instance Properties
- #region Internal Instance Properties
-
- internal bool Enabled
- {
- get
- {
- return IfDefined && !UnlessDefined;
- }
- }
-
- #endregion Internal Instance Properties
-
#region Explicit Interface Implementation
bool IConditional.IfDefined
diff --git a/tests/NAnt.Core/ElementTest.cs b/tests/NAnt.Core/ElementTest.cs
index a1c3f23..266ad9c 100644
--- a/tests/NAnt.Core/ElementTest.cs
+++ b/tests/NAnt.Core/ElementTest.cs
@@ -138,7 +138,6 @@ namespace Tests.NAnt.Core {
Log(Level.Info, result);
Properties.Add(PropName, result);
-
}
#endregion Override implementation of Task
diff --git a/tests/NAnt.Core/Tasks/PropertyTest.cs b/tests/NAnt.Core/Tasks/PropertyTest.cs
index 4f150ca..8980ad9 100644
--- a/tests/NAnt.Core/Tasks/PropertyTest.cs
+++ b/tests/NAnt.Core/Tasks/PropertyTest.cs
@@ -257,12 +257,11 @@ namespace Tests.NAnt.Core.Tasks {
{
string xml = "<project name='PropTests'>" +
"<property name='myMonth' value='january'/>" +
- "<property name='myMonth' value='december' unless=\"${myMonth == \'january\'}\"/>" +
+ "<property name='myMonth' value='${does.not.exist}' unless=\"${property::exists('myMonth')}\"/>" +
"<echo message='${myMonth}'/>" +
"</project>";
string result = RunBuild(xml);
Assert.IsTrue(result.Contains("january"));
- Assert.IsFalse(result.Contains("december"));
}
}
}
--
1.7.7
|