Skip to content
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
5 changes: 4 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
Condition="Exists('$(_OutputPath)MonoInfo.props')"
/>
<PropertyGroup Condition=" '$(TargetFramework)' != '' And $(TargetFramework.StartsWith ('netcoreapp')) ">
<JIBuildingForNetCoreApp>True</JIBuildingForNetCoreApp>
</PropertyGroup>
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">
<BuildToolOutputFullPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)-$(TargetFramework)\</BuildToolOutputFullPath>
<ToolOutputFullPath>$(MSBuildThisFileDirectory)bin\$(Configuration)-$(TargetFramework)\</ToolOutputFullPath>
<TestOutputFullPath>$(MSBuildThisFileDirectory)bin\Test$(Configuration)-$(TargetFramework)\</TestOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPathCoreApps)' != '' ">$(UtilityOutputFullPathCoreApps)</UtilityOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPathCoreApps)' == '' ">$(ToolOutputFullPath)</UtilityOutputFullPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == '' Or !$(TargetFramework.StartsWith ('netcoreapp')) ">
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">
<BuildToolOutputFullPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</BuildToolOutputFullPath>
<ToolOutputFullPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\</ToolOutputFullPath>
<TestOutputFullPath>$(MSBuildThisFileDirectory)bin\Test$(Configuration)\</TestOutputFullPath>
Expand Down
3 changes: 2 additions & 1 deletion build-tools/jnienv-gen/jnienv-gen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Runtime Condition="'$(OS)' != 'Windows_NT'">mono</Runtime>
<_JNIEnvGenPath Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(BuildToolOutputFullPath)jnienv-gen.dll</_JNIEnvGenPath>
<_JNIEnvGenPath Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(BuildToolOutputFullPath)jnienv-gen.exe</_JNIEnvGenPath>
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">dotnet "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
</PropertyGroup>
<ItemGroup>
<CompileJavaInteropJar Include="java\com\xamarin\java_interop\internal\JavaProxyObject.java" />
Expand All @@ -16,14 +20,14 @@
</ItemGroup>
<Target Name="BuildJniEnvironment_g_cs"
BeforeTargets="BeforeCompile"
Inputs="$(JNIEnvGenPath)\jnienv-gen.exe"
Inputs="$(_JNIEnvGenPath)"
Outputs="Java.Interop\JniEnvironment.g.cs;$(IntermediateOutputPath)\jni.c">
<MakeDir Directories="$(IntermediateOutputPath)" />
<PropertyGroup>
<_AddCompile Condition=" !Exists('Java.Interop\JniEnvironment.g.cs') ">True</_AddCompile>
</PropertyGroup>
<Exec
Command="$(Runtime) &quot;$(JNIEnvGenPath)\jnienv-gen.exe&quot; Java.Interop\JniEnvironment.g.cs $(IntermediateOutputPath)\jni.c"
Command="$(_RunJNIEnvGen) Java.Interop\JniEnvironment.g.cs $(IntermediateOutputPath)\jni.c"
/>
<ItemGroup>
<Compile Include="Java.Interop\JniEnvironment.g.cs" Condition=" '$(_AddCompile)' == 'True' " />
Expand Down
2 changes: 1 addition & 1 deletion src/Java.Interop/Java.Interop-MonoAndroid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<Import Project="Java.Interop.targets" />
<Import Project="Directory.Build.targets" />
<PropertyGroup>
<BuildDependsOn>
BuildJniEnvironment_g_cs;
Expand Down
25 changes: 10 additions & 15 deletions src/Java.Interop/Java.Interop.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
<NoWarn>1591</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<DefineConstants>INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS;INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\bin\Debug</OutputPath>
<DocumentationFile>..\..\bin\Debug\Java.Interop.xml</DocumentationFile>
<JNIEnvGenPath>..\..\bin\BuildDebug</JNIEnvGenPath>
<DefineConstants>$(DefineConstants);DEBUG;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
<DocumentationFile>$(ToolOutputFullPath)Java.Interop.xml</DocumentationFile>
<JNIEnvGenPath>$(BuildToolOutputFullPath)</JNIEnvGenPath>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\bin\Release</OutputPath>
<DocumentationFile>..\..\bin\Release\Java.Interop.xml</DocumentationFile>
<JNIEnvGenPath>..\..\bin\BuildRelease</JNIEnvGenPath>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>DEBUG;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Java.Interop\JniLocationException.cs" />
</ItemGroup>
<Import Project="Java.Interop.targets" />
<PropertyGroup>
<BuildDependsOn>
BuildJniEnvironment_g_cs;
Expand Down Expand Up @@ -60,7 +53,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\build-tools\jnienv-gen\jnienv-gen.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\build-tools\jnienv-gen\jnienv-gen.csproj"
ReferenceOutputAssembly="false"
/>
</ItemGroup>
<ItemGroup>
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="Java.Interop\JavaPrimitiveArrays.cs">
Expand Down