Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create binding for Square.Otto #1290

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions Android/SquareOtto/License.md
Original file line number Diff line number Diff line change
@@ -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
61 changes: 61 additions & 0 deletions Android/SquareOtto/build.cake
Original file line number Diff line number Diff line change
@@ -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);
25 changes: 25 additions & 0 deletions Android/SquareOtto/source/Square.Otto.sln
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions Android/SquareOtto/source/Square.Otto/Square.Otto.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project Sdk="MSBuild.Sdk.Extras/3.0.38">
<PropertyGroup>
<TargetFrameworks>MonoAndroid8.0;MonoAndroid9.0;MonoAndroid10.0;MonoAndroid11.0</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<AssemblyName>Square.Otto</AssemblyName>
<RootNamespace>Square.Otto</RootNamespace>
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
<AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile>
<AndroidClassParser>class-parse</AndroidClassParser>
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
</PropertyGroup>
<PropertyGroup>
<PackageId>Square.Otto</PackageId>
<Title>Otto bindings for Xamarin.Android</Title>
<Summary>Otto - An event bus by Square</Summary>
<Description>An enhanced Guava-based event bus with emphasis on Android support.</Description>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageLicenseFile>License.md</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>Otto square square.otto xamarin android monodroid</PackageTags>
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=2130312</PackageProjectUrl>
syedhoque89 marked this conversation as resolved.
Show resolved Hide resolved
<PackageVersion>1.3.8</PackageVersion>
</PropertyGroup>
<PropertyGroup>
<NoWarn>0618;0109;0114;0628;0108;0809;0113</NoWarn>
<MSBuildWarningsAsMessages>XA0113</MSBuildWarningsAsMessages>
</PropertyGroup>
<ItemGroup>
<None Remove="Transforms\*.xml" />
<TransformFile Include="Transforms\*.xml" />
<EmbeddedJar Include="..\..\externals\*.jar" Link="Jars\%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\License.md" Pack="true" PackagePath="License.md" />
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions Android/SquareOtto/source/Square.Otto/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<metadata>
<attr path="/api/package[@name='com.squareup.otto']" name="managedName">SquareUp.Otto</attr>
syedhoque89 marked this conversation as resolved.
Show resolved Hide resolved
</metadata>