From 3aae2d643e9e6b9a5fed7ba9d091a4677befb935 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Tue, 10 Aug 2021 13:02:39 +0100 Subject: [PATCH 1/8] Try to use GitInfo --- Directory.Build.props | 18 +++++++++++++++-- GitInfo.txt | 1 + build-tools/automation/azure-pipelines.yaml | 20 +++++++++---------- .../Java.Interop.Dynamic.csproj | 3 --- .../Java.Interop.Export.csproj | 3 --- .../Java.Interop.GenericMarshaler.csproj | 3 --- .../Java.Interop.Tools.JavaSource.csproj | 3 --- src/Java.Interop/Java.Interop.csproj | 1 - src/Java.Interop/Properties/AssemblyInfo.cs | 8 +------- src/version/AssemblyVersionInfo.cs | 10 ++++++++++ src/version/Version.props | 5 +++++ .../Java.Interop-Tests.csproj | 2 ++ tools/generator/generator.csproj | 2 +- 13 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 GitInfo.txt create mode 100644 src/version/AssemblyVersionInfo.cs create mode 100644 src/version/Version.props diff --git a/Directory.Build.props b/Directory.Build.props index f0a3dd1ef..31526459b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,10 @@ Debug <_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\ + false + CS0436 - + cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant true @@ -75,7 +77,7 @@ <_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(DotnetToolPath) "$(_JNIEnvGenPath)" <_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)" - + @@ -84,4 +86,16 @@ + + + main + false + true + + + + + + + diff --git a/GitInfo.txt b/GitInfo.txt new file mode 100644 index 000000000..6da28dde7 --- /dev/null +++ b/GitInfo.txt @@ -0,0 +1 @@ +0.1.1 \ No newline at end of file diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 6888adaf8..338a4912f 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -19,7 +19,7 @@ variables: RunningOnCI: true Build.Configuration: Release MaxJdkVersion: 8 - DotNetCoreVersion: 6.0.x + DotNetCoreVersion: 6.0.100-preview.6.21355.2 HostedMacImage: macOS-10.15 HostedWinVS2019: Hosted Windows 2019 with VS2019 NetCoreTargetFrameworkPathSuffix: -net6.0 @@ -58,7 +58,7 @@ jobs: solution: Java.Interop.sln configuration: $(Build.Configuration) msbuildArguments: /restore - + - task: MSBuild@1 displayName: MSBuild RunNUnitTests.targets inputs: @@ -93,7 +93,7 @@ jobs: runNativeDotnetTests: true - template: templates\fail-on-issue.yaml - + - job: mac_build displayName: Mac - Mono pool: @@ -114,10 +114,10 @@ jobs: - script: make prepare CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) displayName: make prepare - + - script: make all CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) displayName: make all - + - script: | r=0 make run-all-tests CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) || r=$? @@ -139,7 +139,7 @@ jobs: SourceFolder: $(System.DefaultWorkingDirectory) Contents: | xatb.jar - bin.zip + bin.zip TargetFolder: $(Build.ArtifactStagingDirectory) condition: succeededOrFailed() @@ -148,7 +148,7 @@ jobs: inputs: ArtifactName: debug condition: succeededOrFailed() - + - job: mac_dotnet_build displayName: Mac - .NET Core pool: @@ -161,12 +161,12 @@ jobs: submodules: recursive - template: templates\install-dependencies.yaml - + - script: make prepare-core CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) displayName: make prepare-core - + - template: templates\core-build.yaml - + - template: templates\core-tests.yaml parameters: runNativeTests: true diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj b/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj index 0204f38b3..228da5b2a 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj @@ -7,9 +7,6 @@ true ..\..\product.snk Java.Interop.Dynamic - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop.Export/Java.Interop.Export.csproj b/src/Java.Interop.Export/Java.Interop.Export.csproj index 8d923e92d..b1dd39bd6 100644 --- a/src/Java.Interop.Export/Java.Interop.Export.csproj +++ b/src/Java.Interop.Export/Java.Interop.Export.csproj @@ -7,9 +7,6 @@ true ..\..\product.snk Java.Interop.Export - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj b/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj index 62da24d00..1b69c773e 100644 --- a/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj +++ b/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj @@ -7,9 +7,6 @@ true ..\..\product.snk Java.Interop.GenericMarshaler - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj index ea4be696a..9dce7a0ac 100644 --- a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj +++ b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj @@ -7,9 +7,6 @@ INTERNAL_NULLABLE_ATTRIBUTES {5C0B3562-8DA0-4726-9762-75B9709ED6B7} Java.Interop.Tools.JavaSource - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop/Java.Interop.csproj b/src/Java.Interop/Java.Interop.csproj index 263a61de3..e61282d0e 100644 --- a/src/Java.Interop/Java.Interop.csproj +++ b/src/Java.Interop/Java.Interop.csproj @@ -22,7 +22,6 @@ ..\..\product.snk INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS;INTERNAL_NULLABLE_ATTRIBUTES;$(JavaInteropDefineConstants) true - false $(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\ $(ToolOutputFullPath) $(ToolOutputFullPath)Java.Interop.xml diff --git a/src/Java.Interop/Properties/AssemblyInfo.cs b/src/Java.Interop/Properties/AssemblyInfo.cs index 5222403e5..5d33a80b0 100644 --- a/src/Java.Interop/Properties/AssemblyInfo.cs +++ b/src/Java.Interop/Properties/AssemblyInfo.cs @@ -4,15 +4,9 @@ [assembly: DefaultDllImportSearchPathsAttribute (DllImportSearchPath.SafeDirectories | DllImportSearchPath.AssemblyDirectory)] -[assembly: AssemblyTitle ("Java.Interop")] [assembly: AssemblyDescription ("")] [assembly: AssemblyCulture ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Microsoft Corporation")] -[assembly: AssemblyCopyright ("Microsoft Corporation")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyTrademark ("Microsoft Corporation")] -[assembly: AssemblyVersion ("0.1.0.0")] + [assembly: AssemblyMetadata ("IsTrimmable", "True")] [assembly: InternalsVisibleTo ( diff --git a/src/version/AssemblyVersionInfo.cs b/src/version/AssemblyVersionInfo.cs new file mode 100644 index 000000000..ee35f1051 --- /dev/null +++ b/src/version/AssemblyVersionInfo.cs @@ -0,0 +1,10 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyCompany ("Microsoft Corporation")] +[assembly: AssemblyCopyright ("Microsoft Corporation")] +[assembly: AssemblyTrademark ("Microsoft Corporation")] +[assembly: AssemblyVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "." + ThisAssembly.Git.BaseVersion.Patch)] +[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch)] +[assembly: AssemblyInformationalVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "; git-rev-head:" + ThisAssembly.Git.Commit + " git-branch:" + ThisAssembly.Git.Branch)] diff --git a/src/version/Version.props b/src/version/Version.props new file mode 100644 index 000000000..ca3364d40 --- /dev/null +++ b/src/version/Version.props @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tests/Java.Interop-Tests/Java.Interop-Tests.csproj b/tests/Java.Interop-Tests/Java.Interop-Tests.csproj index a04402fd4..112c6e0c3 100644 --- a/tests/Java.Interop-Tests/Java.Interop-Tests.csproj +++ b/tests/Java.Interop-Tests/Java.Interop-Tests.csproj @@ -4,6 +4,8 @@ net472;net6.0 false true + true + ..\..\product.snk diff --git a/tools/generator/generator.csproj b/tools/generator/generator.csproj index 34e613108..7e8b87a06 100644 --- a/tools/generator/generator.csproj +++ b/tools/generator/generator.csproj @@ -26,7 +26,7 @@ utils\XmlExtensions.cs - + From eaf60ae65970bfa6eb5dd56e59b076d42f01f563 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Fri, 13 Aug 2021 15:23:05 +0100 Subject: [PATCH 2/8] Try using Built-in Version MSBuild Property --- Directory.Build.props | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 31526459b..533d0ffb3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,7 @@ Debug <_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\ - false - CS0436 + true @@ -87,15 +86,18 @@ - - main - false - true - + + main + false + - - + + + $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) + $(Version); git-head: $(GitCommit) git-branch: $(GitBranch) + + From cb64d2588428d027f734a5135749b19fb0d8ed10 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Fri, 13 Aug 2021 15:40:37 +0100 Subject: [PATCH 3/8] Remove unused files --- src/version/AssemblyVersionInfo.cs | 10 ---------- src/version/Version.props | 5 ----- 2 files changed, 15 deletions(-) delete mode 100644 src/version/AssemblyVersionInfo.cs delete mode 100644 src/version/Version.props diff --git a/src/version/AssemblyVersionInfo.cs b/src/version/AssemblyVersionInfo.cs deleted file mode 100644 index ee35f1051..000000000 --- a/src/version/AssemblyVersionInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyCompany ("Microsoft Corporation")] -[assembly: AssemblyCopyright ("Microsoft Corporation")] -[assembly: AssemblyTrademark ("Microsoft Corporation")] -[assembly: AssemblyVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "." + ThisAssembly.Git.BaseVersion.Patch)] -[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch)] -[assembly: AssemblyInformationalVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "; git-rev-head:" + ThisAssembly.Git.Commit + " git-branch:" + ThisAssembly.Git.Branch)] diff --git a/src/version/Version.props b/src/version/Version.props deleted file mode 100644 index ca3364d40..000000000 --- a/src/version/Version.props +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file From 5e8f8fd74771477b5eca6c895f13b3b0f8d954bd Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 18 Aug 2021 11:13:40 -0400 Subject: [PATCH 4/8] Use GitInfo 2.1.2, not *. --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 533d0ffb3..2db73a5ad 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -87,7 +87,7 @@ - + main From 912a6100c4c5df12606edc81e969bd1859b0ca25 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 18 Aug 2021 11:18:59 -0400 Subject: [PATCH 5/8] Use DotNetCoreVersion 6.0.x We think this was bumped to a specific preview6 version because of: https://discord.com/channels/732297728826277939/732297837953679412/874959446747533323 error CS8400: Feature 'interpolated string handlers' is not available in C# 8.0. Please use language version 10.0 or greater. However, is it still needed? --- 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 338a4912f..10c5cb1f0 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -19,7 +19,7 @@ variables: RunningOnCI: true Build.Configuration: Release MaxJdkVersion: 8 - DotNetCoreVersion: 6.0.100-preview.6.21355.2 + DotNetCoreVersion: 6.0.x HostedMacImage: macOS-10.15 HostedWinVS2019: Hosted Windows 2019 with VS2019 NetCoreTargetFrameworkPathSuffix: -net6.0 From cfbc5e8bff511dc3c3ea071449675b64ed3da232 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Thu, 19 Aug 2021 10:54:59 +0100 Subject: [PATCH 6/8] Use a two digit GitInfo.txt value --- GitInfo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitInfo.txt b/GitInfo.txt index 6da28dde7..ceab6e11e 100644 --- a/GitInfo.txt +++ b/GitInfo.txt @@ -1 +1 @@ -0.1.1 \ No newline at end of file +0.1 \ No newline at end of file From d062d2efe2a8337e5a16f92006d1c9fea7aafb8e Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Thu, 19 Aug 2021 09:17:57 -0400 Subject: [PATCH 7/8] Use same `$(InformationalVersion)` "conventions" as Mono.Android Context: https://github.com/xamarin/xamarin-android/commit/b620689ddf0214b1e38d5feab9e2ea7a653614ff --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2db73a5ad..77b2b454e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -97,7 +97,7 @@ $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) - $(Version); git-head: $(GitCommit) git-branch: $(GitBranch) + $(Version); git-rev-head:$(GitCommit); git-branch:$(GitBranch) From ef3bc84516fa1a2eaac4a18199786cfeabaf4171 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Thu, 19 Aug 2021 16:47:52 +0100 Subject: [PATCH 8/8] Add Company and Copyright back for all assemblies --- Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 2db73a5ad..79488f611 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -98,6 +98,8 @@ $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) $(Version); git-head: $(GitCommit) git-branch: $(GitBranch) + Microsoft Corporation + Microsoft Corporation