Skip to content

Commit

Permalink
[GoogleAnalytics] use monoxbuild instead of btouch to compile binding.
Browse files Browse the repository at this point in the history
…fixes mono#139

Fixes issue when using mono 3 and not finding hardcoded path to other
mono version
  • Loading branch information
petemill committed May 20, 2013
1 parent b39d56d commit bb1bc1d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace GoogleAnalytics {

[BaseType (typeof (NSObject))]
interface GAI {
public interface GAI {
[Internal]
[Export ("defaultTracker")]
IntPtr InternalDefaultTracker { get; set; }
Expand Down Expand Up @@ -43,7 +43,7 @@ interface GAI {
}

[BaseType (typeof (NSObject))]
interface GAITracker {
public interface GAITracker {
[Export ("trackingId")]
string TrackingId { get; }

Expand Down Expand Up @@ -130,7 +130,7 @@ interface GAITracker {

}
[BaseType (typeof (NSObject))]
interface GAITransaction {
public interface GAITransaction {
[Export ("transactionId")]
string TransactionId { get; }

Expand Down Expand Up @@ -161,7 +161,7 @@ interface GAITransaction {

}
[BaseType (typeof (NSObject))]
interface GAITransactionItem {
public interface GAITransactionItem {
[Export ("productCode")]
string ProductCode { get; }

Expand Down
54 changes: 54 additions & 0 deletions GoogleAnalytics/binding/GoogleAnalytics.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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>{4201B359-04C6-4508-A6BB-8ADBD96B0299}</ProjectGuid>
<ProjectTypeGuids>{F5B4F3BC-B597-4E2B-B552-EF5D8A32436F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>MonoTouch.GoogleAnalytics</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>MonoTouch.GoogleAnalytics</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>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<ConsolePause>False</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="monotouch" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Xamarin.ObjcBinding.CSharp.targets" />
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="enums.cs" />
<Compile Include="extras.cs" />
<Compile Include="libGoogleAnalytics.linkwith.cs">
<DependentUpon>libGoogleAnalytics.a</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingNativeLibrary Include="libGoogleAnalytics.a" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions GoogleAnalytics/binding/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ libGoogleAnalytics.a: GoogleAnalyticsiOS.zip

GoogleAnalytics.dll: Makefile AssemblyInfo.cs googleanalytics.cs enums.cs extras.cs libGoogleAnalytics.a
-mkdir -p ios
$(BTOUCH) --out=$@ -e googleanalytics.cs enums.cs --sourceonly=list --tmpdir=ios
$(SMCS) $(BUILD_FLAGS) -out:$@ @list enums.cs extras.cs AssemblyInfo.cs -r:monotouch.dll -res:libGoogleAnalytics.a,libGoogleAnalytics.a

$(MONOXBUILD) /p:Configuration=Release Googleanalytics.csproj
cp bin/Release/GoogleAnalytics.dll GoogleAnalytics.dll
clean:
-rm -rf list ios *.a *.dll *.o
4 changes: 4 additions & 0 deletions GoogleAnalytics/binding/libGoogleAnalytics.linkwith.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System;
using MonoTouch.ObjCRuntime;

[assembly: LinkWith ("libGoogleAnalytics.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator, ForceLoad = true)]

0 comments on commit bb1bc1d

Please sign in to comment.