From 3c39d3bea3a306e241727ae0662cd96b2f9ac4f0 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Mon, 11 Nov 2013 15:57:55 -0600 Subject: [PATCH] [Crittercism] Added a binding project, CI script and sample skeleton --- Crittercism/binding/ApiDefinition.cs | 17 ++++-- Crittercism/binding/CrittercismSdk.csproj | 57 +++++++++++++++++++ Crittercism/binding/Makefile | 25 +++++--- Crittercism/binding/StructsAndEnums.cs | 6 ++ ...linkwith.cs => libCrittercism.linkwith.cs} | 0 Crittercism/samples/Makefile | 12 ++++ Makefile | 1 + 7 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 Crittercism/binding/CrittercismSdk.csproj create mode 100644 Crittercism/binding/StructsAndEnums.cs rename Crittercism/binding/{Crittercism.linkwith.cs => libCrittercism.linkwith.cs} (100%) create mode 100644 Crittercism/samples/Makefile diff --git a/Crittercism/binding/ApiDefinition.cs b/Crittercism/binding/ApiDefinition.cs index 324645bd..e2612190 100644 --- a/Crittercism/binding/ApiDefinition.cs +++ b/Crittercism/binding/ApiDefinition.cs @@ -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 { @@ -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); @@ -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 { diff --git a/Crittercism/binding/CrittercismSdk.csproj b/Crittercism/binding/CrittercismSdk.csproj new file mode 100644 index 00000000..61cda63f --- /dev/null +++ b/Crittercism/binding/CrittercismSdk.csproj @@ -0,0 +1,57 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {B2A6D1A0-8EA1-4FC0-AC4B-B09E46528DE7} + {F5B4F3BC-B597-4E2B-B552-EF5D8A32436F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + CrittercismSdk + Resources + CrittercismSdk + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + true + + + full + true + bin\Release + prompt + 4 + false + true + + + + + + + + + + + + + + + + + + + + + libCrittercism.a + + + \ No newline at end of file diff --git a/Crittercism/binding/Makefile b/Crittercism/binding/Makefile index dc260367..84eef8e1 100644 --- a/Crittercism/binding/Makefile +++ b/Crittercism/binding/Makefile @@ -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/ \ No newline at end of file diff --git a/Crittercism/binding/StructsAndEnums.cs b/Crittercism/binding/StructsAndEnums.cs new file mode 100644 index 00000000..54d3c8e4 --- /dev/null +++ b/Crittercism/binding/StructsAndEnums.cs @@ -0,0 +1,6 @@ +using System; + +namespace CrittercismSdk +{ +} + diff --git a/Crittercism/binding/Crittercism.linkwith.cs b/Crittercism/binding/libCrittercism.linkwith.cs similarity index 100% rename from Crittercism/binding/Crittercism.linkwith.cs rename to Crittercism/binding/libCrittercism.linkwith.cs diff --git a/Crittercism/samples/Makefile b/Crittercism/samples/Makefile new file mode 100644 index 00000000..c1b37c78 --- /dev/null +++ b/Crittercism/samples/Makefile @@ -0,0 +1,12 @@ +#### Sample Builder +#### Author: Alex Soto alex.soto@xamarin.com + +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 diff --git a/Makefile b/Makefile index e570b5b8..6b9cb29b 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,7 @@ cocos2d\ cocosDenshion\ CorePlot\ Couchbase\ +Crittercism\ Datatrans\ DropboxChooser\ DropBoxSync\