Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 4c2465e

Browse files
committed
Mapbox.MapboxJavaCore v2.0.0
1 parent a06b8e9 commit 4c2465e

File tree

12 files changed

+307
-0
lines changed

12 files changed

+307
-0
lines changed

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Autosave files
2+
*~
3+
4+
# build
5+
[Oo]bj/
6+
[Bb]in/
7+
packages/
8+
TestResults/
9+
10+
# globs
11+
Makefile.in
12+
*.DS_Store
13+
*.sln.cache
14+
*.suo
15+
*.cache
16+
*.pidb
17+
*.userprefs
18+
*.usertasks
19+
config.log
20+
config.make
21+
config.status
22+
aclocal.m4
23+
install-sh
24+
autom4te.cache/
25+
*.user
26+
*.tar.gz
27+
tarballs/
28+
test-results/
29+
Thumbs.db
30+
31+
# Mac bundle stuff
32+
*.dmg
33+
*.app
34+
35+
# resharper
36+
*_Resharper.*
37+
*.Resharper
38+
39+
# dotCover
40+
*.dotCover
41+
*.nupkg

MapboxJavaCore.sln

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Naxam.Mapbox.MapboxJavaCore", "Naxam.Mapbox.MapboxJavaCore\Naxam.Mapbox.MapboxJavaCore.csproj", "{3A1FCDC9-9045-4830-87C3-FB3D139C5636}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Any CPU = Debug|Any CPU
9+
Release|Any CPU = Release|Any CPU
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{3A1FCDC9-9045-4830-87C3-FB3D139C5636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{3A1FCDC9-9045-4830-87C3-FB3D139C5636}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{3A1FCDC9-9045-4830-87C3-FB3D139C5636}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{3A1FCDC9-9045-4830-87C3-FB3D139C5636}.Release|Any CPU.Build.0 = Release|Any CPU
16+
EndGlobalSection
17+
EndGlobal
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Additions allow you to add arbitrary C# to the generated classes
2+
before they are compiled. This can be helpful for providing convenience
3+
methods or adding pure C# classes.
4+
5+
== Adding Methods to Generated Classes ==
6+
7+
Let's say the library being bound has a Rectangle class with a constructor
8+
that takes an x and y position, and a width and length size. It will look like
9+
this:
10+
11+
public partial class Rectangle
12+
{
13+
public Rectangle (int x, int y, int width, int height)
14+
{
15+
// JNI bindings
16+
}
17+
}
18+
19+
Imagine we want to add a constructor to this class that takes a Point and
20+
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
21+
with a partial class containing our new method:
22+
23+
public partial class Rectangle
24+
{
25+
public Rectangle (Point location, Size size) :
26+
this (location.X, location.Y, size.Width, size.Height)
27+
{
28+
}
29+
}
30+
31+
At compile time, the additions class will be added to the generated class
32+
and the final assembly will a Rectangle class with both constructors.
33+
34+
35+
== Adding C# Classes ==
36+
37+
Another thing that can be done is adding fully C# managed classes to the
38+
generated library. In the above example, let's assume that there isn't a
39+
Point class available in Java or our library. The one we create doesn't need
40+
to interact with Java, so we'll create it like a normal class in C#.
41+
42+
By adding a Point.cs file with this class, it will end up in the binding library:
43+
44+
public class Point
45+
{
46+
public int X { get; set; }
47+
public int Y { get; set; }
48+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This directory is for Android .jars.
2+
3+
There are 4 types of jars that are supported:
4+
5+
== Input Jar and Embedded Jar ==
6+
7+
This is the jar that bindings should be generated for.
8+
9+
For example, if you were binding the Google Maps library, this would
10+
be Google's "maps.jar".
11+
12+
The difference between EmbeddedJar and InputJar is, EmbeddedJar is to be
13+
embedded in the resulting dll as EmbeddedResource, while InputJar is not.
14+
There are couple of reasons you wouldn't like to embed the target jar
15+
in your dll (the ones that could be internally loaded by <uses-library>
16+
feature e.g. maps.jar, or you cannot embed jars that are under some
17+
proprietary license).
18+
19+
Set the build action for these jars in the properties page to "InputJar".
20+
21+
22+
== Reference Jar and Embedded Reference Jar ==
23+
24+
These are jars that are referenced by the input jar. C# bindings will
25+
not be created for these jars. These jars will be used to resolve
26+
types used by the input jar.
27+
28+
NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
29+
based on the Target Framework selected.
30+
31+
Set the build action for these jars in the properties page to "ReferenceJar".
32+
33+
"EmbeddedJar" works like "ReferenceJar", but like "EmbeddedJar", it is
34+
embedded in your dll. But at application build time, they are not included
35+
in the final apk, like ReferenceJar files.
36+
Binary file not shown.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{3A1FCDC9-9045-4830-87C3-FB3D139C5636}</ProjectGuid>
7+
<ProjectTypeGuids>{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<OutputType>Library</OutputType>
9+
<RootNamespace>Naxam.Mapbox.MapboxJavaCore</RootNamespace>
10+
<AssemblyName>Naxam.Mapbox.MapboxJavaCore</AssemblyName>
11+
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
12+
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
13+
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
14+
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug</OutputPath>
21+
<DefineConstants>DEBUG;</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
<AndroidLinkMode>None</AndroidLinkMode>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugSymbols>true</DebugSymbols>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release</OutputPath>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
<AndroidManagedSymbols>true</AndroidManagedSymbols>
34+
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.Xml" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="Mono.Android" />
41+
</ItemGroup>
42+
<ItemGroup>
43+
<Compile Include="Properties\AssemblyInfo.cs" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<None Include="Additions\AboutAdditions.txt" />
47+
<None Include="Jars\AboutJars.txt" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<TransformFile Include="Transforms\EnumFields.xml" />
51+
<TransformFile Include="Transforms\EnumMethods.xml" />
52+
<TransformFile Include="Transforms\Metadata.xml" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<EmbeddedJar Include="Jars\mapbox-java-core-2.0.0.jar" />
56+
</ItemGroup>
57+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
58+
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using Android.App;
4+
5+
// Information about this assembly is defined by the following attributes.
6+
// Change them to the values specific to your project.
7+
8+
[assembly: AssemblyTitle("Naxam.Mapbox.MapboxJavaCore")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("NAXAM CO.,LTD")]
12+
[assembly: AssemblyProduct("")]
13+
[assembly: AssemblyCopyright("Copyright (c) 2017 NAXAM")]
14+
[assembly: AssemblyTrademark("NAXAM")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18+
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
19+
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
20+
21+
[assembly: AssemblyVersion("2.0.0")]
22+
[assembly: AssemblyInformationalVersion("2.0.0")]
23+
24+
// The following attributes are used to specify the signing key for the assembly,
25+
// if desired. See the Mono documentation for more information about signing.
26+
27+
//[assembly: AssemblyDelaySign(false)]
28+
//[assembly: AssemblyKeyFile("")]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<enum-field-mappings>
3+
<!--
4+
This example converts the constants Fragment_id, Fragment_name,
5+
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
6+
to an enum called Android.Support.V4.App.FragmentTagType with values
7+
Id, Name, and Tag.
8+
9+
<mapping clr-enum-type="Android.Support.V4.App.FragmentTagType" jni-class="android/support/v4/app/FragmentActivity$FragmentTag">
10+
<field clr-name="Id" jni-name="Fragment_id" value="1" />
11+
<field clr-name="Name" jni-name="Fragment_name" value="0" />
12+
<field clr-name="Tag" jni-name="Fragment_tag" value="2" />
13+
</type>
14+
15+
Notes:
16+
- An optional "bitfield" attribute marks the enum type with [Flags].
17+
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
18+
-->
19+
</enum-field-mappings>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<enum-method-mappings>
3+
<!--
4+
This example changes the Java method:
5+
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
6+
to be:
7+
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
8+
when bound in C#.
9+
10+
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
11+
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
12+
</mapping>
13+
14+
Notes:
15+
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
16+
- To change the type of the return value, use "return" as the parameter name.
17+
- The parameter names will be p0, p1, ... unless you provide JavaDoc file in the project.
18+
-->
19+
</enum-method-mappings>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metadata>
3+
<!--
4+
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
5+
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
6+
7+
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
8+
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
9+
-->
10+
</metadata>

0 commit comments

Comments
 (0)