From 85be94f31dcecd0cf7e6c9e424f7322beaa438cc Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Mon, 19 Nov 2018 17:09:27 -0500 Subject: [PATCH] [Java.Interop] Target .NET Standard 2.0 We would like to be able to build [xamarin-android][0]'s `Xamarin.Android.sln` within Visual Studio (Windows). @joj believes that the difficulty is "caused" by `src/Java.Interop/Java.Interop.csproj` being a PCL project, and thus if we migrated our PCL projects to instead use .NET Standard the difficulties would be resolved. Update `Java.Interop`, `Java.Interop.Dynamic`, `Java.Interop.Export`, and `Java.Interop.GenericMarshaler` to be .NET Standard 2.0 projects instead of PCL projects. This in turn requires updating *every other project* to have a `$(TargetFrameworkVersion)` value of v4.6.1 (or later) so that they can reference .NET Standard 2.0 libraries. Additionally, `make fxcop` and related need to be updated, as the output paths for .NET Standard 2.0 builds has changed. Migrating to .NET Standard 2 *also* impacts the downstream xamarin-android repo: building `xamarin-android/src/Mono.Android` would fail: Microsoft.NuGet.targets(184,5): error : Your project is not referencing the "MonoAndroid,Version=v1.0" framework. Add a reference to "MonoAndroid,Version=v1.0" in the "frameworks" section of your project.json, and then re-run NuGet restore. The fix for this is twofold: 1. Provide a new `Java.Interop-MonoAndroid.csproj` file for use by the `xamarin-android/src/Mono.Android` build [^1], and 2. *Override* the `$(BaseIntermediateOutputPath)` MSBuild property. `$(BaseIntermediateOutputPath)` is used to find the `project*.json` files within `Microsoft.NuGet.targets`, and altering `$(BaseIntermediateOutputPath)` thus prevents the `project*.json` files from being found, allowing the build to succeed. Finally, building .NET Standard 2 projects often requires that the `msbuild /restore` or `msbuild /t:Restore` commands be used. Integrate `msbuild /t:Restore` into `make prepare`, and fix the `src/java-interop` project so that `msbuild /t:Restore` works without emitting errors. [0]: https://github.com/xamarin/xamarin-android/ [^1]: The following patch needs to be applied to `xamarin-android` when performing the next `Java.Interop` submodule bump: diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index 1d7e0c1a..848a3f63 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -20,7 +20,7 @@ --- Makefile | 15 ++- .../Java.Interop.BootstrapTasks.csproj | 2 +- samples/Hello/Hello.csproj | 2 +- .../Java.Interop.Dynamic.csproj | 45 ++----- .../Properties/AssemblyInfo.cs | 27 ---- .../Tests/Java.Interop.Dynamic-Tests.csproj | 2 +- .../Java.Interop.Export.csproj | 35 ++--- .../Properties/AssemblyInfo.cs | 22 ---- .../Java.Interop.GenericMarshaler.csproj | 36 +---- .../Properties/AssemblyInfo.cs | 26 ---- .../Java.Interop.Tools.Cecil.csproj | 2 +- .../Java.Interop.Tools.Diagnostics.csproj | 2 +- ....Interop.Tools.JavaCallableWrappers.csproj | 2 +- ...op.Tools.JavaCallableWrappers-Tests.csproj | 2 +- src/Java.Interop/.gitignore | 1 + .../Java.Interop-MonoAndroid.csproj | 105 +++++++++++++++ src/Java.Interop/Java.Interop.Net45.props | 27 ---- src/Java.Interop/Java.Interop.PCL.props | 6 - src/Java.Interop/Java.Interop.csproj | 123 ++---------------- src/Java.Interop/Java.Interop.targets | 20 +++ src/Java.Interop/Properties/AssemblyInfo.cs | 19 --- .../Java.Runtime.Environment.csproj | 2 +- ...droid.Tools.AnnotationSupport.Cecil.csproj | 2 +- ...rin.Android.Tools.AnnotationSupport.csproj | 2 +- ....Android.Tools.ApiXmlAdjuster-Tests.csproj | 2 +- ...amarin.Android.Tools.ApiXmlAdjuster.csproj | 2 +- ...amarin.Android.Tools.Bytecode-Tests.csproj | 2 +- .../Xamarin.Android.Tools.Bytecode.csproj | 2 +- src/java-interop/java-interop.csproj | 64 +-------- src/java-interop/java-interop.targets | 68 ++++++++++ .../Java.Interop-PerformanceTests.csproj | 2 +- .../Java.Interop-Tests.csproj | 2 +- .../Java.Interop.Dynamic-Tests.csproj | 2 +- .../Java.Interop.Export-Tests.csproj | 2 +- tests/TestJVM/TestJVM.csproj | 2 +- tools/class-parse/class-parse.csproj | 2 +- .../Tests/Integration-Tests/Compiler.cs | 2 +- tools/generator/Tests/generator-Tests.csproj | 2 +- tools/generator/generator.csproj | 2 +- tools/jcw-gen/jcw-gen.csproj | 2 +- ...oid.Tools.JniMarshalMethodGenerator.csproj | 2 +- .../Tests/LogcatParse-Tests.csproj | 2 +- tools/logcat-parse/logcat-parse.csproj | 2 +- 43 files changed, 265 insertions(+), 428 deletions(-) delete mode 100644 src/Java.Interop.Dynamic/Properties/AssemblyInfo.cs delete mode 100644 src/Java.Interop.Export/Properties/AssemblyInfo.cs delete mode 100644 src/Java.Interop.GenericMarshaler/Properties/AssemblyInfo.cs create mode 100644 src/Java.Interop/Java.Interop-MonoAndroid.csproj delete mode 100644 src/Java.Interop/Java.Interop.Net45.props delete mode 100644 src/Java.Interop/Java.Interop.PCL.props create mode 100644 src/java-interop/java-interop.targets diff --git a/Makefile b/Makefile index e40ce57c0..667199176 100644 --- a/Makefile +++ b/Makefile @@ -51,14 +51,17 @@ run-all-tests: run-tests run-test-jnimarshal run-test-generator-core run-ptests include build-tools/scripts/msbuild.mk +prepare:: src/Java.Runtime.Environment/Java.Runtime.Environment.dll.config + prepare:: prepare-bootstrap + $(MSBUILD) $(MSBUILD_FLAGS) /t:Restore Java.Interop.sln prepare-bootstrap: prepare-external bin/Build$(CONFIGURATION)/Java.Interop.BootstrapTasks.dll bin/Build$(CONFIGURATION)/Java.Interop.BootstrapTasks.dll: build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj \ external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj \ $(wildcard build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/*.cs) - $(MSBUILD) $(MSBUILD_FLAGS) "$<" + $(MSBUILD) $(MSBUILD_FLAGS) /restore "$<" prepare-external $(PREPARE_EXTERNAL_FILES): $(PACKAGES) $(NUNIT_CONSOLE) git submodule update --init --recursive @@ -82,15 +85,13 @@ else JAVA_RUNTIME_ENVIRONMENT_DLLMAP_OVERRIDE_CMD = '/@JAVA_RUNTIME_ENVIRONMENT_DLLMAP@/ {' -e 'r $(JAVA_RUNTIME_ENVIRONMENT_DLLMAP_OVERRIDE)' -e 'd' -e '}' endif -prepare:: src/Java.Runtime.Environment/Java.Runtime.Environment.dll.config - src/Java.Runtime.Environment/Java.Runtime.Environment.dll.config: src/Java.Runtime.Environment/Java.Runtime.Environment.dll.config.in \ bin/Build$(CONFIGURATION)/JdkInfo.props sed -e 's#@JI_JVM_PATH@#$(JI_JVM_PATH)#g' -e 's#@OS_NAME@#$(DLLMAP_OS_NAME)#g' -e $(JAVA_RUNTIME_ENVIRONMENT_DLLMAP_OVERRIDE_CMD) < $< > $@ -fxcop: lib/gendarme-2.10/gendarme.exe bin/GendarmeDebug/Java.Interop.dll - cp src/Java.Interop/obj/Gendarme/Java.Interop.dll.mdb bin/GendarmeDebug/ - $(RUNTIME) $< --html gendarme.html $(if @(GENDARME_XML),--xml gendarme.xml) --ignore gendarme-ignore.txt bin/GendarmeDebug/Java.Interop.dll +fxcop: lib/gendarme-2.10/gendarme.exe bin/GendarmeDebug/netstandard2.0/Java.Interop.dll + cp src/Java.Interop/obj/Gendarme/netstandard2.0/Java.Interop.dll.mdb bin/GendarmeDebug/netstandard2.0 + $(RUNTIME) $< --html gendarme.html $(if @(GENDARME_XML),--xml gendarme.xml) --ignore gendarme-ignore.txt bin/GendarmeDebug/netstandard2.0/Java.Interop.dll lib/gendarme-2.10/gendarme.exe: -mkdir -p `dirname "$@"` @@ -127,7 +128,7 @@ bin/Test$(CONFIGURATION)/Android.Interop-Tests.dll: $(wildcard src/Android.Inter bin/$(CONFIGURATION)/Java.Interop.dll: $(wildcard src/Java.Interop/*/*.cs) src/Java.Interop/Java.Interop.csproj $(MSBUILD) $(if $(V),/v:diag,) /p:Configuration=$(CONFIGURATION) $(if $(SNK),"/p:AssemblyOriginatorKeyFile=$(SNK)",) -bin/GendarmeDebug/Java.Interop.dll: $(wildcard src/Java.Interop/*/*.cs) src/Java.Interop/Java.Interop.csproj +bin/GendarmeDebug/netstandard2.0/Java.Interop.dll: $(wildcard src/Java.Interop/*/*.cs) src/Java.Interop/Java.Interop.csproj $(MSBUILD) $(if $(V),/v:diag,) /p:Configuration="Gendarme" $(if $(SNK),"/p:AssemblyOriginatorKeyFile=$(SNK)",) /p:CscToolExe=`which mcs` src/Java.Interop/Java.Interop.csproj CSHARP_REFS = \ diff --git a/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj b/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj index dbc5d407a..fe65dfce6 100644 --- a/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj +++ b/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj @@ -7,7 +7,7 @@ Library Java.Interop.BootstrapTasks Java.Interop.BootstrapTasks - v4.5.1 + v4.6.1 8.0.30703 2.0 diff --git a/samples/Hello/Hello.csproj b/samples/Hello/Hello.csproj index fd27fc0cf..d1f23a305 100644 --- a/samples/Hello/Hello.csproj +++ b/samples/Hello/Hello.csproj @@ -9,7 +9,7 @@ Exe Hello Hello - v4.5 + v4.6.1 true diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj b/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj index 73f072305..3da2f5a2e 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj @@ -1,54 +1,25 @@ - + - Debug - AnyCPU - 8.0.30703 - 2.0 + netstandard2.0 {AD4468F8-8883-434B-9D4C-E1801BB3B52A} - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Java.Interop.Dynamic - Java.Interop.Dynamic - Profile78 - v4.5 + true true ..\..\product.snk + Java.Interop.Dynamic + Microsoft Corporation + Microsoft Corporation + 0.1.0.0 - true - full - false ..\..\bin\Debug - DEBUG; - prompt - 4 - false - true - full - true ..\..\bin\Release - prompt - 4 - false - true - - - - - - - - - - - + - {94BD81F7-B06F-4295-9636-F8A3B6BDC762} diff --git a/src/Java.Interop.Dynamic/Properties/AssemblyInfo.cs b/src/Java.Interop.Dynamic/Properties/AssemblyInfo.cs deleted file mode 100644 index 8f935f7b2..000000000 --- a/src/Java.Interop.Dynamic/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle ("Java.Interop.Dynamic")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Xamarin Inc.")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("Xamarin Inc.")] -[assembly: AssemblyTrademark ("Xamarin")] -[assembly: AssemblyCulture ("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion ("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic-Tests.csproj b/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic-Tests.csproj index 936113b26..5b884709d 100644 --- a/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic-Tests.csproj +++ b/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic-Tests.csproj @@ -9,7 +9,7 @@ Library Java.Interop.DynamicTests Java.Interop.Dynamic-Tests - v4.5 + v4.6.1 true diff --git a/src/Java.Interop.Export/Java.Interop.Export.csproj b/src/Java.Interop.Export/Java.Interop.Export.csproj index 31f473fee..8d6b18f57 100644 --- a/src/Java.Interop.Export/Java.Interop.Export.csproj +++ b/src/Java.Interop.Export/Java.Interop.Export.csproj @@ -1,44 +1,25 @@ - + - Debug - AnyCPU - 8.0.30703 - 2.0 + netstandard2.0 {B501D075-6183-4E1D-92C9-F7B5002475B1} - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Java.Interop - Java.Interop.Export - Profile78 - v4.5 true ..\..\product.snk + Java.Interop.Export + Microsoft Corporation + Microsoft Corporation + 0.1.0.0 - true - full - false ..\..\bin\Debug - DEBUG; - prompt - 4 - false - full - true ..\..\bin\Release - prompt - 4 - false - - - + + - {94BD81F7-B06F-4295-9636-F8A3B6BDC762} diff --git a/src/Java.Interop.Export/Properties/AssemblyInfo.cs b/src/Java.Interop.Export/Properties/AssemblyInfo.cs deleted file mode 100644 index fed081c8a..000000000 --- a/src/Java.Interop.Export/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("Java.Interop.Export")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("jon")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("1.0.*")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj b/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj index 1aa1bc101..138b6ec0c 100644 --- a/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj +++ b/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj @@ -1,50 +1,28 @@ - + - Debug - AnyCPU - 8.0.30703 - 2.0 + netstandard2.0 {D1243BAB-23CA-4566-A2A3-3ADA2C2DC3AF} - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Java.Interop.GenericMarshaler - Java.Interop.GenericMarshaler - v4.5 - Profile111 + true true ..\..\product.snk + Java.Interop.GenericMarshaler + Microsoft Corporation + Microsoft Corporation + 0.1.0.0 - true - full - false ..\..\bin\Debug - DEBUG; - prompt - 4 - true - true ..\..\bin\Release - prompt - 4 - true - - - - Java.Interop.GenericMarshaler\JniPeerInstanceMethodsExtensions.tt - - TextTemplatingFileGenerator Java.Interop.GenericMarshaler\JniPeerInstanceMethodsExtensions.cs - {94BD81F7-B06F-4295-9636-F8A3B6BDC762} diff --git a/src/Java.Interop.GenericMarshaler/Properties/AssemblyInfo.cs b/src/Java.Interop.GenericMarshaler/Properties/AssemblyInfo.cs deleted file mode 100644 index d48dc0a08..000000000 --- a/src/Java.Interop.GenericMarshaler/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle ("Java.Interop.GenericMarshaler")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Xamarin Inc.")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("Xamarin Inc.")] -[assembly: AssemblyTrademark ("Xamarin")] -[assembly: AssemblyCulture ("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion ("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj b/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj index 8ec2be346..888c905ed 100644 --- a/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj +++ b/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj @@ -9,7 +9,7 @@ Library Java.Interop.Tools.Cecil Java.Interop.Tools.Cecil - v4.5 + v4.6.1 true diff --git a/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj b/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj index af245ce60..25527df89 100644 --- a/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj +++ b/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj @@ -9,7 +9,7 @@ Library Java.Interop.Tools.Diagnostics Java.Interop.Tools.Diagnostics - v4.5 + v4.6.1 true diff --git a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj index cf708757e..13982723f 100644 --- a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj +++ b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj @@ -9,7 +9,7 @@ Library Java.Interop.Tools.JavaCallableWrappers Java.Interop.Tools.JavaCallableWrappers - v4.5 + v4.6.1 true diff --git a/src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj b/src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj index 04780ffc4..8df7de10e 100644 --- a/src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj +++ b/src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj @@ -9,7 +9,7 @@ Library Java.Interop.Tools.JavaCallableWrappersTests Java.Interop.Tools.JavaCallableWrappers-Tests - v4.5 + v4.6.1 true diff --git a/src/Java.Interop/.gitignore b/src/Java.Interop/.gitignore index a0cbafa3a..f11d52d7f 100644 --- a/src/Java.Interop/.gitignore +++ b/src/Java.Interop/.gitignore @@ -1 +1,2 @@ Java.Interop/JniEnvironment.g.cs +obj-MonoAndroid diff --git a/src/Java.Interop/Java.Interop-MonoAndroid.csproj b/src/Java.Interop/Java.Interop-MonoAndroid.csproj new file mode 100644 index 000000000..5a03c4e53 --- /dev/null +++ b/src/Java.Interop/Java.Interop-MonoAndroid.csproj @@ -0,0 +1,105 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {94BD81F7-B06F-4295-9636-F8A3B6BDC762} + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Java.Interop + Java.Interop + v4.5 + 1591 + true + ..\..\product.snk + obj-MonoAndroid\ + + + + true + full + false + ..\..\bin\Debug + DEBUG;INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS + prompt + 4 + false + true + ..\..\bin\Debug\Java.Interop.xml + ..\..\bin\BuildDebug + + + full + true + ..\..\bin\Release + prompt + 4 + false + INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS + true + ..\..\bin\Release\Java.Interop.xml + ..\..\bin\BuildRelease + + + true + ..\..\bin\$(Configuration)Net45 + $(OutputPath)\Java.Interop.xml + + + + + + + + + + + + + + + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\mscorlib.dll + False + + + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\System.dll + False + + + $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\System.Core.dll + False + + + + + + BuildJnienvGen; + BuildJniEnvironment_g_cs; + BuildInteropJar; + $(BuildDependsOn) + + + + + TextTemplatingFileGenerator + JavaPrimitiveArrays.cs + + + TextTemplatingFileGenerator + JniBuiltinMarshalers.cs + + + TextTemplatingFileGenerator + JniPeerMembers.JniInstanceMethods_Invoke.cs + + + TextTemplatingFileGenerator + JniPeerMembers.JniFields.cs + + + + + + \ No newline at end of file diff --git a/src/Java.Interop/Java.Interop.Net45.props b/src/Java.Interop/Java.Interop.Net45.props deleted file mode 100644 index fb070009c..000000000 --- a/src/Java.Interop/Java.Interop.Net45.props +++ /dev/null @@ -1,27 +0,0 @@ - - - true - ..\..\bin\$(Configuration)Net45 - $(OutputPath)\Java.Interop.xml - - - - - $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\mscorlib.dll - False - - - $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\System.dll - False - - - $(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\System.Core.dll - False - - - - - - - - diff --git a/src/Java.Interop/Java.Interop.PCL.props b/src/Java.Interop/Java.Interop.PCL.props deleted file mode 100644 index 53651a256..000000000 --- a/src/Java.Interop/Java.Interop.PCL.props +++ /dev/null @@ -1,6 +0,0 @@ - - - Profile111 - - - diff --git a/src/Java.Interop/Java.Interop.csproj b/src/Java.Interop/Java.Interop.csproj index 026fad6ee..c35fa13a9 100644 --- a/src/Java.Interop/Java.Interop.csproj +++ b/src/Java.Interop/Java.Interop.csproj @@ -1,134 +1,40 @@ - + - Debug - AnyCPU - 8.0.30703 - 2.0 + netstandard2.0 {94BD81F7-B06F-4295-9636-F8A3B6BDC762} - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Java.Interop - Java.Interop - v4.5 1591 true ..\..\product.snk + INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS + true + Java.Interop + Microsoft Corporation + Microsoft Corporation + 0.1.0.0 - true - full - false ..\..\bin\Debug - DEBUG;INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS - prompt - 4 - false - true ..\..\bin\Debug\Java.Interop.xml ..\..\bin\BuildDebug + DEBUG;$(DefineConstants) - true - full - false ..\..\bin\GendarmeDebug - DEBUG;INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS - prompt - 4 - false - true + DEBUG;$(DefineConstants) ..\..\bin\Debug\Java.Interop.xml ..\..\bin\BuildDebug - full - true ..\..\bin\Release - prompt - 4 - false - INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS - true ..\..\bin\Release\Java.Interop.xml ..\..\bin\BuildRelease - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JniPeerMembers.JniInstanceMethods_Invoke.tt - - - - - - JniPeerMembers.JniFields.tt - - - - - - - - - - - JavaPrimitiveArrays.tt - - - - - - JniBuiltinMarshalers.tt - - - - - - - - - - - - - - - - - - - + + - - @@ -138,11 +44,6 @@ $(BuildDependsOn) - - - PreserveNewest - - TextTemplatingFileGenerator diff --git a/src/Java.Interop/Java.Interop.targets b/src/Java.Interop/Java.Interop.targets index c1f3af296..4db58dab8 100644 --- a/src/Java.Interop/Java.Interop.targets +++ b/src/Java.Interop/Java.Interop.targets @@ -3,6 +3,17 @@ mono + + + + + + + + + PreserveNewest + + @@ -11,14 +22,23 @@ /> + + <_AddCompile Condition=" !Exists('Java.Interop\JniEnvironment.g.cs') ">True + + + + diff --git a/src/Java.Interop/Properties/AssemblyInfo.cs b/src/Java.Interop/Properties/AssemblyInfo.cs index 857213989..86d827001 100644 --- a/src/Java.Interop/Properties/AssemblyInfo.cs +++ b/src/Java.Interop/Properties/AssemblyInfo.cs @@ -1,25 +1,6 @@ using System.Reflection; using System.Runtime.CompilerServices; -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("Java.Interop")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Xamarin Inc.")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("Xamarin Inc.")] -[assembly: AssemblyTrademark ("Xamarin")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("0.1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - [assembly: InternalsVisibleTo ( "Java.Interop.GenericMarshaler, PublicKey=" + "0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf1" + diff --git a/src/Java.Runtime.Environment/Java.Runtime.Environment.csproj b/src/Java.Runtime.Environment/Java.Runtime.Environment.csproj index 94dce5274..91bfb7298 100644 --- a/src/Java.Runtime.Environment/Java.Runtime.Environment.csproj +++ b/src/Java.Runtime.Environment/Java.Runtime.Environment.csproj @@ -9,7 +9,7 @@ Library Java.Interop Java.Runtime.Environment - v4.5 + v4.6.1 true ..\..\product.snk diff --git a/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/Xamarin.Android.Tools.AnnotationSupport.Cecil.csproj b/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/Xamarin.Android.Tools.AnnotationSupport.Cecil.csproj index c46ec339d..75bc725b4 100644 --- a/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/Xamarin.Android.Tools.AnnotationSupport.Cecil.csproj +++ b/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/Xamarin.Android.Tools.AnnotationSupport.Cecil.csproj @@ -7,7 +7,7 @@ Library Xamarin.Android.Tools.AnnotationSupport.Cecil Xamarin.Android.Tools.AnnotationSupport.Cecil - v4.5 + v4.6.1 8.0.30703 2.0 diff --git a/src/Xamarin.Android.Tools.AnnotationSupport/Xamarin.Android.Tools.AnnotationSupport.csproj b/src/Xamarin.Android.Tools.AnnotationSupport/Xamarin.Android.Tools.AnnotationSupport.csproj index 1b1f59f6b..cfd704c8d 100644 --- a/src/Xamarin.Android.Tools.AnnotationSupport/Xamarin.Android.Tools.AnnotationSupport.csproj +++ b/src/Xamarin.Android.Tools.AnnotationSupport/Xamarin.Android.Tools.AnnotationSupport.csproj @@ -9,7 +9,7 @@ Xamarin.Android.Tools.AnnotationSupport 8.0.30703 2.0 - v4.5 + v4.6.1 true diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj b/src/Xamarin.Android.Tools.ApiXmlAdjuster/Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj index 3601f7ef0..f4bf44caf 100644 --- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj +++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj @@ -7,7 +7,7 @@ Library Xamarin.Android.Tools.ApiXmlAdjusterTests Xamarin.Android.Tools.ApiXmlAdjuster-Tests - v4.5 + v4.6.1 8.0.30703 2.0 diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/Xamarin.Android.Tools.ApiXmlAdjuster.csproj b/src/Xamarin.Android.Tools.ApiXmlAdjuster/Xamarin.Android.Tools.ApiXmlAdjuster.csproj index b7ec30ac6..8101f3102 100644 --- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/Xamarin.Android.Tools.ApiXmlAdjuster.csproj +++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/Xamarin.Android.Tools.ApiXmlAdjuster.csproj @@ -7,7 +7,7 @@ Library Xamarin.Android.Tools.ApiXmlAdjuster Xamarin.Android.Tools.ApiXmlAdjuster - v4.5 + v4.6.1 8.0.30703 2.0 diff --git a/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj b/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj index 11aeb2ef0..3bb9c8b96 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj +++ b/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj @@ -8,7 +8,7 @@ Library Xamarin.Android.Tools.BytecodeTests Xamarin.Android.Tools.Bytecode-Tests - v4.5 + v4.6.1 8.0.30703 2.0 diff --git a/src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj b/src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj index c2379706f..e1feb77d6 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj +++ b/src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj @@ -7,7 +7,7 @@ Library Xamarin.Android.Tools.Bytecode Xamarin.Android.Tools.Bytecode - v4.5 + v4.6.1 AnyCPU 8.0.30703 2.0 diff --git a/src/java-interop/java-interop.csproj b/src/java-interop/java-interop.csproj index 3995a6eec..e46c2fd9c 100644 --- a/src/java-interop/java-interop.csproj +++ b/src/java-interop/java-interop.csproj @@ -49,69 +49,7 @@ $(BuildDependsOn) - - mono - - - - - - - - <_MacLib>$(OutputPath)\lib$(OutputName).dylib - - - - <_FixedDefines>$(DefineSymbols.Split(' ')) - - - <_Defines Include="$(_FixedDefines)" /> - - - <_CppFlags>@(_Defines -> '-D%(Identity)', ' ') - <_Includes>@(MonoIncludePath->'-I %(Identity)', ' ') @(JdkIncludePath->'-I %(Identity)', ' ') - <_LinkFlags>-fvisibility=hidden -Wl,-undefined -Wl,suppress -Wl,-flat_namespace - <_Libs>$(MonoLibs) - <_Files>@(Compile -> '%(Identity)', ' ') - - - - - - - - - <_FixedDefines>$(DefineSymbols.Split(' ')) - - - <_Defines Include="$(_FixedDefines)" /> - - - <_CppFlags>@(_Defines -> '-D%(Identity)', ' ') - <_Includes>@(MonoIncludePath->'-I %(Identity)', ' ') @(JdkIncludePath->'-I %(Identity)', ' ') - <_LinkFlags>-fvisibility=hidden -Wl,-undefined -Wl,suppress -Wl,-flat_namespace -fPIC - <_Libs>$(MonoLibs) - <_Files>@(Compile -> '%(Identity)', ' ') - - - - - - - - - + {6410DA0F-5E14-4FC0-9AEE-F4C542C96C7A} diff --git a/src/java-interop/java-interop.targets b/src/java-interop/java-interop.targets new file mode 100644 index 000000000..155152abe --- /dev/null +++ b/src/java-interop/java-interop.targets @@ -0,0 +1,68 @@ + + + + mono + + + + + + + + <_MacLib>$(OutputPath)\lib$(OutputName).dylib + + + + <_FixedDefines>$(DefineSymbols.Split(' ')) + + + <_Defines Include="$(_FixedDefines)" /> + + + <_CppFlags>@(_Defines -> '-D%(Identity)', ' ') + <_Includes>@(MonoIncludePath->'-I %(Identity)', ' ') @(JdkIncludePath->'-I %(Identity)', ' ') + <_LinkFlags>-fvisibility=hidden -Wl,-undefined -Wl,suppress -Wl,-flat_namespace + <_Libs>$(MonoLibs) + <_Files>@(Compile -> '%(Identity)', ' ') + + + + + + + + + <_FixedDefines>$(DefineSymbols.Split(' ')) + + + <_Defines Include="$(_FixedDefines)" /> + + + <_CppFlags>@(_Defines -> '-D%(Identity)', ' ') + <_Includes>@(MonoIncludePath->'-I %(Identity)', ' ') @(JdkIncludePath->'-I %(Identity)', ' ') + <_LinkFlags>-fvisibility=hidden -Wl,-undefined -Wl,suppress -Wl,-flat_namespace -fPIC + <_Libs>$(MonoLibs) + <_Files>@(Compile -> '%(Identity)', ' ') + + + + + + + + + + + + diff --git a/tests/Java.Interop-PerformanceTests/Java.Interop-PerformanceTests.csproj b/tests/Java.Interop-PerformanceTests/Java.Interop-PerformanceTests.csproj index dba26588f..aca7fb906 100644 --- a/tests/Java.Interop-PerformanceTests/Java.Interop-PerformanceTests.csproj +++ b/tests/Java.Interop-PerformanceTests/Java.Interop-PerformanceTests.csproj @@ -9,7 +9,7 @@ Library Java.Interop.PerformanceTests Java.Interop-PerformanceTests - v4.5 + v4.6.1 true diff --git a/tests/Java.Interop-Tests/Java.Interop-Tests.csproj b/tests/Java.Interop-Tests/Java.Interop-Tests.csproj index 22dce0641..929d6aae8 100644 --- a/tests/Java.Interop-Tests/Java.Interop-Tests.csproj +++ b/tests/Java.Interop-Tests/Java.Interop-Tests.csproj @@ -9,7 +9,7 @@ Library Java.InteropTests Java.Interop-Tests - v4.5 + v4.6.1 true ..\..\product.snk diff --git a/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj b/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj index 2d0d55e06..a77a0f310 100644 --- a/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj +++ b/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj @@ -9,7 +9,7 @@ Library Java.Interop.DynamicTests Java.Interop.Dynamic-Tests - v4.5 + v4.6.1 true diff --git a/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj b/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj index 014a114e5..4177c980f 100644 --- a/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj +++ b/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj @@ -9,7 +9,7 @@ Library Java.Interop.ExportTests Java.Interop.Export-Tests - v4.5 + v4.6.1 true diff --git a/tests/TestJVM/TestJVM.csproj b/tests/TestJVM/TestJVM.csproj index cc683f4d2..310f4c7ab 100644 --- a/tests/TestJVM/TestJVM.csproj +++ b/tests/TestJVM/TestJVM.csproj @@ -9,7 +9,7 @@ Library TestJVM TestJVM - v4.5 + v4.6.1 true ..\..\product.snk diff --git a/tools/class-parse/class-parse.csproj b/tools/class-parse/class-parse.csproj index d28b458fd..acb17e959 100644 --- a/tools/class-parse/class-parse.csproj +++ b/tools/class-parse/class-parse.csproj @@ -7,7 +7,7 @@ Exe Xamarin.Android.Tools class-parse - v4.5 + v4.6.1 False 8.0.30703 2.0 diff --git a/tools/generator/Tests/Integration-Tests/Compiler.cs b/tools/generator/Tests/Integration-Tests/Compiler.cs index 9c74b99e6..6485c9430 100644 --- a/tools/generator/Tests/Integration-Tests/Compiler.cs +++ b/tools/generator/Tests/Integration-Tests/Compiler.cs @@ -60,7 +60,7 @@ public static Assembly Compile (Xamarin.Android.Binder.CodeGeneratorOptions opti var binDir = Path.GetDirectoryName (typeof (BaseGeneratorTest).Assembly.Location); var facDir = GetFacadesPath (); parameters.ReferencedAssemblies.Add (Path.Combine (binDir, "Java.Interop.dll")); - parameters.ReferencedAssemblies.Add (Path.Combine (facDir, "System.Runtime.dll")); + parameters.ReferencedAssemblies.Add (Path.Combine (facDir, "netstandard.dll")); #if DEBUG parameters.IncludeDebugInformation = true; #else diff --git a/tools/generator/Tests/generator-Tests.csproj b/tools/generator/Tests/generator-Tests.csproj index 760478073..a21041d38 100644 --- a/tools/generator/Tests/generator-Tests.csproj +++ b/tools/generator/Tests/generator-Tests.csproj @@ -9,7 +9,7 @@ Library generatortests generator-Tests - v4.5 + v4.6.1 true diff --git a/tools/generator/generator.csproj b/tools/generator/generator.csproj index 144d39c9d..7e387267a 100644 --- a/tools/generator/generator.csproj +++ b/tools/generator/generator.csproj @@ -15,7 +15,7 @@ - v4.5 + v4.6.1 diff --git a/tools/jcw-gen/jcw-gen.csproj b/tools/jcw-gen/jcw-gen.csproj index 1f7f283c0..2cce1d077 100644 --- a/tools/jcw-gen/jcw-gen.csproj +++ b/tools/jcw-gen/jcw-gen.csproj @@ -9,7 +9,7 @@ Exe Java.interop.Tools jcw-gen - v4.5 + v4.6.1 diff --git a/tools/jnimarshalmethod-gen/Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj b/tools/jnimarshalmethod-gen/Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj index 0ad1cde69..a8186e180 100644 --- a/tools/jnimarshalmethod-gen/Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj +++ b/tools/jnimarshalmethod-gen/Xamarin.Android.Tools.JniMarshalMethodGenerator.csproj @@ -9,7 +9,7 @@ Exe Xamarin.Android.Tools.JniMarshalMethodGenerator jnimarshalmethod-gen - v4.5 + v4.6.1 diff --git a/tools/logcat-parse/Tests/LogcatParse-Tests.csproj b/tools/logcat-parse/Tests/LogcatParse-Tests.csproj index 6609b61da..02f2303c6 100644 --- a/tools/logcat-parse/Tests/LogcatParse-Tests.csproj +++ b/tools/logcat-parse/Tests/LogcatParse-Tests.csproj @@ -9,7 +9,7 @@ Library Xamarin.Android.Tools.LogcatParse.Tests LogcatParse-Tests - v4.5 + v4.6.1 true diff --git a/tools/logcat-parse/logcat-parse.csproj b/tools/logcat-parse/logcat-parse.csproj index 67fe5b425..708a4d88b 100644 --- a/tools/logcat-parse/logcat-parse.csproj +++ b/tools/logcat-parse/logcat-parse.csproj @@ -9,7 +9,7 @@ Exe Xamarin.Android.Tools.LogcatParse logcat-parse - v4.5 + v4.6.1 Xamarin.Android.Tools.LogcatParse.Program