Skip to content

Commit 60d2579

Browse files
committed
[Java.Base] Begin binding JDK-11 java.base module
Context: #858 What do *I* want? To be able to use our wonderful Java binding infrastructure against *Desktop Java*, not just Android. At the same time, I don't want "Android-isms" "leaking" into such a binding. *Just* Java.Interop, no xamarin-android. "Take over" the `generator --codegen-target=JavaInterop1` format so that it *isn't* useful for Xamarin.Android, and is instead usable for non-Android usage. This is a work-in-progress, and *far* from complete. For prototype purposes, this *only* binds: * `java.lang.Object` * `java.lang.Throwable` * `java.lang.Class` The `Java.Base` binding is only for .NET 6 and above. I'm not interested in .NET Standard support at this point in time. Update `samples/Hello` so that it (1) works, and (2) instantiates the `Java.Lang.Object` binding: dotnet run --project samples/Hello ~~ Binding changes vs. Xamarin.Android ~~ Java arrays are bound as appropriate `Java.Interop.Java*Array` types. This should help reduce marshaling logic & overhead, as arrays don't need to be "deep copied". The exception is C# `params` arrays, which continue to be bound as arrays, and are marshaled via an appropriate `Java*Array` type. `java.io.InputStream` isn't bound as `System.IO.Stream`, etc. "Java.Interop-style" constructors are used (25de1f3), e.g. // This DeclaringType (ref JniObjectReference reference, JniObjectReferenceOptions options); // Not Xamarin.Android-style DeclaringType (IntPtr handle, JniHandleOwnership transfer); "Java.Interop-style" wrapper construction is used, e.g. // This var wrapper = JniEnvironment.Runtime.ValueManager.GetValue<DeclaringType>(ref h, JniObjectReferenceOptions.CopyAndDispose); // Not this var wrapper = Java.Lang.Object.GetObject<DeclaringType>(handle); Marshal methods are currently skipped. Java-to-managed invocations are not currently supported. ~~ TODO: Marshal Methods? ~~ Xamarin.Android uses Java Callable Wrappers + `Runtime.register()` to specify which methods to register, via lots of reflection, etc. For Desktop, JCW's shouldn't have all the methods to register. Instead, use the `jnimarshalmethod-gen`-originated strategy of `[JniAddNativeMethodRegistrationAttribute]` within the binding, and then have it use `MarshalMethodBuilder` to generate the marshal methods. Need to update `MarshalMethodBuilder` to look for overrides in addition to methods with [`JavaCallable`], which in turn will require an equivalent to `Android.Runtime.RegisterAttribute(…)`. Perhaps `JniMethodSignatureAttribute(string name, string sig)`? In the meantime, `Java.Base` will skip all marshal-method logic plus runtime method generation. Leave that for later. ~~ Open Questions ~~ What's up with `java.lang.Class.getAnnotationsByType()`? During an iteration of this PR, I got: public unsafe Java.Interop.JavaObjectArray<Java.Lang.Object>? GetAnnotationsByType (Java.Lang.Class? annotationClass) { const string __id = "getAnnotationsByType.(Ljava/lang/Class;)[Ljava/lang/annotation/Annotation;"; From `__id` we see that the Java return type is `Annotation[]`, yet we bind it as an `Object` array? Why? How do we fix that to instead bind it as `JavaObjectArray<Java.Lang.Annotations.Annotation>`? Currently, it's differently *worse*; I don't know why, but `__id` is now: const string __id = "getAnnotationsByType.(Ljava/lang/Class;)[Ljava/lang/Object;"; i.e. the return type is an `Object` array instead of an `Annotation` array, which is wrong, as per `javap`: % javap -s java.lang.Class … public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A>); descriptor: (Ljava/lang/Class;)Ljava/lang/annotation/Annotation; Fixing unit tests...
1 parent 13be0dd commit 60d2579

File tree

424 files changed

+12672
-4334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

424 files changed

+12672
-4334
lines changed

