From 72b8bdfcb8e7f460dc7eab69ff2ce4f1302f39ae Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 6 Dec 2023 15:19:36 -0600 Subject: [PATCH] Well try that. Static.... --- .../MavenReferenceItemResolve.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/IKVM.Maven.Sdk.Tasks/MavenReferenceItemResolve.cs b/src/IKVM.Maven.Sdk.Tasks/MavenReferenceItemResolve.cs index 3c3a2b7..c1592e9 100644 --- a/src/IKVM.Maven.Sdk.Tasks/MavenReferenceItemResolve.cs +++ b/src/IKVM.Maven.Sdk.Tasks/MavenReferenceItemResolve.cs @@ -54,10 +54,29 @@ public class MavenReferenceItemResolve : Task } }; + static MSBuildLogTraceListener listener; + static MavenReferenceItemResolve() { IKVM.Runtime.Tracer.SetTraceLevel("jni", System.Diagnostics.TraceLevel.Verbose); - Trace.Listeners.Add(new ConsoleTraceListener()); + Trace.Listeners.Add(listener = new MSBuildLogTraceListener()); + } + + class MSBuildLogTraceListener : TraceListener + { + + public Task task; + + public override void Write(string message) + { + task.Log.LogMessage(message); + } + + public override void WriteLine(string message) + { + task.Log.LogMessage(message); + } + } /// @@ -66,7 +85,7 @@ static MavenReferenceItemResolve() public MavenReferenceItemResolve() : base(SR.ResourceManager, "MAVEN:") { - + listener.task = this; } ///