Skip to content

Commit 2734074

Browse files
committed
Java.Interop needs JDK-17 support first!
1 parent 33f1e37 commit 2734074

File tree

10 files changed

+29
-19
lines changed

10 files changed

+29
-19
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
branch = main
99
[submodule "external/Java.Interop"]
1010
path = external/Java.Interop
11-
url = https://github.com/xamarin/java.interop.git
12-
branch = main
11+
url = https://github.com/jonpryor/java.interop.git
12+
branch = jonp-allow-jdk-17
1313
[submodule "external/lz4"]
1414
path = external/lz4
1515
url = https://github.com/lz4/lz4.git
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

build-tools/scripts/DotNet.targets

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
/>
1111
</Target>
1212
<Target Name="PrepareJavaInterop">
13+
<ItemGroup>
14+
<_JIPrepArg Include="&quot;-p:Jdks8Root=$(Java8SdkDirectory)&quot;" />
15+
<_JIPrepArg Include="&quot;-p:Jdks11Root=$(JavaSdkDirectory)&quot;" />
16+
<_JIPrepArg Include="&quot;-p:DotnetToolPath=$(DotNetPreviewTool)&quot;" />
17+
<_JIPrepArg Include="&quot;-bl:$(_BinlogPathPrefix)-prepare-java-interop.binlog&quot;" />
18+
</ItemGroup>
1319
<Exec
14-
Command="&quot;$(DotNetPreviewTool)&quot; build -t:Prepare Java.Interop.sln -c $(Configuration) -p:JdksRoot=$(JavaSdkDirectory) -p:DotnetToolPath=$(DotNetPreviewTool) -bl:$(_BinlogPathPrefix)-prepare-java-interop.binlog"
20+
Command="&quot;$(DotNetPreviewTool)&quot; build -t:Prepare Java.Interop.sln -c $(Configuration) @(_JIPrepArg, ' ')"
1521
WorkingDirectory="$(_Root)external\Java.Interop"
1622
/>
1723
</Target>

build-tools/xaprepare/xaprepare/Application/GeneratedMonodroidCmakeFiles.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ void GenerateShellConfig (Context context, StreamWriter sw)
8484
AddReplacements (commonReplacements, hostRuntimeReplacements);
8585

8686
string monodroidObjDir = Path.Combine (Configurables.Paths.MonodroidSourceDir, "obj", context.Configuration);
87-
string jdkInfoPropsPath = Path.Combine (Configurables.Paths.ExternalJavaInteropDir, "bin", $"Build{context.Configuration}", "JdkInfo.props");
87+
string jdkInfoPropsPath = Path.Combine (Configurables.Paths.ExternalJavaInteropDir, "bin", $"Build{context.Configuration}", "JdkInfo-11.props");
8888

8989
sw.WriteLine ("# This is a bash(1) script");
9090
sw.WriteLine ();
9191
sw.WriteLine ($"CMAKE=\"{context.Properties.GetRequiredValue(KnownProperties.CMakePath)}\"");
92-
sw.WriteLine ($"JDK_INCLUDE_PATH=\"$(grep JdkIncludePath {jdkInfoPropsPath} | cut -d '\"' -f 2 | tr '\\n' ' ')\"");
92+
sw.WriteLine ($"JDK_INCLUDE_PATH=\"$(grep Jdk11IncludePath {jdkInfoPropsPath} | cut -d '\"' -f 2 | tr '\\n' ' ')\"");
9393
sw.WriteLine ($"MONO_SOURCE_PATH=\"{Configurables.Paths.MonoSourceFullPath}\"");
9494
sw.WriteLine ($"MONODROID_OBJ_DIR=\"{monodroidObjDir}\"");
9595
sw.WriteLine ($"MONODROID_SOURCE_DIR=\"{Configurables.Paths.MonodroidSourceDir}\"");
@@ -341,7 +341,7 @@ void GenerateMonodroidTargets (Context context, StreamWriter sw)
341341

342342
var hostRuntimeReplacements = new Dictionary<string, string> (StringComparer.Ordinal) {
343343
{ "@CmakeHostFlags@", "%(_HostRuntime.CmakeFlags)" },
344-
{ "@JdkIncludePath@", "@(JdkIncludePath->'%(Identity)', ' ')" },
344+
{ "@JdkIncludePath@", "@(Jdk11IncludePath->'%(Identity)', ' ')" },
345345
{ "@OUTPUT_DIRECTORY@", "" },
346346
};
347347