Java.Interop.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Java.Interop.Tools.JavaType
105105
EndProject
106106
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Java.Interop.Tools.JavaTypeSystem-Tests", "tests\Java.Interop.Tools.JavaTypeSystem-Tests\Java.Interop.Tools.JavaTypeSystem-Tests.csproj", "{11942DE9-AEC2-4B95-87AB-CA707C37643D}"
107107
EndProject
108+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Java.Base", "src\Java.Base\Java.Base.csproj", "{30DCECA5-16FD-4FD0-883C-E5E83B11565D}"
109+
EndProject
108110
Global
109111
GlobalSection(SharedMSBuildProjectFiles) = preSolution
110112
src\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems*{58b564a1-570d-4da2-b02d-25bddb1a9f4f}*SharedItemsImports = 5
@@ -296,6 +298,10 @@ Global
296298
{11942DE9-AEC2-4B95-87AB-CA707C37643D}.Debug|Any CPU.Build.0 = Debug|Any CPU
297299
{11942DE9-AEC2-4B95-87AB-CA707C37643D}.Release|Any CPU.ActiveCfg = Release|Any CPU
298300
{11942DE9-AEC2-4B95-87AB-CA707C37643D}.Release|Any CPU.Build.0 = Release|Any CPU
301+
{30DCECA5-16FD-4FD0-883C-E5E83B11565D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
302+
{30DCECA5-16FD-4FD0-883C-E5E83B11565D}.Debug|Any CPU.Build.0 = Debug|Any CPU
303+
{30DCECA5-16FD-4FD0-883C-E5E83B11565D}.Release|Any CPU.ActiveCfg = Release|Any CPU
304+
{30DCECA5-16FD-4FD0-883C-E5E83B11565D}.Release|Any CPU.Build.0 = Release|Any CPU
299305
EndGlobalSection
300306
GlobalSection(SolutionProperties) = preSolution
301307
HideSolutionNode = FALSE
@@ -346,6 +352,7 @@ Global
346352
{BF5A4019-F2FF-45AC-949D-EF7E8C94196B} = {271C9F30-F679-4793-942B-0D9527CB3E2F}
347353
{B173F53B-986C-4E0D-881C-063BBB116E1D} = {0998E45F-8BCE-4791-A944-962CD54E2D80}
348354
{11942DE9-AEC2-4B95-87AB-CA707C37643D} = {271C9F30-F679-4793-942B-0D9527CB3E2F}
355+
{30DCECA5-16FD-4FD0-883C-E5E83B11565D} = {0998E45F-8BCE-4791-A944-962CD54E2D80}
349356
EndGlobalSection
350357
GlobalSection(ExtensibilityGlobals) = postSolution
351358
SolutionGuid = {29204E0C-382A-49A0-A814-AD7FBF9774A5}

build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/JdkInfo.cs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public class JdkInfo : Task
1919
{
2020
public string JdksRoot { get; set; }
2121

22+
public string PropertyNameModifier { get; set; } = "";
23+
public string MinimumJdkVersion { get; set; }
2224
public string MaximumJdkVersion { get; set; }
2325

2426
public string DotnetToolPath { get; set; }
@@ -28,17 +30,18 @@ public class JdkInfo : Task
2830
[Required]
2931
public ITaskItem PropertyFile { get; set; }
3032

31-
[Required]
3233
public ITaskItem MakeFragmentFile { get; set; }
3334

3435
[Output]
3536
public string JavaHomePath { get; set; }
3637

3738
public override bool Execute ()
3839
{
40+
var minVersion = GetVersion (MinimumJdkVersion);
3941
var maxVersion = GetVersion (MaximumJdkVersion);
4042

4143
XATInfo jdk = XATInfo.GetKnownSystemJdkInfos (CreateLogger ())
44+
.Where (j => minVersion != null ? j.Version >= minVersion : true)
4245
.Where (j => maxVersion != null ? j.Version <= maxVersion : true)
4346
.Where (j => j.IncludePath.Any ())
4447
.FirstOrDefault ();
@@ -56,10 +59,12 @@ public override bool Execute ()
5659
JavaHomePath = jdk.HomePath;
5760

5861
Directory.CreateDirectory (Path.GetDirectoryName (PropertyFile.ItemSpec));
59-
Directory.CreateDirectory (Path.GetDirectoryName (MakeFragmentFile.ItemSpec));
60-
6162
WritePropertyFile (jdk.JavaPath, jdk.JarPath, jdk.JavacPath, jdk.JdkJvmPath, rtJarPath, jdk.IncludePath);
62-
WriteMakeFragmentFile (jdk.JavaPath, jdk.JarPath, jdk.JavacPath, jdk.JdkJvmPath, rtJarPath, jdk.IncludePath);
63+
64+
if (MakeFragmentFile != null) {
65+
Directory.CreateDirectory (Path.GetDirectoryName (MakeFragmentFile.ItemSpec));
66+
WriteMakeFragmentFile (jdk.JavaPath, jdk.JarPath, jdk.JavacPath, jdk.JdkJvmPath, rtJarPath, jdk.IncludePath);
67+
}
6368

6469
return !Log.HasLoggedErrors;
6570
}
@@ -97,39 +102,35 @@ Action<TraceLevel, string> CreateLogger ()
97102

98103
void WritePropertyFile (string javaPath, string jarPath, string javacPath, string jdkJvmPath, string rtJarPath, IEnumerable<string> includes)
99104
{
100-
var dotnet = string.IsNullOrEmpty (DotnetToolPath) ? "dotnet" : DotnetToolPath;
101105
var msbuild = XNamespace.Get ("http://schemas.microsoft.com/developer/msbuild/2003");
106+
var jdkJvmP = $"JdkJvm{PropertyNameModifier}Path";
102107
var project = new XElement (msbuild + "Project",
103108
new XElement (msbuild + "Choose",
104-
new XElement (msbuild + "When", new XAttribute ("Condition", " '$(JdkJvmPath)' == '' "),
109+
new XElement (msbuild + "When", new XAttribute ("Condition", $" '$({jdkJvmP})' == '' "),
105110
new XElement (msbuild + "PropertyGroup",
106-
new XElement (msbuild + "JdkJvmPath", jdkJvmPath)),
111+
new XElement (msbuild + jdkJvmP, jdkJvmPath)),
107112
new XElement (msbuild + "ItemGroup",
108-
includes.Select (i => new XElement (msbuild + "JdkIncludePath", new XAttribute ("Include", i)))))),
113+
includes.Select (i => new XElement (msbuild + $"Jdk{PropertyNameModifier}IncludePath", new XAttribute ("Include", i)))))),
109114
new XElement (msbuild + "PropertyGroup",
110-
new XElement (msbuild + "JavaSdkDirectory", new XAttribute ("Condition", " '$(JavaSdkDirectory)' == '' "),
111-
JavaHomePath),
112-
new XElement (msbuild + "JavaPath", new XAttribute ("Condition", " '$(JavaPath)' == '' "),
113-
javaPath),
114-
new XElement (msbuild + "JavaCPath", new XAttribute ("Condition", " '$(JavaCPath)' == '' "),
115-
javacPath),
116-
new XElement (msbuild + "JarPath", new XAttribute ("Condition", " '$(JarPath)' == '' "),
117-
jarPath),
118-
new XElement (msbuild + "DotnetToolPath", new XAttribute ("Condition", " '$(DotnetToolPath)' == '' "),
119-
dotnet),
120-
CreateJreRtJarPath (msbuild, rtJarPath)));
115+
CreateProperty (msbuild, $"Java{PropertyNameModifier}SdkDirectory", JavaHomePath),
116+
CreateProperty (msbuild, $"Java{PropertyNameModifier}Path", javaPath),
117+
CreateProperty (msbuild, $"JavaC{PropertyNameModifier}Path", javacPath),
118+
CreateProperty (msbuild, $"Jar{PropertyNameModifier}Path", jarPath),
119+
CreateProperty (msbuild, $"Dotnet{PropertyNameModifier}ToolPath", DotnetToolPath),
120+
CreateProperty (msbuild, $"Jre{PropertyNameModifier}RtJarPath", rtJarPath)));
121121
project.Save (PropertyFile.ItemSpec);
122122
}
123123

