Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IKVM.CoreLib and Diagnostics #581

Merged
merged 13 commits into from
Aug 25, 2024
Merged
5 changes: 5 additions & 0 deletions IKVM.refs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.CoreLib\IKVM.CoreLib.csproj">
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<PrivateAssets>all</PrivateAssets>
<OutputItemType>IkvmLibsItem</OutputItemType>
</ProjectReference>
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.Runtime\IKVM.Runtime.csproj">
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<PrivateAssets>all</PrivateAssets>
Expand Down
6 changes: 6 additions & 0 deletions IKVM.sln
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libj2gss", "src\libj2gss\li
EndProject
Project("{6DE1C62B-E8D7-451A-8734-87EAEB46E35B}") = "libsspi_bridge", "src\libsspi_bridge\libsspi_bridge.clangproj", "{461D3F93-30AD-481E-B3D3-476A3CE2BF7B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IKVM.CoreLib", "src\IKVM.CoreLib\IKVM.CoreLib.csproj", "{C6556982-85B8-4E58-A693-1239D4823BD7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -909,6 +911,10 @@ Global
{461D3F93-30AD-481E-B3D3-476A3CE2BF7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{461D3F93-30AD-481E-B3D3-476A3CE2BF7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{461D3F93-30AD-481E-B3D3-476A3CE2BF7B}.Release|Any CPU.Build.0 = Release|Any CPU
{C6556982-85B8-4E58-A693-1239D4823BD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6556982-85B8-4E58-A693-1239D4823BD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6556982-85B8-4E58-A693-1239D4823BD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6556982-85B8-4E58-A693-1239D4823BD7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
19 changes: 18 additions & 1 deletion src/IKVM.ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
namespace IKVM.ConsoleApp
using System;
using System.Diagnostics.Tracing;

using IKVM.Runtime;

namespace IKVM.ConsoleApp
{

public class Program
{

public static void Main(string[] args)
{
var l = new Listener();
var o = new java.lang.Object();
java.lang.System.loadLibrary("hi");
}

}

class Listener : EventListener
{

protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
Console.WriteLine(eventData);
}

}
Expand Down
23 changes: 23 additions & 0 deletions src/IKVM.CoreLib/Diagnostics/Diagnostic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Text;

namespace IKVM.CoreLib.Diagnostics
{

#if NET8_0_OR_GREATER
internal partial record class Diagnostic(int Id, string Name, CompositeFormat Message, DiagnosticLevel Level)
#else
internal partial record class Diagnostic(int Id, string Name, string Message, DiagnosticLevel Level)
#endif
{

/// <summary>
/// Creates a new diagnostic event with the specified arguments.
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public DiagnosticEvent Event(ReadOnlySpan<object?> args) => new DiagnosticEvent(this, args);

}

}
Loading
Loading