Skip to content

Commit

Permalink
Merge pull request #389 from realm/ad/feature/PCL/#335
Browse files Browse the repository at this point in the history
Ad/feature/pcl/#335
  • Loading branch information
AndyDentFree committed Feb 12, 2016
2 parents 508eb15 + 3e0162c commit 5043014
Show file tree
Hide file tree
Showing 103 changed files with 10,062 additions and 76 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
0.72.0 Private Beta
-------------------
Still requires installation from private copy of NuGet download.

Uses Realm core 0.96.0

### Major Changes

* Added support for PCL so you can now use the NuGet in your PCL GUI or viewmodel libraries.

0.71.1 Private Beta
-------------------
### Minor Fixes
Expand All @@ -9,6 +19,7 @@ Building IOS apps targeting the simulator sometimes got an error like:

This was fixed by removing a redundant simulator library included in NuGet


0.71.0 Private Beta
-------------------
Still requires installation from private copy of NuGet download.
Expand Down
6 changes: 4 additions & 2 deletions NuGet/NuGet.Library/Realm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
<language>en-US</language>
<tags>Realm</tags>
<dependencies>
<dependency id="RealmWeaver.Fody" version="0.71.0"/>
<dependency id="RealmWeaver.Fody" version="0.72.0"/>
</dependencies>
</metadata>
<files>
<!-- IOS files -->
<!-- PCL file -->
<file src="../../Realm.PCL/bin/Release/Realm.dll" target="lib\portable-net45+sl5+wp8+wpa81+win8+monoandroid+Xamarin.iOS10+monotouch+Xamarin.Mac" />
<!-- IOS file -->
<file src="../../Realm.XamarinIOS/bin/iPhone/Release/Realm.dll" target="lib\Xamarin.iOS10" />
<!-- Android files -->
<file src="Realm.targets" target="build\MonoAndroid44" />
Expand Down
12 changes: 6 additions & 6 deletions NuGet/NuGet.Library/Realm.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<AndroidNativeLibrary Include="../packages/Realm.0.71.1/lib/MonoAndroid44/armeabi/libwrappers.so">
<Link>../packages/Realm.0.71.1/lib/MonoAndroid44/armeabi/libwrappers.so</Link>
<AndroidNativeLibrary Include="../packages/Realm.0.72.0/lib/MonoAndroid44/armeabi/libwrappers.so">
<Link>../packages/Realm.0.72.0/lib/MonoAndroid44/armeabi/libwrappers.so</Link>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="../packages/Realm.0.71.1/lib/MonoAndroid44/armeabi-v7a/libwrappers.so">
<Link>../packages/Realm.0.71.1/lib/MonoAndroid44/armeabi-v7a/libwrappers.so</Link>
<AndroidNativeLibrary Include="../packages/Realm.0.72.0/lib/MonoAndroid44/armeabi-v7a/libwrappers.so">
<Link>../packages/Realm.0.72.0/lib/MonoAndroid44/armeabi-v7a/libwrappers.so</Link>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="../packages/Realm.0.71.1/lib/MonoAndroid44/x86/libwrappers.so">
<Link>../packages/Realm.0.71.1/lib/MonoAndroid44/x86/libwrappers.so</Link>
<AndroidNativeLibrary Include="../packages/Realm.0.72.0/lib/MonoAndroid44/x86/libwrappers.so">
<Link>../packages/Realm.0.72.0/lib/MonoAndroid44/x86/libwrappers.so</Link>
</AndroidNativeLibrary>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion NuGet/NuGet.Weaver/RealmWeaver.Fody.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.8">
<id>RealmWeaver.Fody</id>
<version>0.71.0</version>
<version>0.72.0</version>
<title>RealmWeaver.Fody</title>
<authors>Realm</authors>
<owners>Realm</owners>
Expand Down
27 changes: 27 additions & 0 deletions Realm.PCL/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;

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

