diff --git a/.ci/build.yml b/.ci/build.yml index aa3808fc5b..e3b4d9a45d 100644 --- a/.ci/build.yml +++ b/.ci/build.yml @@ -107,6 +107,7 @@ jobs: inputs: version: ${{ parameters.dotnet }} performMultiLevelLookup: true + includePreviewVersions: true condition: ne('${{ parameters.dotnet }}', '') # custom init steps - ${{ parameters.initSteps }} diff --git a/.gitignore b/.gitignore index 67afa3b28c..c108e3e51e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ tmpnupkg/ *.user artifacts/ .idea/ +*.binlog diff --git a/Android/Guava/Directory.Build.props b/Android/Guava/Directory.Build.props new file mode 100644 index 0000000000..62f9c047c0 --- /dev/null +++ b/Android/Guava/Directory.Build.props @@ -0,0 +1,14 @@ + + + + + + 28.2.0.1$(PackageVersionSuffix) + 1.0.1.3$(PackageVersionSuffix) + 1.0.0.3$(PackageVersionSuffix) + + + <_NuGetBuildFolders Include="build\;buildTransitive\" /> + <_TfmNuGetBuildFolders Include="@(_NuGetBuildFolders->'%(Identity)monoandroid90\');@(_NuGetBuildFolders->'%(Identity)net6.0-android30.0\')" /> + + \ No newline at end of file diff --git a/Android/Guava/build.cake b/Android/Guava/build.cake index 78a3701eba..a9f1bbece4 100644 --- a/Android/Guava/build.cake +++ b/Android/Guava/build.cake @@ -7,10 +7,6 @@ var GUAVA_VERSION = GUAVA_VERSION_BASE + "-android"; var GUAVA_FAILUREACCESS_VERSION = "1.0.1"; var GUAVA_LISTENABLEFUTURE_VERSION = "1.0"; -var GUAVA_NUGET_VERSION = "28.2.0.0"; -var GUAVA_FAILUREACCESS_NUGET_VERSION = "1.0.1.2"; -var GUAVA_LISTENABLEFUTURE_NUGET_VERSION = "1.0.0.2"; - var JSR305_VERSION = "3.0.2"; var CHECKER_COMPAT_QUAL_VERSION = "2.5.5"; var ERROR_PRONE_ANNOTATIONS_VERSION = "2.3.3"; @@ -99,11 +95,6 @@ Task ("externals") if (zipFile != null) zipFile.Close(); } - - // Update .csproj nuget versions - XmlPoke("./source/Guava/Guava.csproj", "/Project/PropertyGroup/PackageVersion", GUAVA_NUGET_VERSION); - XmlPoke("./source/Guava.FailureAccess/Guava.FailureAccess.csproj", "/Project/PropertyGroup/PackageVersion", GUAVA_FAILUREACCESS_NUGET_VERSION); - XmlPoke("./source/Guava.ListenableFuture/Guava.ListenableFuture.csproj", "/Project/PropertyGroup/PackageVersion", GUAVA_LISTENABLEFUTURE_NUGET_VERSION); }); @@ -111,38 +102,40 @@ Task("libs") .IsDependentOn("externals") .Does(() => { - MSBuild("./Guava.sln", c => { - c.Configuration = "Release"; - c.Restore = true; - c.MaxCpuCount = 0; - c.Properties.Add("DesignTimeBuild", new [] { "false" }); - }); + DotNetCoreRestore ("./Guava.sln"); + + DotNetCoreMSBuild ("./Guava.sln", + new DotNetCoreMSBuildSettings() + .SetConfiguration("Release") + ); }); Task("nuget") .IsDependentOn("libs") .Does(() => { - MSBuild ("./Guava.sln", c => { - c.Configuration = "Release"; - c.MaxCpuCount = 0; - c.Targets.Clear(); - c.Targets.Add("Pack"); - c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath }); - c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" }); - c.Properties.Add("DesignTimeBuild", new [] { "false" }); - c.Properties.Add("NoBuild", new [] { "true" }); - }); + DotNetCoreMSBuild ("./Guava.sln", + new DotNetCoreMSBuildSettings() + .WithTarget("Pack") + .SetConfiguration("Release") + .WithProperty ("PackageOutputPath", MakeAbsolute(new FilePath("./output")).FullPath) + .WithProperty ("PackageRequireLicenseAcceptance", "true") + .WithProperty ("NoBuild", "true") + ); }); Task("samples") - .IsDependentOn("nuget"); + .IsDependentOn("nuget") + .Does (() => +{ + MSBuild("./samples/GuavaSample/GuavaSample.csproj", c => c.Restore = true); +}); Task ("clean") .Does (() => { if (DirectoryExists ("./externals/")) - DeleteDirectory ("./externals", true); + DeleteDirectory ("./externals", new DeleteDirectorySettings { Recursive = true }); }); Task ("ci") diff --git a/Android/Guava/samples/GuavaSample/Future.cs b/Android/Guava/samples/GuavaSample/Future.cs new file mode 100644 index 0000000000..28faba3c8d --- /dev/null +++ b/Android/Guava/samples/GuavaSample/Future.cs @@ -0,0 +1,25 @@ +using Google.Common.Util.Concurrent; +using Java.Lang; +using Java.Util.Concurrent; + +namespace GuavaSample +{ + // Just ensure this compiles + public class Future : Java.Lang.Object, IListenableFuture + { + public bool IsCancelled { get; set; } + + public bool IsDone { get; set; } + + public void AddListener(IRunnable p0, IExecutor p1) + { + + } + + public bool Cancel(bool mayInterruptIfRunning) => true; + + public Object Get() => null; + + public Object Get(long timeout, TimeUnit unit) => null; + } +} \ No newline at end of file diff --git a/Android/Guava/samples/GuavaSample/GuavaSample.csproj b/Android/Guava/samples/GuavaSample/GuavaSample.csproj new file mode 100644 index 0000000000..beb33d51eb --- /dev/null +++ b/Android/Guava/samples/GuavaSample/GuavaSample.csproj @@ -0,0 +1,57 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {FF3EDEBE-27B3-42E5-A713-9EA81CB5397A} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {122416d6-6b49-4ee2-a1e8-b825f31c79fe} + Library + Properties + GuavaSample + GuavaSample + 512 + True + v11.0 + class-parse + false + + + True + portable + False + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + True + portable + True + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Android/Guava/samples/GuavaSample/Properties/AssemblyInfo.cs b/Android/Guava/samples/GuavaSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..8ffbb2a443 --- /dev/null +++ b/Android/Guava/samples/GuavaSample/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Android.App; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GuavaSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GuavaSample")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Android/Guava/samples/NuGet.config b/Android/Guava/samples/NuGet.config new file mode 100644 index 0000000000..a80312bcf3 --- /dev/null +++ b/Android/Guava/samples/NuGet.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.csproj b/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.csproj index 68133ff23f..62957c55ef 100644 --- a/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.csproj +++ b/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.csproj @@ -1,17 +1,9 @@ - - + - monoandroid90 + net6.0-android30;monoandroid90 true Xamarin.Google.Guava.FailureAccess - Resources - Assets - False - True - Resources\Resource.designer.cs Guava.FailureAccess - class-parse - XAJavaInterop1 ..\..\externals\guava-failureaccess-javadocs\ @@ -32,20 +24,17 @@ Guava is a set of core libraries that includes new collection types (such as mul https://go.microsoft.com/fwlink/?linkid=865028 https://go.microsoft.com/fwlink/?linkid=865030 true - 1.0.1.2 + $(GuavaFailureAccessNuGetVersion) - - - - + + - diff --git a/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.targets b/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.targets index a3e79733b3..4376d0f13e 100644 --- a/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.targets +++ b/Android/Guava/source/Guava.FailureAccess/Guava.FailureAccess.targets @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Android/Guava/source/Guava.FailureAccess/Transforms.xml b/Android/Guava/source/Guava.FailureAccess/Transforms/Transforms.xml similarity index 100% rename from Android/Guava/source/Guava.FailureAccess/Transforms.xml rename to Android/Guava/source/Guava.FailureAccess/Transforms/Transforms.xml diff --git a/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.csproj b/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.csproj index 8432d19594..3478f517d0 100644 --- a/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.csproj +++ b/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.csproj @@ -1,17 +1,9 @@ - - + - monoandroid90 + net6.0-android30;monoandroid90 true Xamarin.Google.Guava.ListenableFuture - Resources - Assets - False - True - Resources\Resource.designer.cs Guava.ListenableFuture - class-parse - XAJavaInterop1 ..\..\externals\guava-listenablefuture-javadocs\ @@ -32,20 +24,17 @@ Guava is a set of core libraries that includes new collection types (such as mul https://go.microsoft.com/fwlink/?linkid=865028 https://go.microsoft.com/fwlink/?linkid=865030 true - 1.0.0.2 + $(GuavaListenableFutureNuGetVersion) - - - - + + - diff --git a/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets b/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets index a3e79733b3..4376d0f13e 100644 --- a/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets +++ b/Android/Guava/source/Guava.ListenableFuture/Guava.ListenableFuture.targets @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Android/Guava/source/Guava.ListenableFuture/Transforms.xml b/Android/Guava/source/Guava.ListenableFuture/Transforms/Transforms.xml similarity index 100% rename from Android/Guava/source/Guava.ListenableFuture/Transforms.xml rename to Android/Guava/source/Guava.ListenableFuture/Transforms/Transforms.xml diff --git a/Android/Guava/source/Guava/Guava.csproj b/Android/Guava/source/Guava/Guava.csproj index 75ded86753..57b027de0d 100644 --- a/Android/Guava/source/Guava/Guava.csproj +++ b/Android/Guava/source/Guava/Guava.csproj @@ -1,17 +1,9 @@ - - + - monoandroid90 + net6.0-android30;monoandroid90 true Xamarin.Google.Guava - Resources - Assets - False - True - Resources\Resource.designer.cs Guava - class-parse - XAJavaInterop1 ..\..\externals\guava-javadocs\ @@ -32,14 +24,12 @@ Guava is a set of core libraries that includes new collection types (such as mul https://go.microsoft.com/fwlink/?linkid=865028 https://go.microsoft.com/fwlink/?linkid=865030 true - 28.2.0.0 + $(GuavaNuGetVersion) - - - - + + @@ -50,7 +40,6 @@ Guava is a set of core libraries that includes new collection types (such as mul - diff --git a/Android/Guava/source/Guava/Guava.targets b/Android/Guava/source/Guava/Guava.targets index 1363ddd8e0..b2a93d8076 100644 --- a/Android/Guava/source/Guava/Guava.targets +++ b/Android/Guava/source/Guava/Guava.targets @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Android/Guava/source/Guava/Transforms.xml b/Android/Guava/source/Guava/Transforms/Transforms.xml similarity index 100% rename from Android/Guava/source/Guava/Transforms.xml rename to Android/Guava/source/Guava/Transforms/Transforms.xml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0db4680864..cb8e76ea48 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,6 +18,11 @@ resources: endpoint: xamarin ref: refs/heads/main +variables: + DotNet6Version: 6.0.100-preview.4.21255.9 + XamarinAndroidVsix: https://download.visualstudio.microsoft.com/download/pr/df30312e-15ca-440c-a68f-71b1a607b3a0/bcaeb3543b68c9db872f7e1dba6ba4ccb18c27525a8cbd5101e9301e96a1904c/Xamarin.Android.Sdk-11.3.0.1.vsix + XamarinAndroidPkg: https://download.visualstudio.microsoft.com/download/pr/a0b4924f-c812-48d9-997f-c7e39d5eeb8a/611a6933f16ef1ae837beca7de265713/xamarin.android-11.3.0.1.pkg + jobs: - template: .ci/build.yml@components parameters: @@ -41,15 +46,23 @@ jobs: - JakeWharton.Picasso2OkHttp3Downloader - RecyclerViewAnimators - GoogleGson + dotnet: $(DotNet6Version) preBuildSteps: - pwsh: | dotnet tool install --global boots - boots https://aka.ms/xamarin-android-commercial-d16-9-macos + displayName: install .NET global tools + - pwsh: | + boots $(XamarinAndroidPkg) condition: eq(variables['System.JobName'], 'macos') + displayName: install Xamarin.Android - pwsh: | - dotnet tool install --global boots - boots https://aka.ms/xamarin-android-commercial-d16-9-windows + boots $(XamarinAndroidVsix) condition: eq(variables['System.JobName'], 'windows') + displayName: install Xamarin.Android + - pwsh: | + dotnet workload install microsoft-android-sdk-full + displayName: install .NET 6 Android Workload + condition: ne(variables['System.JobName'], 'linux') tools: - 'xamarin.androidbinderator.tool': '0.4.3' - 'xamarin.androidx.migration.tool': '1.0.8' diff --git a/global.json b/global.json index 0d0701b41c..1ca5ffe99e 100644 --- a/global.json +++ b/global.json @@ -3,6 +3,7 @@ { "MSBuild.Sdk.Extras": "3.0.23", "Microsoft.Build.Traversal": "2.1.1", - "Microsoft.Build.NoTargets": "2.0.1" + "Microsoft.Build.NoTargets": "2.0.1", + "Xamarin.Legacy.Sdk": "0.1.0-alpha2" } } \ No newline at end of file