build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static partial class Defaults
5757
public static readonly string BinutilsVersion = Configurables.BinutilsVersion;
5858
public static readonly char[] PropertyListSeparator = new [] { ':' };
5959

60-
public static readonly string JdkFolder = "jdk-11";
60+
public static readonly string JdkFolder = "jdk-17";
6161

6262
public static readonly Version MicrosoftOpenJDK11Version = new Version (Configurables.MicrosoftOpenJDK11Version);
6363
public static readonly Version MicrosoftOpenJDK11Release = new Version (Configurables.MicrosoftOpenJDK11Release);
@@ -307,7 +307,7 @@ public static partial class Paths
307307
public static string OpenJDK8InstallDir => GetCachedPath (ref openJDK8InstallDir, () => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainDirectory), "jdk-1.8"));
308308
public static string OpenJDK8CacheDir => GetCachedPath (ref openJDK8CacheDir, () => ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainCacheDirectory));
309309

310-
public static string OpenJDK11InstallDir => GetCachedPath (ref openJDK11InstallDir, () => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainDirectory), "jdk-11"));
310+
public static string OpenJDK11InstallDir => GetCachedPath (ref openJDK11InstallDir, () => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainDirectory), Defaults.JdkFolder));
311311
public static string OpenJDK11CacheDir => GetCachedPath (ref openJDK11CacheDir, () => ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainCacheDirectory));
312312
// bundle
313313
public static string BCLTestsArchiveName = "bcl-tests.zip";

external/Java.Interop.override.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<XamarinAndroidToolsDirectory>$(MSBuildThisFileDirectory)xamarin-android-tools</XamarinAndroidToolsDirectory>
5+
<Jdks11MaxVersion>17.99.0</Jdks11MaxVersion>
56
</PropertyGroup>
67

78
</Project>

src/manifestmerger/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919

2020
dependencies {
2121
// https://mvnrepository.com/artifact/com.android.tools.build/manifest-merger
22-
compile group: 'com.android.tools.build', name: 'manifest-merger', version: '30.3.1'
22+
implementation 'com.android.tools.build:manifest-merger:30.3.1'
2323
}
2424

2525
sourceSets {
@@ -36,10 +36,10 @@ jar {
3636
attributes 'Main-Class': 'com.xamarin.manifestmerger.Main'
3737
}
3838
from {
39-
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
39+
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
4040
} {
4141
// Exclude native jnidispatch content to simplify installer signing and notarization
4242
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA', 'com/sun/jna/**/*jnidispatch*'
4343
}
44-
archiveName 'manifestmerger.jar'
45-
}
44+
archiveFileName.set('manifestmerger.jar')
45+
}

src/monodroid/monodroid.targets

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo.props" Condition="Exists('..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo.props')"/>
3+
<Import
4+
Project="..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo-11.props"
5+
Condition="Exists('..\..\external\Java.Interop\bin\Build$(Configuration)\JdkInfo-11.props')"
6+
/>
47
<Import Project="..\..\bin\Build$(Configuration)\cmake-config.props" Condition="Exists('..\..\bin\Build$(Configuration)\cmake-config.props')" />
58
<Import Project="monodroid.projitems" />
69
<UsingTask AssemblyFile="$(BootstrapTasksAssembly)" TaskName="Xamarin.Android.Tools.BootstrapTasks.GenerateMonoDroidIncludes" />

src/r8/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repositories {
1515
}
1616

1717
dependencies {
18-
compile group: 'com.android.tools', name: 'r8', version: '8.0.40'
18+
implementation 'com.android.tools:r8:8.0.40'
1919
}
2020

2121
jar {
@@ -24,7 +24,7 @@ jar {
2424
attributes 'Main-Class': 'com.android.tools.r8.R8'
2525
}
2626
from {
27-
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
27+
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
2828
}
29-
archiveName 'r8.jar'
30-
}
29+
archiveFileName.set('r8.jar')
30+
}

0 commit comments

Comments
 (0)