[assembly: AssemblyTitle("Realm.PCL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("andydent")]
[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.*")]

// 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("")]

87 changes: 87 additions & 0 deletions Realm.PCL/Realm.PCL.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?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>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{261C8EB6-9508-4D6A-9BED-39A544AA2736}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Realms</RootNamespace>
<AssemblyName>Realm</AssemblyName>
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</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>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RealmPCLHelpers.cs" />
<Compile Include="TransactionPCL.cs" />
<Compile Include="RealmListPCL.cs" />
<Compile Include="RealmConfigurationPCL.cs" />
<Compile Include="RealmObjectPCL.cs" />
<Compile Include="RealmPCL.cs" />
<Compile Include="..\Realm.Shared\exceptions\RealmDecryptionFailedException.cs">
<Link>Exceptions\RealmDecryptionFailedException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmException.cs">
<Link>Exceptions\RealmException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmExceptionCodes.cs">
<Link>Exceptions\RealmExceptionCodes.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmFileAccessErrorException.cs">
<Link>Exceptions\RealmFileAccessErrorException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmFileExistsException.cs">
<Link>Exceptions\RealmFileExistsException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmFileNotFoundException.cs">
<Link>Exceptions\RealmFileNotFoundException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmInvalidDatabaseException.cs">
<Link>Exceptions\RealmInvalidDatabaseException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmMigrationNeededException.cs">
<Link>Exceptions\RealmMigrationNeededException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmObjectAlreadyManagedByRealmException.cs">
<Link>Exceptions\RealmObjectAlreadyManagedByRealmException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmObjectManagedByAnotherRealmException.cs">
<Link>Exceptions\RealmObjectManagedByAnotherRealmException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmOutOfMemoryException.cs">
<Link>Exceptions\RealmOutOfMemoryException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmOutsideTransactionException.cs">
<Link>Exceptions\RealmOutsideTransactionException.cs</Link>
</Compile>
<Compile Include="..\Realm.Shared\exceptions\RealmPermissionDeniedException.cs">
<Link>Exceptions\RealmPermissionDeniedException.cs</Link>
</Compile>
<Compile Include="RealmQueryPCL.cs" />
<Compile Include="..\Realm.Shared\Attributes.cs">
<Link>Attributes.cs</Link>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<ItemGroup>
<Folder Include="Exceptions\" />
</ItemGroup>
</Project>
129 changes: 129 additions & 0 deletions Realm.PCL/RealmConfigurationPCL.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/* Copyright 2015 Realm Inc - All Rights Reserved
* Proprietary and Confidential
*/

/// PROXY VERSION OF CLASS USED IN PCL FOR BAIT AND SWITCH PATTERN

using System;
using System.IO;

// see internals/RealmConfigurations.md for a detailed diagram of how this interacts with the ObjectStore configuration

namespace Realms
{

/// <summary>
/// Realm configuration specifying settings that affect your Realm behaviour.
/// </summary>
/// <remarks>
/// Main role is generating a canonical path from whatever absolute, relative subdir or just filename user supplies.
/// </remarks>
public class RealmConfiguration
{
/// <summary>
/// Standard filename to be combined with the platform-specific document directory.
/// </summary>
/// <value>A string representing a filename only, no path.</value>
public static string DefaultRealmName => "default.realm";

/// <summary>
/// Constant used for SchemaVersion to indicate is not versioned.
/// </summary>
/// <remarks>
/// Must be maintained to match an internal ObjectStore::NotVersioned.
/// </remarks>
/// <value>Maximum value of UInt64.</value>
public static UInt64 NotVersioned => UInt64.MaxValue;

/// <summary>
/// Flag mainly to help with temp databases and testing, indicates content can be abandoned when you change the schema.
/// </summary>
public readonly bool ShouldDeleteIfMigrationNeeded;

/// <summary>
/// The full path of any realms opened with this configuration, may be overriden by passing in a separate name.
/// </summary>
public string DatabasePath {get; private set;}

/// <summary>
/// Utility to build a path in which a realm will be created so can consistently use filenames and relative paths.
/// </summary>
public static string PathToRealm(string optionalPath = null)
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
return "";
}

/// <summary>
/// Number indicating the version, can be used to arbitrarily distinguish between schemas even if they have the same objects and properties.
/// </summary>
/// <value>0-based value initially set to indicate user is not versioning.</value>
public UInt64 SchemaVersion { get; set;} = RealmConfiguration.NotVersioned;

/// <summary>
/// Configuration you can override which is used when you create a new Realm without specifying a configuration.
/// </summary>
public static RealmConfiguration DefaultConfiguration { set; get;} = new RealmConfiguration();

/// <summary>
/// Constructor allowing path override.
/// </summary>
/// <param name="optionalPath">Path to the realm, must be a valid full path for the current platform, relative subdir, or just filename.</param>
/// <param name="shouldDeleteIfMigrationNeeded">Optional Flag mainly to help with temp databases and testing, indicates content can be abandoned when you change the schema.</param>
public RealmConfiguration(string optionalPath = null, bool shouldDeleteIfMigrationNeeded=false)
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
}

/// <summary>
/// Clone method allowing you to override or customise the current path.
/// </summary>
/// <returns>An object with a fully-specified, canonical path.</returns>
/// <param name="newConfigPath">Path to the realm, must be a valid full path for the current platform, relative subdir, or just filename.</param>
public RealmConfiguration ConfigWithPath(string newConfigPath)
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
return null;
}

/// <summary>
/// Generic override determines whether the specified <see cref="System.Object"/> is equal to the current RealmConfiguration.
/// </summary>
/// <param name="rhs">The <see cref="System.Object"/> to compare with the current RealmConfiguration.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Realms.RealmConfiguration"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(Object rhs)
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
return false;
}



/// <summary>
/// Determines whether the specified RealmConfiguration is equal to the current RealmConfiguration.
/// </summary>
/// <param name="rhs">The <see cref="System.Object"/> to compare with the current RealmConfiguration.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Realms.RealmConfiguration"/>; otherwise, <c>false</c>.</returns>
public bool Equals(RealmConfiguration rhs)
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
return false;
}


/// <summary>
/// Serves as a hash function for a RealmConfiguration based on its path.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
RealmPCLHelpers.ThrowProxyShouldNeverBeUsed();
return 0;
}

} // class RealmConfiguration
} // namespace Realms

Loading

0 comments on commit 5043014

Please sign in to comment.