124-
static XElement CreateJreRtJarPath (XNamespace msbuild, string rtJarPath)
124+
XElement CreateProperty (XNamespace msbuild, string propertyName, string propertyValue)
125125
{
126-
if (rtJarPath == null)
126+
if (string.IsNullOrEmpty (propertyValue)) {
127127
return null;
128-
return new XElement (msbuild + "JreRtJarPath",
129-
new XAttribute ("Condition", " '$(JreRtJarPath)' == '' "),
130-
rtJarPath);
131-
}
128+
}
132129

130+
return new XElement (msbuild + propertyName,
131+
new XAttribute ("Condition", $" '$({propertyName})' == '' "),
132+
propertyValue);
133+
}
133134
void WriteMakeFragmentFile (string javaPath, string jarPath, string javacPath, string jdkJvmPath, string rtJarPath, IEnumerable<string> includes)
134135
{
135136
using (var o = new StreamWriter (MakeFragmentFile.ItemSpec)) {

samples/Hello/Hello.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net472</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<OutputType>Exe</OutputType>
6-
<OutputPath>..\..\bin\Test$(Configuration)</OutputPath>
76
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
8-
</PropertyGroup>
9-
10-
<PropertyGroup>
11-
<OutputPath>$(TestOutputFullPath)</OutputPath>
7+
<Nullable>enable</Nullable>
128
</PropertyGroup>
139

1410
<ItemGroup>
@@ -18,6 +14,8 @@
1814
<ItemGroup>
1915
<ProjectReference Include="..\..\src\Java.Interop\Java.Interop.csproj" />
2016
<ProjectReference Include="..\..\src\Java.Runtime.Environment\Java.Runtime.Environment.csproj" />
17+
<ProjectReference Include="..\..\src\Java.Base\Java.Base.csproj" />
18+
<ProjectReference Include="..\..\tests\TestJVM\TestJVM.csproj" />
2119
</ItemGroup>
2220

2321
</Project>

samples/Hello/Program.cs

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,65 @@
11
using System;
22
using System.Threading;
33

4+
using Mono.Options;
5+
46
using Java.Interop;
57

68
namespace Hello
79
{
8-
class MainClass
10+
class App
911
{
10-
public static unsafe void Main (string[] args)
12+
public static void Main (string[] args)
1113
{
12-
Console.WriteLine ("Hello World!");
13-
try {
14-
var ignore = JniRuntime.CurrentRuntime;
15-
} catch (InvalidOperationException e) {
16-
Console.WriteLine (e);
14+
string? jvmPath = global::Java.InteropTests.TestJVM.GetJvmLibraryPath ();
15+
bool createMultipleVMs = false;
16+
bool showHelp = false;
17+
var options = new OptionSet () {
18+
"Using the JVM from C#!",
19+
"",
20+
"Options:",
21+
{ "jvm=",
22+
$"{{PATH}} to JVM to use. Default is:\n {jvmPath}",
23+
v => jvmPath = v },
24+
{ "m",
25+
"Create multiple Java VMs. This will likely creash.",
26+
v => createMultipleVMs = v != null },
27+
{ "h|help",
28+
"Show this message and exit.",
29+
v => showHelp = v != null },
30+
};
31+
options.Parse (args);
32+
if (showHelp) {
33+
options.WriteOptionDescriptions (Console.Out);
34+
return;
1735
}
36+
Console.WriteLine ("Hello World!");
37+
var builder = new JreRuntimeOptions () {
38+
JniAddNativeMethodRegistrationAttributePresent = true,
39+
JvmLibraryPath = jvmPath,
40+
};
41+
builder.AddOption ("-Xcheck:jni");
42+
var jvm = builder.CreateJreVM ();
43+
Console.WriteLine ($"JniRuntime.CurrentRuntime == jvm? {ReferenceEquals (JniRuntime.CurrentRuntime, jvm)}");
1844
foreach (var h in JniRuntime.GetAvailableInvocationPointers ()) {
1945
Console.WriteLine ("PRE: GetCreatedJavaVMHandles: {0}", h);
2046
}
47+
48+
CreateJLO ();
49+
50+
if (createMultipleVMs) {
51+
CreateAnotherJVM ();
52+
}
53+
}
54+
55+
static void CreateJLO ()
56+
{
57+
var jlo = new Java.Lang.Object ();
58+
Console.WriteLine ($"binding? {jlo.ToString ()}");
59+
}
60+
61+
static unsafe void CreateAnotherJVM ()
62+
{
2163
Console.WriteLine ("Part 2!");
2264
using (var vm = new JreRuntimeOptions ().CreateJreVM ()) {
2365
Console.WriteLine ("# JniEnvironment.EnvironmentPointer={0}", JniEnvironment.EnvironmentPointer);

src/Java.Base/Java.Base.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0</TargetFrameworks>
5+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\Java.Interop\Java.Interop.csproj" />
11+
<ProjectReference Include="..\..\tools\class-parse.csproj" ReferenceOutputAssembly="False" />
12+
<ProjectReference Include="..\..\tools\generator.csproj" ReferenceOutputAssembly="False" />
13+
</ItemGroup>
14+
15+
<Import Project="Java.Base.targets" />
16+
17+
</Project>

src/Java.Base/Java.Base.targets

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<Project>
2+
3+
<UsingTask TaskName="Java.Interop.BootstrapTasks.JdkInfo" AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\Java.Interop.BootstrapTasks.dll" />
4+
5+
<Import
6+
Condition=" Exists('$(IntermediateOutputPath)jdk-11.props') "
7+
Project="$(IntermediateOutputPath)jdk-11.props"
8+
/>
9+
10+
<PropertyGroup>
11+
<GeneratorPath>$(ToolOutputFullPath)generator.dll</GeneratorPath>
12+
</PropertyGroup>
13+
14+
<Target Name="_FindJdk11">
15+
<JdkInfo
16+
Condition=" !Exists('$(IntermediateOutputPath)jdk-11.props') "
17+
PropertyNameModifier="11"
18+
JdksRoot="$(JdksRoot)"
19+
MinimumJdkVersion="11.0"
20+
MaximumJdkVersion="11.99.0"
21+
PropertyFile="$(IntermediateOutputPath)jdk-11.props">
22+
<Output TaskParameter="JavaHomePath" PropertyName="Java11SdkDirectory"/>
23+
</JdkInfo>
24+
</Target>
25+
26+
<Target Name="_GetJavaBaseJmodPath"
27+
DependsOnTargets="_FindJdk11">
28+
<PropertyGroup Condition=" '$(Java11SdkDirectory)' != '' ">
29+
<_JavaBaseJmod>$(Java11SdkDirectory)/jmods/java.base.jmod</_JavaBaseJmod>
30+
</PropertyGroup>
31+
</Target>
32+
33+
<Target Name="_GenerateApiDescription"
34+
DependsOnTargets="_GetJavaBaseJmodPath"
35+
BeforeTargets="_GenerateBinding"
36+
Inputs="$(_JavaBaseJmod)"
37+
Outputs="$(IntermediateOutputPath)\mcw\api.xml">
38+
<MakeDir Directories="$(IntermediateOutputPath)mcw" />
39+
<PropertyGroup>
40+
<_ClassParse>"$(ToolOutputFullPath)class-parse.dll"</_ClassParse>
41+
<_Input>"$(_JavaBaseJmod)"</_Input>
42+
<_Output>"-o=$(IntermediateOutputPath)/mcw/api.xml"</_Output>
43+
</PropertyGroup>
44+
<Error
45+
Condition=" !Exists($(_JavaBaseJmod)) "
46+
Text="Could not find a JDK-11 installation directory"
47+
/>
48+
<Exec
49+
Command="$(DotnetToolPath) $(_ClassParse) $(_Input) $(_Output)"
50+
/>
51+
</Target>
52+
53+
<ItemGroup>
54+
<_GenerateBindingInputs Include="$(GeneratorPath)" />
55+
<_GenerateBindingInputs Include="$(MSBuildThisFileFullPath)" />
56+
<_GenerateBindingInputs Include="Transforms\**" />
57+
<_GenerateBindingInputs Include="$(IntermediateOutputPath)mcw\api.xml" />
58+
</ItemGroup>
59+
60+
<Target Name="_GenerateBinding"
61+
BeforeTargets="CoreCompile"
62+
Inputs="@(_GenerateBindingInputs)"
63+
Outputs="$(IntermediateOutputPath)mcw\Java.Base.projitems">
64+
<MakeDir Directories="$(IntermediateOutputPath)mcw" />
65+
<PropertyGroup>
66+
<Generator>"$(GeneratorPath)"</Generator>
67+
<_GenFlags>--public</_GenFlags>
68+
<_Out>-o "$(IntermediateOutputPath)mcw"</_Out>
69+
<_Codegen>--codegen-target=JavaInterop1</_Codegen>
70+
<_Fixup>--fixup=Transforms/Metadata.xml</_Fixup>
71+
<_Enums1>--preserve-enums --enumflags=Transforms/enumflags --enumfields=Transforms/map.csv --enummethods=Transforms/methodmap.csv</_Enums1>
72+
<_Enums2>--enummetadata=$(IntermediateOutputPath)mcw/enummetadata</_Enums2>
73+
<_Assembly>"--assembly=Java.Base"</_Assembly>
74+
<_TypeMap>--type-map-report=$(IntermediateOutputPath)mcw/type-mapping.txt</_TypeMap>
75+
<_Api>$(IntermediateOutputPath)mcw/api.xml</_Api>
76+
<_Dirs>--enumdir=$(IntermediateOutputPath)mcw</_Dirs>
77+
<_FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)'))</_FullIntermediateOutputPath>
78+
<_LangFeatures>--lang-features=nullable-reference-types,default-interface-methods,nested-interface-types,interface-constants</_LangFeatures>
79+
</PropertyGroup>
80+
<Exec
81+
Command="$(DotnetToolPath) $(Generator) $(_GenFlags) $(_ApiLevel) $(_Out) $(_Codegen) $(_Fixup) $(_Enums1) $(_Enums2) $(_Versions) $(_Annotations) $(_Assembly) $(_TypeMap) $(_LangFeatures) $(_Dirs) $(_Api) $(_WithJavadocXml)"
82+
IgnoreStandardErrorWarningFormat="True"
83+
/>
84+
<ItemGroup>
85+
<Compile Include="$(_FullIntermediateOutputPath)\mcw\**\*.cs" KeepDuplicates="False" />
86+
</ItemGroup>
87+
<XmlPeek
88+
Namespaces="&lt;Namespace Prefix='msbuild' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"
89+
XmlInputPath="$(IntermediateOutputPath)mcw\Java.Base.projitems"
90+
Query="/msbuild:Project/msbuild:PropertyGroup/msbuild:DefineConstants/text()" >
91+
<Output TaskParameter="Result" PropertyName="_GeneratedDefineConstants" />
92+
</XmlPeek>
93+
<PropertyGroup>
94+
<DefineConstants>$(DefineConstants);$([System.String]::Copy('$(_GeneratedDefineConstants)').Replace ('%24(DefineConstants);', ''))</DefineConstants>
95+
</PropertyGroup>
96+
</Target>
97+
98+
</Project>

src/Java.Base/Java.Lang/Object.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Java.Interop;
4+
5+
namespace Java.Lang {
6+
7+
public partial class Object : JavaObject {
8+
9+
public Object (ref JniObjectReference reference, JniObjectReferenceOptions options)
10+
: base (ref reference, options)
11+
{
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Java.Interop;
4+
5+
namespace Java.Lang {
6+
7+
public partial class Throwable : JavaException {
8+
9+
public Throwable (ref JniObjectReference reference, JniObjectReferenceOptions options)
10+
: base (ref reference, options)
11+
{
12+
}
13+
}
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<metadata>
2+
<!-- For now, just bind java.lang.* -->
3+
<remove-node path="//api/package[not(starts-with(@name, 'java.lang'))]" />
4+
5+
<!-- For now, just bind Class, Object, Throwable -->
6+
<remove-node path="//api/package/interface" />
7+
<remove-node path="//api/package/class[not(@name = 'Class' or @name = 'Object' or @name = 'Throwable')]" />
8+
9+
<attr path="/api/package[@name='java.lang']/class[@name='Object']/method[@name='finalize']" name="managedName">JavaFinalize</attr>
10+
</metadata>

src/Java.Base/Transforms/enumflags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Java.Net.IDNFlags
2+
Java.Util.FormatFlags

0 commit comments

Comments
 (0)