From 12da3a8de3cd4682f12d8f593efd9ccf0e093437 Mon Sep 17 00:00:00 2001 From: Syed Hoque Date: Sun, 17 Oct 2021 11:45:16 +0100 Subject: [PATCH 1/4] Added binding and cake file --- Android/SquareOtto/License.md | 17 ++++++ Android/SquareOtto/build.cake | 61 +++++++++++++++++++ Android/SquareOtto/source/Square.Otto.sln | 25 ++++++++ .../source/Square.Otto/Square.Otto.csproj | 39 ++++++++++++ .../Square.Otto/Transforms/Metadata.xml | 3 + 5 files changed, 145 insertions(+) create mode 100644 Android/SquareOtto/License.md create mode 100644 Android/SquareOtto/build.cake create mode 100644 Android/SquareOtto/source/Square.Otto.sln create mode 100644 Android/SquareOtto/source/Square.Otto/Square.Otto.csproj create mode 100644 Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml diff --git a/Android/SquareOtto/License.md b/Android/SquareOtto/License.md new file mode 100644 index 0000000000..47a77b75b6 --- /dev/null +++ b/Android/SquareOtto/License.md @@ -0,0 +1,17 @@ +**Xamarin is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may require or install dependencies which are governed by additional licenses.** + +Note: This component depends on [Square Otto](https://github.com/square/otto), which is subject to the [Apache 2.0](https://github.com/square/otto/blob/master/LICENSE.txt) + +### Xamarin Component for Square Otto for Xamarin.Android + +**The MIT License (MIT)** + +Copyright (c) .NET Foundation Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +20211017 diff --git a/Android/SquareOtto/build.cake b/Android/SquareOtto/build.cake new file mode 100644 index 0000000000..71c75fd3aa --- /dev/null +++ b/Android/SquareOtto/build.cake @@ -0,0 +1,61 @@ +var TARGET = Argument ("t", Argument ("target", "ci")); + +var NUGET_VERSION = "1.3.8"; +var JAR_VERSION = "1.3.8"; +var JAR_URL = $"https://repo1.maven.org/maven2/com/squareup/otto/{JAR_VERSION}/otto-{JAR_VERSION}.jar"; + +Task ("externals") + .Does (() => +{ + EnsureDirectoryExists ("./externals"); + + DownloadFile(JAR_URL, $"./externals/otto-{JAR_VERSION}.jar"); + + // Update .csproj nuget versions + XmlPoke("./source/Square.Otto/Square.Otto.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION); +}); + +Task("nuget") + .IsDependentOn("externals") + .Does(() => +{ + MSBuild ("./source/Square.Otto.sln", c => { + c.Configuration = "Release"; + c.Restore = true; + 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" }); + }); +}); + +Task("samples") + .IsDependentOn("nuget") + .Does(() => +{ + MSBuild ("./samples/OttoSample.sln", c => { + c.Configuration = "Release"; + c.Restore = true; + c.MaxCpuCount = 0; + c.Properties.Add("DesignTimeBuild", new [] { "false" }); + }); +}); + +Task("ci") + .IsDependentOn("externals") + .IsDependentOn("nuget") + .IsDependentOn("samples"); + +Task ("clean") + .Does (() => +{ + if (DirectoryExists ("./externals/")) + DeleteDirectory ("./externals", new DeleteDirectorySettings { + Recursive = true, + Force = true + }); +}); + +RunTarget (TARGET); diff --git a/Android/SquareOtto/source/Square.Otto.sln b/Android/SquareOtto/source/Square.Otto.sln new file mode 100644 index 0000000000..bff0abec96 --- /dev/null +++ b/Android/SquareOtto/source/Square.Otto.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.810.11 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Otto", "Square.Otto\Square.Otto.csproj", "{BDC349A9-FD46-4C47-BC7C-39B1DB9D6733}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BDC349A9-FD46-4C47-BC7C-39B1DB9D6733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDC349A9-FD46-4C47-BC7C-39B1DB9D6733}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDC349A9-FD46-4C47-BC7C-39B1DB9D6733}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDC349A9-FD46-4C47-BC7C-39B1DB9D6733}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C4E37940-5107-4AF7-B3B2-E6338D309DB5} + EndGlobalSection +EndGlobal diff --git a/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj b/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj new file mode 100644 index 0000000000..00704f6b64 --- /dev/null +++ b/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj @@ -0,0 +1,39 @@ + + + + MonoAndroid8.0;MonoAndroid9.0;MonoAndroid10.0;MonoAndroid11.0 + true + Square.Otto + Square.Otto + False + True + class-parse + XAJavaInterop1 + + + Square.Otto + Otto bindings for Xamarin.Android + Otto - An event bus by Square + An enhanced Guava-based event bus with emphasis on Android support. + Microsoft + Microsoft + © Microsoft Corporation. All rights reserved. + License.md + true + Otto square square.otto xamarin android monodroid + https://go.microsoft.com/fwlink/?linkid=2130312 + 1.3.8 + + + 0618;0109;0114;0628;0108;0809;0113 + XA0113 + + + + + + + + + + \ No newline at end of file diff --git a/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml b/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml new file mode 100644 index 0000000000..5ae3cc6c64 --- /dev/null +++ b/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml @@ -0,0 +1,3 @@ + + SquareUp.Otto + From 237dcbcbbe44c461f8b670f48cda991d2af59917 Mon Sep 17 00:00:00 2001 From: Syed Hoque Date: Mon, 18 Oct 2021 07:41:35 +0100 Subject: [PATCH 2/4] Update metadata to `Square.Otto` --- Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml b/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml index 5ae3cc6c64..178146a964 100644 --- a/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml +++ b/Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml @@ -1,3 +1,3 @@  - SquareUp.Otto + Square.Otto From 47636fec2be623df51df3b50f448a2deede41890 Mon Sep 17 00:00:00 2001 From: Syed Hoque Date: Mon, 18 Oct 2021 07:42:00 +0100 Subject: [PATCH 3/4] Update project url to new link --- Android/SquareOtto/source/Square.Otto/Square.Otto.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj b/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj index 00704f6b64..aab8379bf1 100644 --- a/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj +++ b/Android/SquareOtto/source/Square.Otto/Square.Otto.csproj @@ -21,7 +21,7 @@ License.md true Otto square square.otto xamarin android monodroid - https://go.microsoft.com/fwlink/?linkid=2130312 + https://go.microsoft.com/fwlink/?linkid=2174733 1.3.8 From f5d675f7d54cb5a2118c68a755017be96f22a23f Mon Sep 17 00:00:00 2001 From: Syed Hoque Date: Mon, 18 Oct 2021 07:43:08 +0100 Subject: [PATCH 4/4] Added package to the manifest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Please `yaml` don't fail me 👻 --- manifest.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifest.yaml b/manifest.yaml index 49443d05d2..20e2b9ed99 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -465,6 +465,11 @@ TriggerPaths: [ Android/Protobuf.JavaLite ] MacBuildTargets: [ ci ] WindowsBuildTargets: [ ci ] +- Name: SquareOtto + BuildScript: ./Android/SquareOtto/build.cake + TriggerPaths: [ Android/SquareOtto ] + MacBuildTargets: [ ci ] + WindowsBuildTargets: [ ci ] #######################################################