Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Uglješa Erceg authored and uerceg committed May 12, 2015
0 parents commit 298fe72
Show file tree
Hide file tree
Showing 51 changed files with 2,998 additions and 0 deletions.
184 changes: 184 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
## Xamarin stuff
Components
[Pp]ackages
*.userprefs
Resource.designer.cs

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
x64/
build/
bld/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml

# NuGet Packages Directory
packages/
## TODO: If the tool you use requires repositories.config uncomment the next line
#!packages/repositories.config

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
!packages/build/

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

*.userprefs

.DS_Store
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "AdjustBindingsAndroid/ext/sdk"]
path = AdjustBindingsAndroid/ext/sdk
url = git@github.com:adjust/android_sdk.git
[submodule "AdjustBindingsiOS/ext/sdk"]
path = AdjustBindingsiOS/ext/sdk
url = git@github.com:adjust/ios_sdk.git
48 changes: 48 additions & 0 deletions AdjustBindingsAndroid/Additions/AboutAdditions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Additions allow you to add arbitrary C# to the generated classes
before they are compiled. This can be helpful for providing convenience
methods or adding pure C# classes.

== Adding Methods to Generated Classes ==

Let's say the library being bound has a Rectangle class with a constructor
that takes an x and y position, and a width and length size. It will look like
this:

public partial class Rectangle
{
public Rectangle (int x, int y, int width, int height)
{
// JNI bindings
}
}

Imagine we want to add a constructor to this class that takes a Point and
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
with a partial class containing our new method:

public partial class Rectangle
{
public Rectangle (Point location, Size size) :
this (location.X, location.Y, size.Width, size.Height)
{
}
}

At compile time, the additions class will be added to the generated class
and the final assembly will a Rectangle class with both constructors.


== Adding C# Classes ==

Another thing that can be done is adding fully C# managed classes to the
generated library. In the above example, let's assume that there isn't a
Point class available in Java or our library. The one we create doesn't need
to interact with Java, so we'll create it like a normal class in C#.

By adding a Point.cs file with this class, it will end up in the binding library:

public class Point
{
public int X { get; set; }
public int Y { get; set; }
}
60 changes: 60 additions & 0 deletions AdjustBindingsAndroid/AdjustBindingsAndroid.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{9CCC4FFA-11F0-4A57-AA56-F48A60596151}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>AdjustBindingsAndroid</RootNamespace>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
<AssemblyName>AdjustBindingsAndroid</AssemblyName>
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
<ReleaseVersion>4.0.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="AdjustReferrerReceiver.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Additions\AboutAdditions.txt" />
<None Include="Jars\AboutJars.txt" />
</ItemGroup>
<ItemGroup>
<TransformFile Include="Transforms\EnumFields.xml" />
<TransformFile Include="Transforms\EnumMethods.xml" />
<TransformFile Include="Transforms\Metadata.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Xamarin.Android.Bindings.targets" />
<ItemGroup>
<EmbeddedJar Include="Jars\adjust-android.jar" />
</ItemGroup>
</Project>
17 changes: 17 additions & 0 deletions AdjustBindingsAndroid/AdjustReferrerReceiver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Android.App;
using Android.Content;

namespace AdjustBindingsAndroid
{
[BroadcastReceiver (Exported = true)]
[IntentFilter (new[]{"com.android.vending.INSTALL_REFERRER"})]
public class AdjustReferrerReceiver : BroadcastReceiver
{
private readonly Com.Adjust.Sdk.AdjustReferrerReceiver broadcastReceiver = new Com.Adjust.Sdk.AdjustReferrerReceiver();

public override void OnReceive (Context context, Intent intent)
{
broadcastReceiver.OnReceive (context, intent);
}
}
}
37 changes: 37 additions & 0 deletions AdjustBindingsAndroid/Jars/AboutJars.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This directory is for Android .jars.

There are 4 types of jars that are supported:

== Input Jar and Embedded Jar ==

This is the jar that bindings should be generated for.

For example, if you were binding the Google Maps library, this would
be Google's "maps.jar".

The difference between EmbeddedJar and InputJar is, EmbeddedJar is to be
embedded in the resulting dll as EmbeddedResource, while InputJar is not.
There are couple of reasons you wouldn't like to embed the target jar
in your dll (the ones that could be internally loaded by <uses-library>
feature e.g. maps.jar, or you cannot embed jars that are under some
proprietary license).

Set the build action for these jars in the properties page to "InputJar".


== Reference Jar and Embedded Reference Jar ==

These are jars that are referenced by the input jar. C# bindings will
not be created for these jars. These jars will be used to resolve
types used by the input jar.

NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
based on the Target Framework selected.

Set the build action for these jars in the properties page to "ReferenceJar".

"EmbeddedJar" works like "ReferenceJar", but like "EmbeddedJar", it is
embedded in your dll. But at application build time, they are not included
in the final apk, like ReferenceJar files.


Binary file added AdjustBindingsAndroid/Jars/adjust-android.jar
Binary file not shown.
28 changes: 28 additions & 0 deletions AdjustBindingsAndroid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle ("AdjustBindingsAndroid")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("adjust GmbH")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("adjust GmbH")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("1.0.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Loading

0 comments on commit 298fe72

Please sign in to comment.