From be7c73b04854d12541f6ec4e4a73704f448ef5a5 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Nov 2020 16:33:13 +0100 Subject: [PATCH 01/12] Build with net5.0 TFM instead of netcoreapp3.1 That would allow use of new NET5 API like the new dynamic dependency [attribute](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicdependencyattribute?view=net-5.0). --- Directory.Build.props | 2 +- build-tools/jnienv-gen/jnienv-gen.csproj | 2 +- src/Java.Interop.Export/Java.Interop.Export.csproj | 2 +- src/Java.Interop/Java.Interop.csproj | 2 +- src/Java.Interop/Java.Interop/JniTypeSignature.cs | 2 +- tools/class-parse/class-parse.csproj | 4 ++-- tools/generator/generator.csproj | 4 ++-- tools/jcw-gen/jcw-gen.csproj | 2 +- tools/logcat-parse/logcat-parse.csproj | 2 +- tools/param-name-importer/param-name-importer.csproj | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index fa711a23d..3cba3975c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -27,7 +27,7 @@ False obj\ - + True diff --git a/build-tools/jnienv-gen/jnienv-gen.csproj b/build-tools/jnienv-gen/jnienv-gen.csproj index 11caad93f..b90d10886 100644 --- a/build-tools/jnienv-gen/jnienv-gen.csproj +++ b/build-tools/jnienv-gen/jnienv-gen.csproj @@ -2,7 +2,7 @@ Exe - net472;netcoreapp3.1 + net472;net5.0 false $(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\ diff --git a/src/Java.Interop.Export/Java.Interop.Export.csproj b/src/Java.Interop.Export/Java.Interop.Export.csproj index d608d87ee..61c732613 100644 --- a/src/Java.Interop.Export/Java.Interop.Export.csproj +++ b/src/Java.Interop.Export/Java.Interop.Export.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netcoreapp3.1 + netstandard2.0;net5.0 8.0 {B501D075-6183-4E1D-92C9-F7B5002475B1} true diff --git a/src/Java.Interop/Java.Interop.csproj b/src/Java.Interop/Java.Interop.csproj index d3b589f1a..543dbb384 100644 --- a/src/Java.Interop/Java.Interop.csproj +++ b/src/Java.Interop/Java.Interop.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netcoreapp3.1 + netstandard2.0;net5.0 1591 true ..\..\product.snk diff --git a/src/Java.Interop/Java.Interop/JniTypeSignature.cs b/src/Java.Interop/Java.Interop/JniTypeSignature.cs index e7edb7b07..d465f3b77 100644 --- a/src/Java.Interop/Java.Interop/JniTypeSignature.cs +++ b/src/Java.Interop/Java.Interop/JniTypeSignature.cs @@ -172,7 +172,7 @@ public static bool TryParse (string signature, [NotNullWhen (true)] out JniTypeS public override int GetHashCode () { -#if NETCOREAPP +#if NET5_0 return QualifiedReference.GetHashCode (StringComparison.Ordinal); #else return QualifiedReference.GetHashCode (); diff --git a/tools/class-parse/class-parse.csproj b/tools/class-parse/class-parse.csproj index 43f43f3de..d1921fccc 100644 --- a/tools/class-parse/class-parse.csproj +++ b/tools/class-parse/class-parse.csproj @@ -1,7 +1,7 @@ - + - net472;netcoreapp3.1 + net472;net5.0 Exe diff --git a/tools/generator/generator.csproj b/tools/generator/generator.csproj index 88489255d..c652cc2a4 100644 --- a/tools/generator/generator.csproj +++ b/tools/generator/generator.csproj @@ -1,7 +1,7 @@ - + - net472;netcoreapp3.1 + net472;net5.0 Exe $(DefineConstants);GENERATOR;HAVE_CECIL;JCW_ONLY_TYPE_NAMES 8.0 diff --git a/tools/jcw-gen/jcw-gen.csproj b/tools/jcw-gen/jcw-gen.csproj index 16ae9a47e..b50a456ef 100644 --- a/tools/jcw-gen/jcw-gen.csproj +++ b/tools/jcw-gen/jcw-gen.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp3.1 + net472;net5.0 Exe diff --git a/tools/logcat-parse/logcat-parse.csproj b/tools/logcat-parse/logcat-parse.csproj index e189818e2..39d9ac8e7 100644 --- a/tools/logcat-parse/logcat-parse.csproj +++ b/tools/logcat-parse/logcat-parse.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp3.1 + net472;net5.0 Exe diff --git a/tools/param-name-importer/param-name-importer.csproj b/tools/param-name-importer/param-name-importer.csproj index e2105d242..288ee1198 100644 --- a/tools/param-name-importer/param-name-importer.csproj +++ b/tools/param-name-importer/param-name-importer.csproj @@ -1,6 +1,6 @@ - + - net472;netcoreapp3.1 + net472;net5.0 Exe From 331d951d87abe867d705ded33e016f7c59d7f7f9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Nov 2020 16:40:55 +0100 Subject: [PATCH 02/12] Set DotnetNetCoreVersion --- build-tools/automation/azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 8f09e9951..5406ae581 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -16,7 +16,7 @@ pr: # Global variables variables: - DotNetCoreVersion: 3.1.300 + DotNetCoreVersion: 5.0.100-rc.2.20479.15 HostedMac: Hosted Mac Internal HostedWinVS2019: Hosted Windows 2019 with VS2019 From e3ecd4b3b4ea7a4c5062efbd33e3786f045b1aab Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 13 Nov 2020 12:19:19 +0100 Subject: [PATCH 03/12] Update build-tools/automation/azure-pipelines.yaml Co-authored-by: Jonathan Peppers --- build-tools/automation/azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 5406ae581..bcb9e541f 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -16,7 +16,7 @@ pr: # Global variables variables: - DotNetCoreVersion: 5.0.100-rc.2.20479.15 + DotNetCoreVersion: 5.0.100 HostedMac: Hosted Mac Internal HostedWinVS2019: Hosted Windows 2019 with VS2019 From 3c71b68e4db6f30f22d6aba198385e2a050002b2 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 12:47:59 +0100 Subject: [PATCH 04/12] Use dotnet 5.0.x --- .github/workflows/release-notes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 6556bb7ac..69ea57095 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -23,7 +23,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.x + dotnet-version: 5.0.x - name: Install Noted run: dotnet tool install -g noted From 670acfd829a038b2b569e3ebe56781ef4daf00c6 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 12:54:18 +0100 Subject: [PATCH 05/12] Keep NETCOREAPP in place ...until the situation around NET defines clears out. Contex: https://github.com/dotnet/designs/pull/165 --- src/Java.Interop/Java.Interop/JniTypeSignature.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Java.Interop/Java.Interop/JniTypeSignature.cs b/src/Java.Interop/Java.Interop/JniTypeSignature.cs index d465f3b77..e7edb7b07 100644 --- a/src/Java.Interop/Java.Interop/JniTypeSignature.cs +++ b/src/Java.Interop/Java.Interop/JniTypeSignature.cs @@ -172,7 +172,7 @@ public static bool TryParse (string signature, [NotNullWhen (true)] out JniTypeS public override int GetHashCode () { -#if NET5_0 +#if NETCOREAPP return QualifiedReference.GetHashCode (StringComparison.Ordinal); #else return QualifiedReference.GetHashCode (); From f38d583dc801cd78274aa1db49a823d559052ccf Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 13:20:51 +0100 Subject: [PATCH 06/12] Increase verbosity --- build-tools/automation/templates/core-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/automation/templates/core-build.yaml b/build-tools/automation/templates/core-build.yaml index b631aed7c..503d84a08 100644 --- a/build-tools/automation/templates/core-build.yaml +++ b/build-tools/automation/templates/core-build.yaml @@ -6,10 +6,10 @@ steps: displayName: Prepare Solution inputs: projects: Java.Interop.sln - arguments: '-c $(Build.Configuration) -target:Prepare' + arguments: '-v:diag -c $(Build.Configuration) -target:Prepare' - task: DotNetCoreCLI@2 displayName: Build Solution inputs: projects: Java.Interop.sln - arguments: '-c $(Build.Configuration) -m:1' + arguments: '-v:diag -c $(Build.Configuration) -m:1' From 0a1889ea61933485ceae6a4e90da812cbb4016cc Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 14:42:17 +0100 Subject: [PATCH 07/12] Change the condition to add JniEnvironment.g.cs To `@(Sources)`. --- src/Java.Interop/Directory.Build.targets | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Java.Interop/Directory.Build.targets b/src/Java.Interop/Directory.Build.targets index 95609908a..5069e812f 100644 --- a/src/Java.Interop/Directory.Build.targets +++ b/src/Java.Interop/Directory.Build.targets @@ -14,16 +14,18 @@ + Outputs="Java.Interop\JniEnvironment.g.cs;$(IntermediateOutputPath)jni.c"> - - <_AddCompile Condition=" !Exists('Java.Interop/JniEnvironment.g.cs') ">True - + + <_AlreadyInSources Condition = " '%(Sources.Filename)' == 'JniEnvironment.g.cs' "> + True + + - + Date: Mon, 23 Nov 2020 15:04:28 +0100 Subject: [PATCH 08/12] Install .NET core 3.1 for Mono as well --- build-tools/automation/templates/install-dependencies.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build-tools/automation/templates/install-dependencies.yaml b/build-tools/automation/templates/install-dependencies.yaml index 8bd8bf2f4..dd773964f 100644 --- a/build-tools/automation/templates/install-dependencies.yaml +++ b/build-tools/automation/templates/install-dependencies.yaml @@ -7,6 +7,12 @@ steps: inputs: version: $(DotNetCoreVersion) +- task: UseDotNet@2 + displayName: Use .NET Core 3.1.201 for Mono + inputs: + version: 3.1.201 + condition: eq(variables['agent.os'], 'Darwin') + - script: | dotnet tool install --global boots boots --stable Mono From 9ce0cde3a8fba21db61bce1115fd3d7c4bcc6e70 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 16:31:00 +0100 Subject: [PATCH 09/12] Use slash instead of backslash in Exec --- src/Java.Interop/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Java.Interop/Directory.Build.targets b/src/Java.Interop/Directory.Build.targets index 5069e812f..289ee8030 100644 --- a/src/Java.Interop/Directory.Build.targets +++ b/src/Java.Interop/Directory.Build.targets @@ -22,7 +22,7 @@ From 5efdc96aa5ce5c97a99817f13beb33500bd26ac3 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 17:48:49 +0100 Subject: [PATCH 10/12] Try to use dotnet build in place of msbuild --- build-tools/scripts/msbuild.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/scripts/msbuild.mk b/build-tools/scripts/msbuild.mk index 5819b01ed..558f6cefc 100644 --- a/build-tools/scripts/msbuild.mk +++ b/build-tools/scripts/msbuild.mk @@ -21,7 +21,7 @@ # $(MSBUILD): The MSBuild program to use. Defaults to `xbuild` unless overridden. # $(MSBUILD_FLAGS): Additional MSBuild flags; contains $(CONFIGURATION), $(V), $(MSBUILD_ARGS). -MSBUILD = msbuild +MSBUILD = dotnet build MSBUILD_FLAGS = /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) ifneq ($(V),0) From 9210b0adeef468373594968949d418614d593905 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 18:14:14 +0100 Subject: [PATCH 11/12] Do not build logcat-parse with net5.0 --- tools/logcat-parse/logcat-parse.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/logcat-parse/logcat-parse.csproj b/tools/logcat-parse/logcat-parse.csproj index 39d9ac8e7..77d7c6141 100644 --- a/tools/logcat-parse/logcat-parse.csproj +++ b/tools/logcat-parse/logcat-parse.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net472 Exe From 8abef47a05e291c53d2899fe2e523a0be9cfeb2b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 23 Nov 2020 20:17:54 +0100 Subject: [PATCH 12/12] Revert "Try to use dotnet build in place of msbuild" This reverts commit 5efdc96aa5ce5c97a99817f13beb33500bd26ac3. --- build-tools/scripts/msbuild.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/scripts/msbuild.mk b/build-tools/scripts/msbuild.mk index 558f6cefc..5819b01ed 100644 --- a/build-tools/scripts/msbuild.mk +++ b/build-tools/scripts/msbuild.mk @@ -21,7 +21,7 @@ # $(MSBUILD): The MSBuild program to use. Defaults to `xbuild` unless overridden. # $(MSBUILD_FLAGS): Additional MSBuild flags; contains $(CONFIGURATION), $(V), $(MSBUILD_ARGS). -MSBUILD = dotnet build +MSBUILD = msbuild MSBUILD_FLAGS = /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) ifneq ($(V),0)