Skip to content

Commit 3be9f88

Browse files
1 parent c60635b commit 3be9f88

File tree

7 files changed

+13
-3
lines changed

7 files changed

+13
-3
lines changed

build-tools/create-packs/Microsoft.Android.Ref.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ by projects that use the Microsoft.Android framework in .NET 5.
3131
</PropertyGroup>
3232

3333
<ItemGroup>
34-
<_AndroidRefPackAssemblies Include="$(JavaInteropSourceDirectory)\bin\$(Configuration)-netcoreapp3.1\ref\Java.Interop.dll" />
34+
<_AndroidRefPackAssemblies Include="$(JavaInteropSourceDirectory)\bin\$(Configuration)-net6.0\ref\Java.Interop.dll" />
3535
<_AndroidRefPackAssemblies Include="$(_MonoAndroidNETOutputDir)ref\Mono.Android.dll" />
3636
<_AndroidRefPackAssemblies Include="$(_MonoAndroidNETOutputDir)ref\Mono.Android.Export.dll" />
3737
<FrameworkListFileClass Include="@(_AndroidRefPackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />

build-tools/xaprepare/xaprepare/Resources/JdkInfo.Windows.props.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<JavaCPath Condition=" '$(JavaCPath)' == '' ">@javac@</JavaCPath>
1717
<JarPath Condition=" '$(JarPath)' == '' ">@jar@</JarPath>
1818
<JavaSdkDirectory Condition=" '$(JavaSdkDirectory)' == '' ">@javahome@</JavaSdkDirectory>
19+
<DotNetToolPath Condition=" '$(DotNetToolPath)' == '' ">@dotnet@</DotNetToolPath>
1920
</PropertyGroup>
2021
</Project>

build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.Windows.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ partial void AddOSSpecificSteps (Context context, List<GeneratedFile> steps)
1515
string jdkJvmPath = Path.Combine (javaSdkDirectory, "jre", "bin", "server", "jvm.dll");
1616
string jdkIncludePathShared = Path.Combine (javaSdkDirectory, "include");
1717
string jdkIncludePathOS = Path.Combine (jdkIncludePathShared, "win32");
18+
var dotnetPath = context.Properties.GetRequiredValue (KnownProperties.DotNetPreviewPath);
19+
var dotnetTool = Path.Combine (dotnetPath, "dotnet");
1820

1921
var replacements = new Dictionary<string, string> (StringComparer.Ordinal) {
2022
{ "@JdkJvmPath@", jdkJvmPath },
@@ -24,6 +26,7 @@ partial void AddOSSpecificSteps (Context context, List<GeneratedFile> steps)
2426
{ "@java@", context.OS.JavaPath },
2527
{ "@jar@", context.OS.JarPath },
2628
{ "@javahome@", context.OS.JavaHome },
29+
{ "@dotnet@", dotnetTool },
2730
};
2831

2932
var step = new GeneratedPlaceholdersFile (

build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternalJavaInterop.Unix.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ partial class Step_PrepareExternalJavaInterop
99
async Task<bool> ExecuteOSSpecific (Context context)
1010
{
1111
string javaInteropDir = context.Properties.GetRequiredValue (KnownProperties.JavaInteropFullPath);
12+
var dotnetPath = context.Properties.GetRequiredValue (KnownProperties.DotNetPreviewPath);
13+
var dotnetTool = Path.Combine (dotnetPath, "dotnet");
14+
1215
Log.StatusLine ();
1316
var make = new MakeRunner (context) {
1417
NoParallelJobs = true
@@ -23,6 +26,7 @@ async Task<bool> ExecuteOSSpecific (Context context)
2326
$"JI_JAVA_HOME={context.OS.JavaHome}",
2427
$"JAVA_HOME={context.OS.JavaHome}",
2528
$"JI_MAX_JDK={Configurables.Defaults.MaxJDKVersion}",
29+
$"DOTNET_TOOL_PATH={dotnetTool}"
2630
}
2731
);
2832
if (!result)
@@ -36,6 +40,7 @@ async Task<bool> ExecuteOSSpecific (Context context)
3640
$"bin/Build{context.Configuration}/JdkInfo.props",
3741
$"CONFIGURATION={context.Configuration}",
3842
$"JI_MAX_JDK={Configurables.Defaults.MaxJDKVersion}",
43+
$"DOTNET_TOOL_PATH={dotnetTool}"
3944
}
4045
);
4146
return result;

external/Java.Interop

src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99
<ItemGroup>
1010
<PackageReference Include="Microsoft.NET.ILLink" Version="$(MicrosoftNETILLinkTasksPackageVersion)" />
11-
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop.Export\Java.Interop.Export.csproj" SkipGetTargetFrameworkProperties="true" AdditionalProperties="TargetFramework=netcoreapp3.1" />
11+
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop.Export\Java.Interop.Export.csproj" />
1212

1313
<Compile Include="..\Xamarin.Android.Build.Tasks\obj\$(Configuration)\Profile.g.cs" Link="Profile.g.cs" />
1414

tools/xabuild/XABuild.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ static void CreateConfig (XABuildPaths paths)
119119
xml.Load (reader);
120120

121121
var toolsets = xml.SelectSingleNode ("configuration/msbuildToolsets/toolset");
122+
SetProperty (toolsets, "XABuild", "true"); // Enables MSBuild .targets to check for xabuild
122123
SetProperty (toolsets, "VsInstallRoot", paths.VsInstallRoot);
123124
SetProperty (toolsets, "MSBuildToolsPath", paths.MSBuildBin);
124125
SetProperty (toolsets, "MSBuildToolsPath32", paths.MSBuildBin);

0 commit comments

Comments
 (0)