Skip to content

Bump to xamarin/java.interop/main@4d0cba64 #5895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ steps:
parameters:
provisionExtraArgs: ${{ parameters.provisionExtraArgs }}

- script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/${{ parameters.jdkTestFolder }}"
- script: |
echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/${{ parameters.jdkTestFolder }}"
echo "##vso[task.setvariable variable=DOTNET_TOOL_PATH]$HOME/Library/Android/dotnet/dotnet"
displayName: set JI_JAVA_HOME
condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))

- script: |
echo ##vso[task.setvariable variable=JI_JAVA_HOME]%USERPROFILE%\android-toolchain\${{ parameters.jdkTestFolder }}
echo ##vso[task.setvariable variable=DOTNET_TOOL_PATH]%USERPROFILE%\android-toolchain\dotnet\dotnet.exe
displayName: set JI_JAVA_HOME
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))

Expand Down
2 changes: 1 addition & 1 deletion build-tools/create-packs/Microsoft.Android.Ref.proj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ by projects that use the Microsoft.Android framework in .NET 5.
</PropertyGroup>

<ItemGroup>
<_AndroidRefPackAssemblies Include="$(JavaInteropSourceDirectory)\bin\$(Configuration)-netcoreapp3.1\ref\Java.Interop.dll" />
<_AndroidRefPackAssemblies Include="$(JavaInteropSourceDirectory)\bin\$(Configuration)-net6.0\ref\Java.Interop.dll" />
<_AndroidRefPackAssemblies Include="$(_MonoAndroidNETOutputDir)ref\Mono.Android.dll" />
<_AndroidRefPackAssemblies Include="$(_MonoAndroidNETOutputDir)ref\Mono.Android.Export.dll" />
<FrameworkListFileClass Include="@(_AndroidRefPackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<JavaCPath Condition=" '$(JavaCPath)' == '' ">@javac@</JavaCPath>
<JarPath Condition=" '$(JarPath)' == '' ">@jar@</JarPath>
<JavaSdkDirectory Condition=" '$(JavaSdkDirectory)' == '' ">@javahome@</JavaSdkDirectory>
<DotnetToolPath Condition=" '$(DotnetToolPath)' == '' ">@dotnet@</DotnetToolPath>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ partial void AddOSSpecificSteps (Context context, List<GeneratedFile> steps)
string jdkJvmPath = Path.Combine (javaSdkDirectory, "jre", "bin", "server", "jvm.dll");
string jdkIncludePathShared = Path.Combine (javaSdkDirectory, "include");
string jdkIncludePathOS = Path.Combine (jdkIncludePathShared, "win32");
var dotnetPath = context.Properties.GetRequiredValue (KnownProperties.DotNetPreviewPath);
var dotnetTool = Path.Combine (dotnetPath, "dotnet");

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

var step = new GeneratedPlaceholdersFile (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ partial class Step_PrepareExternalJavaInterop
async Task<bool> ExecuteOSSpecific (Context context)
{
string javaInteropDir = context.Properties.GetRequiredValue (KnownProperties.JavaInteropFullPath);
var dotnetPath = context.Properties.GetRequiredValue (KnownProperties.DotNetPreviewPath);
var dotnetTool = Path.Combine (dotnetPath, "dotnet");

Log.StatusLine ();
var make = new MakeRunner (context) {
NoParallelJobs = true
Expand All @@ -23,6 +26,7 @@ async Task<bool> ExecuteOSSpecific (Context context)
$"JI_JAVA_HOME={context.OS.JavaHome}",
$"JAVA_HOME={context.OS.JavaHome}",
$"JI_MAX_JDK={Configurables.Defaults.MaxJDKVersion}",
$"DOTNET_TOOL_PATH={dotnetTool}"
}
);
if (!result)
Expand All @@ -36,6 +40,7 @@ async Task<bool> ExecuteOSSpecific (Context context)
$"bin/Build{context.Configuration}/JdkInfo.props",
$"CONFIGURATION={context.Configuration}",
$"JI_MAX_JDK={Configurables.Defaults.MaxJDKVersion}",
$"DOTNET_TOOL_PATH={dotnetTool}"
}
);
return result;
Expand Down
2 changes: 1 addition & 1 deletion external/Java.Interop
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.ILLink" Version="$(MicrosoftNETILLinkTasksPackageVersion)" />
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop.Export\Java.Interop.Export.csproj" SkipGetTargetFrameworkProperties="true" AdditionalProperties="TargetFramework=netcoreapp3.1" />
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop.Export\Java.Interop.Export.csproj" />

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

Expand Down
1 change: 1 addition & 0 deletions tools/xabuild/XABuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static void CreateConfig (XABuildPaths paths)
xml.Load (reader);

var toolsets = xml.SelectSingleNode ("configuration/msbuildToolsets/toolset");
SetProperty (toolsets, "XABuild", "true"); // Enables MSBuild .targets to check for xabuild
SetProperty (toolsets, "VsInstallRoot", paths.VsInstallRoot);
SetProperty (toolsets, "MSBuildToolsPath", paths.MSBuildBin);
SetProperty (toolsets, "MSBuildToolsPath32", paths.MSBuildBin);
Expand Down