Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[Crittercism] Added a binding project, CI script and sample skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto committed Nov 11, 2013
1 parent bd71d19 commit 3c39d3b
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 15 deletions.
17 changes: 11 additions & 6 deletions Crittercism/binding/ApiDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using System;
using System.Drawing;
using MonoTouch.ObjCRuntime;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace CrittercismIos
namespace CrittercismSdk
{
[BaseType (typeof (NSObject))]
public partial interface CRFilter {
Expand Down Expand Up @@ -35,16 +38,16 @@ public partial interface Crittercism {
void EnableWithAppId (string appId);

[Static, Export ("enableWithAppID:andDelegate:")]
void EnableWithAppId (string appId, CrittercismDelegate critterDelegate);
void EnableWithAppId (string appId, ICrittercismDelegate critterDelegate);

[Static, Export ("enableWithAppID:andDelegate:andURLFilters:")]
void EnableWithAppId (string appId, CrittercismDelegate critterDelegate, CRFilter[] filters);
void EnableWithAppId (string appId, ICrittercismDelegate critterDelegate, CRFilter[] filters);

[Static, Export ("enableWithAppID:andURLFilters:")]
void EnableWithAppId (string appId, CRFilter[] filters);

[Static, Export ("enableWithAppID:andDelegate:andURLFilters:disableInstrumentation:")]
void EnableWithAppId (string appId, CrittercismDelegate critterDelegate, CRFilter[] filters, bool disableInstrumentation);
void EnableWithAppId (string appId, ICrittercismDelegate critterDelegate, CRFilter[] filters, bool disableInstrumentation);

[Static, Export ("addFilter:")]
void AddFilter (CRFilter filter);
Expand Down Expand Up @@ -73,13 +76,15 @@ public partial interface Crittercism {
[Static, Export ("setValue:forKey:")]
void SetValue (string value, string key);

[Export ("delegate")]
CrittercismDelegate Delegate { get; set; }
[Export ("delegate")][NullAllowed]
ICrittercismDelegate Delegate { get; set; }

[Export ("didCrashOnLastLoad")]
bool DidCrashOnLastLoad { get; }
}

public interface ICrittercismDelegate { }

[Protocol, Model, BaseType (typeof (NSObject))]
public partial interface CrittercismDelegate {

Expand Down
57 changes: 57 additions & 0 deletions Crittercism/binding/CrittercismSdk.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?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>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B2A6D1A0-8EA1-4FC0-AC4B-B09E46528DE7}</ProjectGuid>
<ProjectTypeGuids>{F5B4F3BC-B597-4E2B-B552-EF5D8A32436F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>CrittercismSdk</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>CrittercismSdk</AssemblyName>
</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>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="monotouch" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingCoreSource Include="StructsAndEnums.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Xamarin.ObjcBinding.CSharp.targets" />
<ItemGroup>
<ObjcBindingNativeLibrary Include="libCrittercism.a" />
</ItemGroup>
<ItemGroup>
<Compile Include="libCrittercism.linkwith.cs">
<DependentUpon>libCrittercism.a</DependentUpon>
</Compile>
</ItemGroup>
</Project>
25 changes: 16 additions & 9 deletions Crittercism/binding/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
BTOUCH=/Developer/MonoTouch/usr/bin/btouch

all: Crittercism.dll
MONOXBUILD=/Library/Frameworks/Mono.framework/Commands/xbuild
VERSION=4.1.2
all: CrittercismSdk.dll

libCrittercism.a:
@echo "You'll need to obtain a copy of libCrittercism.a"
@echo "from https://app.crittercism.com/downloads/ios"
@echo
@open https://app.crittercism.com/downloads/ios
exit 1
@if test -f ../../../monotouch-bindings-externals/Crittercism/libCrittercism.a; then \
cp ../../../monotouch-bindings-externals/Crittercism/libCrittercism.a .; \
else \
echo "Please download libCrittercism.a from https://app.crittercism.com/downloads/ios"; \
open https://app.crittercism.com/downloads/ios; \
exit 1; \
fi

CrittercismSdk.dll: Makefile libCrittercism.linkwith.cs ApiDefinition.cs libCrittercism.a
$(MONOXBUILD) /p:Configuration=Release CrittercismSdk.csproj
cp bin/Release/CrittercismSdk.dll CrittercismSdk.dll

Crittercism.dll: Makefile Crittercism.linkwith.cs ApiDefinition.cs libCrittercism.a
$(BTOUCH) ApiDefinition.cs Crittercism.linkwith.cs --out=$@ --link-with=libCrittercism.a,libCrittercism.a
clean:
-rm -rf *.a *.dll bin/ obj/
6 changes: 6 additions & 0 deletions Crittercism/binding/StructsAndEnums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System;

namespace CrittercismSdk
{
}

12 changes: 12 additions & 0 deletions Crittercism/samples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#### Sample Builder
#### Author: Alex Soto [email protected]

MDTOOL=/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool

#If you hapen to add a sample please add it here so it is easier to test if it builds

all:
#$(MDTOOL) build -c:"Release|iPhone" Sample/Sample.sln

clean:
#$(MDTOOL) build -c:"Release|iPhone" -t:Clean Sample/Sample.sln
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cocos2d\
cocosDenshion\
CorePlot\
Couchbase\
Crittercism\
Datatrans\
DropboxChooser\
DropBoxSync\
Expand Down

0 comments on commit 3c39d3b

Please sign in to comment.