-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved the JAR conversion into a IKVM.Net.Sdk project. The goal here i…
…s to be able to provide additional integrated class for SLF4J, so we can relay logging messages out of Aether. Implemented a ThreadLocal context design, so we can direct logs for specific task calls (even if multiple outstanding).
- Loading branch information
Showing
14 changed files
with
1,011 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
{ | ||
"sdk": { | ||
"version": "7.0.100", | ||
"rollForward": "latestFeature" | ||
} | ||
"sdk": { | ||
"version": "7.0.100", | ||
"rollForward": "latestFeature" | ||
}, | ||
"msbuild-sdks": { | ||
"IKVM.NET.Sdk": "8.7.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package IKVM.Maven.Sdk.Tasks.Java; | ||
|
||
import org.slf4j.*; | ||
|
||
public class AdapterLoggerFactory implements ILoggerFactory { | ||
|
||
public static ILoggerFactory LoggerFactory; | ||
|
||
final ILoggerFactory factory; | ||
|
||
public AdapterLoggerFactory(ILoggerFactory factory) { | ||
this.factory = factory; | ||
} | ||
|
||
@Override | ||
public final Logger getLogger(final String name) { | ||
return factory.getLogger(name); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/IKVM.Maven.Sdk.Tasks.Java/IKVM.Maven.Sdk.Tasks.Java.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="IKVM.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net472;net6.0</TargetFrameworks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Folder Include="org\slf4j\impl\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<Target Name="DownloadMavenArtifacts"> | ||
<Exec Command="mvn org.apache.maven.plugins:maven-dependency-plugin:3.3.0:copy-dependencies -f ikvm-maven-sdk-tasks-java.pom -DoutputDirectory=$(IntermediateOutputPath)maven" /> | ||
</Target> | ||
|
||
<Target Name="AddJavaReferences" DependsOnTargets="DownloadMavenArtifacts" BeforeTargets="GetIkvmReferenceItemsFromIkvmReferences"> | ||
<ItemGroup> | ||
<Convert Include="$(IntermediateOutputPath)maven\*.jar" /> | ||
<Classpath Include="$(IntermediateOutputPath)maven\*.jar" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
2 changes: 1 addition & 1 deletion
2
....Maven.Sdk.Tasks/ikvm-maven-sdk-tasks.pom → ....Tasks.Java/ikvm-maven-sdk-tasks-java.pom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/IKVM.Maven.Sdk.Tasks.Java/org/slf4j/impl/StaticLoggerBinder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.slf4j.impl; | ||
|
||
import org.slf4j.*; | ||
import org.slf4j.spi.*; | ||
|
||
import IKVM.Maven.Sdk.Tasks.Java.*; | ||
|
||
public final class StaticLoggerBinder implements LoggerFactoryBinder { | ||
|
||
public static String REQUESTED_API_VERSION = "1.7"; | ||
static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); | ||
|
||
final ILoggerFactory loggerFactory; | ||
|
||
private StaticLoggerBinder() { | ||
loggerFactory = new AdapterLoggerFactory(AdapterLoggerFactory.LoggerFactory); | ||
} | ||
|
||
public static StaticLoggerBinder getSingleton() { | ||
return SINGLETON; | ||
} | ||
|
||
@Override | ||
public ILoggerFactory getLoggerFactory() { | ||
return loggerFactory; | ||
} | ||
|
||
@Override | ||
public String getLoggerFactoryClassStr() { | ||
return AdapterLoggerFactory.class.getName(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.