Skip to content

Commit

Permalink
Introduced native code of System.c for initializing most system prope…
Browse files Browse the repository at this point in the history
…rties. Takes care of OS detection and stuff, so we no longer need to call uname, etc. Remove Mono.Unix/Posix from IKVM.Java dependency. Still remains on tools that set executable bits. Though this is apparently now possible in NET 7+... we still support 6.

Fixes #529
  • Loading branch information
wasabii committed Jun 2, 2024
1 parent 4e83074 commit e6314ac
Show file tree
Hide file tree
Showing 16 changed files with 1,144 additions and 1,079 deletions.
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<SupportedImageRuntimes>win-x64;win-x86;win-arm64;linux-x64;linux-arm;linux-arm64;linux-musl-x64;linux-musl-arm;linux-musl-arm64;osx-x64;osx-arm64</SupportedImageRuntimes>
<EnabledImageRuntimes Condition=" '$(EnabledImageRuntimes)' == '' ">$(SupportedImageRuntimes)</EnabledImageRuntimes>

<!--<EnabledRuntimes>win-x64;win-x86;linux-x64</EnabledRuntimes>
<EnabledToolRuntimes>win-x64;win-x86;linux-x64</EnabledToolRuntimes>
<EnabledImageRuntimes>win-x64;win-x86;linux-x64</EnabledImageRuntimes>-->
<EnabledRuntimes>win-x64;linux-x64</EnabledRuntimes>
<EnabledToolRuntimes>win-x64;linux-x64</EnabledToolRuntimes>
<EnabledImageRuntimes>win-x64;linux-x64</EnabledImageRuntimes>

<_SupportedRuntimes>;$(SupportedRuntimes);</_SupportedRuntimes>
<_EnabledRuntimes>;$(EnabledRuntimes);</_EnabledRuntimes>
Expand Down Expand Up @@ -60,7 +60,7 @@
<PropertyGroup Label="Package Info">
<RepositoryUrl Condition=" '$(RepositoryUrl)' == '' ">https://github.com/ikvmnet/ikvm.git</RepositoryUrl>
<RepositoryType Condition=" '$(RepositoryType)' == '' ">git</RepositoryType>
<PackageProjectUrl Condition=" '$(PackageProjectUrl)' == '' ">https://ikvm.org</PackageProjectUrl>
<PackageProjectUrl Condition=" '$(PackageProjectUrl)' == '' ">https://ikvm.org</PackageProjectUrl>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">$(Version)</PackageVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
5 changes: 0 additions & 5 deletions IKVM.deps.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project>

<ItemGroup>
<PackageReference Include="Mono.Unix" Version="7.1.0-final.1.21458.1" GeneratePathProperty="true" />
<PackageReference Include="Mono.Posix" Version="7.1.0-final.1.21458.1" GeneratePathProperty="true" />
</ItemGroup>

<Choose>
<When Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">
<ItemGroup>
Expand Down
41 changes: 7 additions & 34 deletions src/IKVM.ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,51 +1,24 @@
using System.Diagnostics;

using java.awt;
using System.Runtime.CompilerServices;

namespace IKVM.ConsoleApp
{

public static class Program
public class Program
{
public static void Main(string[] args)
{
while (!Debugger.IsAttached)
System.Threading.Thread.Sleep(100);

java.lang.System.@out.println("hi");
System.Console.ReadLine();
new Program().New();
}

public class AWTExample1 : Frame
[MethodImpl(MethodImplOptions.NoInlining)]
void New()
{

AWTExample1()
{
var t = new TextField("THIS IS TEXT");
t.setBounds(30, 30, 80, 30);
add(t);

var b = new Button("1234");
b.setLabel("1234");
b.setBounds(30, 100, 80, 30);
add(b);

var b2 = new Button("1234");
b2.setLabel("1234");
b2.setBounds(30, 200, 80, 30);
add(b2);

setSize(300, 300);
setTitle("This is our basic AWT example");
setLayout(null);
setVisible(true);
}

public static void Foo()
{
new AWTExample1();
}

java.lang.System.@out.println("hi");
System.Console.ReadLine();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<ItemGroup>
<PackageReference Include="Castle.Core" Version="5.1.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Mono.Unix" Version="7.1.0-final.1.21458.1" />
</ItemGroup>

<ItemGroup>
Expand Down
52 changes: 0 additions & 52 deletions src/IKVM.Java/local/ikvm/internal/MonoUtils.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/IKVM.Java/local/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public static void setProperties(Properties props) {
* @exception NullPointerException if <code>key</code> is
* <code>null</code>.
* @exception IllegalArgumentException if <code>key</code> is empty.
* @see #setPropertycheckKey
* @see #setProperty
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
* @see java.lang.System#getProperties()
Expand Down
1 change: 1 addition & 0 deletions src/IKVM.MSBuild.Tasks/IKVM.MSBuild.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" PrivateAssets="All" />
<PackageReference Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="8.0.0-preview.7.23375.6" GeneratePathProperty="true" />
<PackageReference Include="Mono.Unix" Version="7.1.0-final.1.21458.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit e6314ac

Please sign in to comment.