Skip to content

Commit

Permalink
Add Write and WriteLine to Debug class
Browse files Browse the repository at this point in the history
- Bump version to 1.2.1-preview.
- Bump AssemblyNativeVersion to 100.0.6.2.

Signed-off-by: josesimoes <[email protected]>
  • Loading branch information
josesimoes committed May 12, 2020
1 parent b5f0ff9 commit 03dcceb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
31 changes: 28 additions & 3 deletions source/nanoFramework.Runtime.Native/Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static class Debug
/// Causes a break in execution if the specified assertion (condition) evaluates to false.
/// </summary>
/// <param name="condition">The condition to be evaluated. If the value is false, program execution stops.</param>
[System.Diagnostics.Conditional("DEBUG")]
[Conditional("DEBUG")]
static public void Assert(bool condition)
{
if (!condition)
Expand All @@ -53,7 +53,7 @@ static public void Assert(bool condition)
/// </summary>
/// <param name="condition">The condition to be evaluated. If the value is false, program execution stops.</param>
/// <param name="message">The text to be output if the assertion is false.</param>
[System.Diagnostics.Conditional("DEBUG")]
[Conditional("DEBUG")]
static public void Assert(bool condition, string message)
{
if (!condition)
Expand All @@ -68,13 +68,38 @@ static public void Assert(bool condition, string message)
/// <param name="condition">The condition to be evaluated. If the value is false, program execution stops.</param>
/// <param name="message">The text to be output if the assertion is false.</param>
/// <param name="detailedMessage">The detailed message to be displayed if the assertion is false.</param>
[System.Diagnostics.Conditional("DEBUG")]
[Conditional("DEBUG")]
static public void Assert(bool condition, string message, string detailedMessage)
{
if (!condition)
{
Debugger.Break();
}
}

/// <summary>
/// Writes a message to the trace listeners in the Listeners collection.
/// </summary>
/// <param name="message">A message to write.</param>
/// <remarks>
/// In nanoFramework implementation the message is output to Visual Studio debugger window.
/// </remarks>
[Conditional("DEBUG")]
public static void Write(string message) => WriteLineNative(message, false);

/// <summary>
/// Writes a message followed by a line terminator to the trace listeners in the Listeners collection.
/// </summary>
/// <param name="message">A message to write.</param>
/// <remarks>
/// In nanoFramework implementation the message is output to Visual Studio debugger window.
/// </remarks>
[Conditional("DEBUG")]
public static void WriteLine(string message) => WriteLineNative(message, true);


[MethodImpl(MethodImplOptions.InternalCall)]
extern static private void WriteLineNative(string text, bool addLineFeed);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

////////////////////////////////////////////////////////////////
// update this whenever the native assembly signature changes //
[assembly: AssemblyNativeVersion("100.0.6.1")]
[assembly: AssemblyNativeVersion("100.0.6.2")]
////////////////////////////////////////////////////////////////

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
5 changes: 2 additions & 3 deletions source/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.2.0-preview.{height}",
"version": "1.2.1-preview.{height}",
"assemblyVersion": {
"precision": "revision"
},
Expand All @@ -13,8 +13,7 @@
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"setAllVariables": true,
"buildNumber": null
"setAllVariables": true
},
"release": {
"branchName": "release-v{version}",
Expand Down

0 comments on commit 03dcceb

Please sign in to comment.