Skip to content

Commit

Permalink
Merge branch 'bugfix/msbuild-task-message-null' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AliveDevil committed Nov 28, 2024
2 parents a76579e + 05c39eb commit 15cad32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/IKVM.MSBuild.Tasks/IkvmToolTaskDiagnosticWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public async ValueTask ReceiveAsync(IkvmToolDiagnosticEvent @event, Cancellation
logger.LogWarning(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, @event.Message, @event.Args);
break;
case IkvmToolDiagnosticEventLevel.Error:
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, MessageImportance.Normal, @event.Message, @event.Args);
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, @event.Message, @event.Args);
break;
case IkvmToolDiagnosticEventLevel.Fatal:
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, MessageImportance.High, @event.Message, @event.Args);
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, @event.Message, @event.Args);
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/IKVM.Runtime/MethodAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ private void ConditionalPatchNoClassDefFoundError(ref ClassFile.Method.Instructi
private void SetHardError(RuntimeClassLoader classLoader, ref ClassFile.Method.Instruction instruction, HardError hardError, string message, params object[] args)
{
string text = string.Format(message, args);
#if IMPORTER

switch (hardError)
{
case HardError.NoClassDefFoundError:
Expand Down Expand Up @@ -2518,7 +2518,7 @@ private void SetHardError(RuntimeClassLoader classLoader, ref ClassFile.Method.I
default:
throw new InvalidOperationException();
}
#endif
instruction.SetHardError(hardError, AllocErrorMessage(text));
}

Expand Down
1 change: 0 additions & 1 deletion src/IKVM.Runtime/compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,6 @@ void Compile(Block block, int startIndex)
}

var message = harderrors[instr.HardErrorMessageId];
clazz.ClassLoader.Diagnostics.GenericCompilerError($"{exceptionType.Name}: {message}\n\tat {classFile.Name}.{m.Name}{m.Signature}");
ilGenerator.Emit(OpCodes.Ldstr, message);
RuntimeJavaMethod method = exceptionType.GetMethodWrapper("<init>", "(Ljava.lang.String;)V", false);
method.Link();
Expand Down
4 changes: 2 additions & 2 deletions src/IKVM.Tools.Importer/ImportContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ void ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, I

if (options.NoWarn != null)
foreach (var diagnostic in options.NoWarn)
compilerOptions.suppressWarnings.Add($"IKVM{diagnostic.Id:D4}");
compilerOptions.suppressWarnings.Add(diagnostic.Id.ToString());

// TODO handle specific diagnostic IDs
if (options.WarnAsError != null)
Expand All @@ -578,7 +578,7 @@ void ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, I
compilerOptions.warnaserror = true;
else
foreach (var i in options.WarnAsError)
compilerOptions.errorWarnings.Add($"IKVM{i.Id:D4}");
compilerOptions.errorWarnings.Add(i.Id.ToString());
}

if (options.Runtime != null)
Expand Down

0 comments on commit 15cad32

Please sign in to comment.