From ca73be1d7d860d5219e46ed25f07bfbb8ed8a00f Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Mon, 21 Sep 2015 02:33:42 +0200 Subject: [PATCH 1/9] Added project for Windows RT port --- .gitignore | 2 + src/ProtocolBuffers.Universal.sln | 22 +++ .../ProtocolBuffers.WinRT.PCL.csproj | 145 ++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 src/ProtocolBuffers.Universal.sln create mode 100644 src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj diff --git a/.gitignore b/.gitignore index 76c414f..6ef6663 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ src/ProtocolBuffers.Test/bin/ src/ProtocolBuffers.Test/obj/ src/ProtocolBuffersLite.Test/bin/ src/ProtocolBuffersLite.Test/obj/ +src/ProtocolBuffers.Serialization/bin/ +src/ProtocolBuffers.Serialization/obj/ src/ProtoBench/bin/ src/ProtoBench/obj/ src/ProtoDump/bin/ diff --git a/src/ProtocolBuffers.Universal.sln b/src/ProtocolBuffers.Universal.sln new file mode 100644 index 0000000..23ce6f0 --- /dev/null +++ b/src/ProtocolBuffers.Universal.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.WinRT.PCL", "ProtocolBuffers\ProtocolBuffers.WinRT.PCL.csproj", "{5636C607-A1D0-4890-A810-041320618795}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5636C607-A1D0-4890-A810-041320618795}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj b/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj new file mode 100644 index 0000000..5951385 --- /dev/null +++ b/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj @@ -0,0 +1,145 @@ + + + + + 12.0 + Debug + AnyCPU + {5636C607-A1D0-4890-A810-041320618795} + Library + Properties + Google.ProtocolBuffers + Google.ProtocolBuffers + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile32 + v4.6 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 47cd76f132ce88c8f8d9cbcfdb517b8615ac9bd7 Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Mon, 21 Sep 2015 02:40:53 +0200 Subject: [PATCH 2/9] Refactored changed access to reflection API Desktop .NET and Windows Runtime use completely different ways of accessing reflection information. --- .../Descriptors/FieldDescriptor.cs | 11 +++- .../Descriptors/FieldMappingAttribute.cs | 10 +++- src/ProtocolBuffers/EnumLite.cs | 10 +++- .../FieldAccess/ReflectionUtil.cs | 60 +++++++++++++++++-- .../FieldAccess/RepeatedMessageAccessor.cs | 9 +++ .../FieldAccess/RepeatedPrimitiveAccessor.cs | 22 ++++--- .../FieldAccess/SingleMessageAccessor.cs | 8 +++ .../FieldAccess/SinglePrimitiveAccessor.cs | 20 ++++--- src/ProtocolBuffers/GeneratedExtensionBase.cs | 4 ++ src/ProtocolBuffers/GeneratedMessageLite.cs | 2 +- src/ProtocolBuffers/MessageStreamIterator.cs | 6 +- src/ProtocolBuffers/MessageUtil.cs | 26 ++++++-- src/ProtocolBuffers/TextFormat.cs | 2 +- 13 files changed, 156 insertions(+), 34 deletions(-) diff --git a/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs index 6d17ae2..383c3a2 100644 --- a/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ b/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs @@ -31,6 +31,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; using Google.ProtocolBuffers.Collections; using Google.ProtocolBuffers.DescriptorProtos; @@ -441,11 +442,17 @@ public MessageDescriptor MessageType private static IDictionary MapFieldTypes() { var map = new Dictionary(); - foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) +#if WINDOWS_RUNTIME + var publicFields = typeof(FieldType).GetRuntimeFields().Where(x => x.IsStatic && x.IsPublic); +#else + var publicFields = typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public); +#endif + + foreach (FieldInfo field in publicFields) { FieldType fieldType = (FieldType) field.GetValue(null); FieldMappingAttribute mapping = - (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; + (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false).First(); map[fieldType] = mapping.MappedType; } return Dictionaries.AsReadOnly(map); diff --git a/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs b/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs index fc58d04..d7d4f95 100644 --- a/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs +++ b/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs @@ -31,6 +31,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; using Google.ProtocolBuffers.Collections; @@ -63,11 +64,16 @@ public FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType private static IDictionary MapFieldTypes() { var map = new Dictionary(); - foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) +#if WINDOWS_RUNTIME + var publicFields = typeof(FieldType).GetRuntimeFields().Where(x => x.IsStatic && x.IsPublic); +#else + var publicFields = typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public); +#endif + foreach (FieldInfo field in publicFields) { FieldType fieldType = (FieldType) field.GetValue(null); FieldMappingAttribute mapping = - (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; + (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false).First(); map[fieldType] = mapping; } return Dictionaries.AsReadOnly(map); diff --git a/src/ProtocolBuffers/EnumLite.cs b/src/ProtocolBuffers/EnumLite.cs index 1301ec2..483b4a5 100644 --- a/src/ProtocolBuffers/EnumLite.cs +++ b/src/ProtocolBuffers/EnumLite.cs @@ -36,6 +36,8 @@ using System; using System.Collections.Generic; +using System.Linq; +using System.Reflection; namespace Google.ProtocolBuffers { @@ -134,8 +136,14 @@ static EnumParser() // It will actually be a T[], but the CLR will let us convert. array = (int[])Enum.GetValues(typeof(T)); #else + +# if WINDOWS_RUNTIME + var publicFields = typeof(T).GetRuntimeFields().Where(x => x.IsStatic && x.IsPublic); +# else + var publicFields = typeof(T).GetFields(BindingFlags.Public | BindingFlags.Static) +# endif var temp = new List(); - foreach (var fld in typeof (T).GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static)) + foreach (var fld in publicFields) { if (fld.IsLiteral && fld.FieldType == typeof(T)) { diff --git a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs index 798f0dd..916857a 100644 --- a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs +++ b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs @@ -56,7 +56,11 @@ internal static class ReflectionUtil public static Func CreateUpcastDelegate(MethodInfo method) { // The tricky bit is invoking CreateCreateUpcastDelegateImpl with the right type parameters +#if WINDOWS_RUNTIME + MethodInfo openImpl = typeof(ReflectionUtil).GetRuntimeMethod("CreateUpcastDelegateImpl", new[] { typeof(MethodInfo) }); +#else MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateUpcastDelegateImpl"); +#endif MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.ReturnType); return (Func) closedImpl.Invoke(null, new object[] {method}); } @@ -81,7 +85,11 @@ public static Func CreateUpcastDelegateImpl(M /// public static Action CreateDowncastDelegate(MethodInfo method) { +#if WINDOWS_RUNTIME + MethodInfo openImpl = typeof(ReflectionUtil).GetRuntimeMethod("CreateDowncastDelegateImpl", new[] { typeof(MethodInfo) }); +#else MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateDowncastDelegateImpl"); +#endif MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.GetParameters()[0].ParameterType); return (Action) closedImpl.Invoke(null, new object[] {method}); } @@ -101,7 +109,11 @@ public static Action CreateDowncastDelegateImpl public static Action CreateDowncastDelegateIgnoringReturn(MethodInfo method) { +#if WINDOWS_RUNTIME + MethodInfo openImpl = typeof(ReflectionUtil).GetRuntimeMethod("CreateDowncastDelegateIgnoringReturnImpl", new[] { typeof(MethodInfo) }); +#else MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateDowncastDelegateIgnoringReturnImpl"); +#endif MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.GetParameters()[0].ParameterType, method.ReturnType); return (Action) closedImpl.Invoke(null, new object[] {method}); @@ -122,7 +134,11 @@ public static Action CreateDowncastDelegateIgnoringReturnImpl public static Func CreateStaticUpcastDelegate(MethodInfo method) { +#if WINDOWS_RUNTIME + MethodInfo openImpl = typeof(ReflectionUtil).GetRuntimeMethod("CreateStaticUpcastDelegateImpl", new[] { typeof(MethodInfo) }); +#else MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateStaticUpcastDelegateImpl"); +#endif MethodInfo closedImpl = openImpl.MakeGenericMethod(method.ReturnType); return (Func) closedImpl.Invoke(null, new object[] {method}); } @@ -136,7 +152,9 @@ public static Func CreateStaticUpcastDelegateImpl(MethodInfo method internal static Func CreateDelegateFunc(MethodInfo method) { -#if !CF20 +#if WINDOWS_RUNTIME + return (Func) method.CreateDelegate(typeof(Func), null); +#elif !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); return (Func)tdelegate; #else @@ -146,7 +164,9 @@ internal static Func CreateDelegateFunc(MethodInfo method) internal static Func CreateDelegateFunc(MethodInfo method) { -#if !CF20 +#if WINDOWS_RUNTIME + return (Func) method.CreateDelegate(typeof(Func), null); +#elif !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); return (Func)tdelegate; #else @@ -160,7 +180,9 @@ internal static Func CreateDelegateFunc(MethodInfo metho internal static Func CreateDelegateFunc(MethodInfo method) { -#if !CF20 +#if WINDOWS_RUNTIME + return (Func) method.CreateDelegate(typeof(Func), null); +#elif !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); return (Func)tdelegate; #else @@ -174,7 +196,9 @@ internal static Func CreateDelegateFunc(Method internal static Action CreateDelegateAction(MethodInfo method) { -#if !CF20 +#if WINDOWS_RUNTIME + return (Action) method.CreateDelegate(typeof(Action), null); +#elif !CF20 object tdelegate = Delegate.CreateDelegate(typeof(Action), null, method); return (Action)tdelegate; #else @@ -185,5 +209,33 @@ internal static Action CreateDelegateAction(MethodInfo method) return delegate(T1 arg1, T2 arg2) { method.Invoke(arg1, new object[] { arg2 }); }; #endif } + + internal static PropertyInfo GetProperty(string name) + { +#if WINDOWS_RUNTIME + return typeof(T).GetRuntimeProperty(name); +#else + return typeof(T).GetProperty(name); +#endif + } + + internal static MethodInfo GetMethod(string name, Type[] types) + { +#if WINDOWS_RUNTIME + return typeof(T).GetRuntimeMethod(name, types); +#else + return typeof(T).GetMethod(name, types); +#endif + } + + internal static MethodInfo GetMethod(string name) + { +#if WINDOWS_RUNTIME + return typeof(T).GetRuntimeMethod(name, EmptyTypes); +#else + return typeof(T).GetMethod(name, EmptyTypes); +#endif + } + } } \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs b/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs index fd18b90..be40feb 100644 --- a/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs +++ b/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs @@ -53,7 +53,12 @@ internal sealed class RepeatedMessageAccessor : RepeatedPrim internal RepeatedMessageAccessor(string name) : base(name) { +#if WINDOWS_RUNTIME + MethodInfo createBuilderMethod = ClrType.GetRuntimeMethod("CreateBuilder", EmptyTypes); +#else MethodInfo createBuilderMethod = ClrType.GetMethod("CreateBuilder", EmptyTypes); +#endif + if (createBuilderMethod == null) { throw new ArgumentException("No public static CreateBuilder method declared in " + ClrType.Name); @@ -69,7 +74,11 @@ private object CoerceType(object value) { ThrowHelper.ThrowIfNull(value, "value"); // If it's already of the right type, we're done +#if WINDOWS_RUNTIME + if (ClrType.GetTypeInfo().IsSubclassOf(value.GetType())) +#else if (ClrType.IsInstanceOfType(value)) +#endif { return value; } diff --git a/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs b/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs index d3b926b..6783768 100644 --- a/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs +++ b/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs @@ -66,14 +66,14 @@ protected Type ClrType internal RepeatedPrimitiveAccessor(string name) { - PropertyInfo messageProperty = typeof(TMessage).GetProperty(name + "List"); - PropertyInfo builderProperty = typeof(TBuilder).GetProperty(name + "List"); - PropertyInfo countProperty = typeof(TMessage).GetProperty(name + "Count"); - MethodInfo clearMethod = typeof(TBuilder).GetMethod("Clear" + name, EmptyTypes); - getElementMethod = typeof(TMessage).GetMethod("Get" + name, new Type[] {typeof(int)}); + PropertyInfo messageProperty = ReflectionUtil.GetProperty(name + "List"); + PropertyInfo builderProperty = ReflectionUtil.GetProperty(name + "List"); + PropertyInfo countProperty = ReflectionUtil.GetProperty(name + "Count"); + MethodInfo clearMethod = ReflectionUtil.GetMethod("Clear" + name); + getElementMethod = ReflectionUtil.GetMethod("Get" + name, new Type[] {typeof(int)}); clrType = getElementMethod.ReturnType; - MethodInfo addMethod = typeof(TBuilder).GetMethod("Add" + name, new Type[] {ClrType}); - setElementMethod = typeof(TBuilder).GetMethod("Set" + name, new Type[] {typeof(int), ClrType}); + MethodInfo addMethod = ReflectionUtil.GetMethod("Add" + name, new Type[] {ClrType}); + setElementMethod = ReflectionUtil.GetMethod("Set" + name, new Type[] {typeof(int), ClrType}); if (messageProperty == null || builderProperty == null || countProperty == null @@ -85,10 +85,16 @@ internal RepeatedPrimitiveAccessor(string name) throw new ArgumentException("Not all required properties/methods available"); } clearDelegate = ReflectionUtil.CreateDelegateFunc(clearMethod); + addValueDelegate = ReflectionUtil.CreateDowncastDelegateIgnoringReturn(addMethod); +#if WINDOWS_RUNTIME + countDelegate = ReflectionUtil.CreateDelegateFunc(countProperty.GetMethod); + getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetMethod); + getRepeatedWrapperDelegate = ReflectionUtil.CreateUpcastDelegate(builderProperty.GetMethod); +#else countDelegate = ReflectionUtil.CreateDelegateFunc(countProperty.GetGetMethod()); getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetGetMethod()); - addValueDelegate = ReflectionUtil.CreateDowncastDelegateIgnoringReturn(addMethod); getRepeatedWrapperDelegate = ReflectionUtil.CreateUpcastDelegate(builderProperty.GetGetMethod()); +#endif } public bool Has(TMessage message) diff --git a/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs b/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs index 6bf48a0..6828b43 100644 --- a/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs +++ b/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs @@ -50,7 +50,11 @@ internal sealed class SingleMessageAccessor : SinglePrimitiv internal SingleMessageAccessor(string name) : base(name) { +#if WINDOWS_RUNTIME + MethodInfo createBuilderMethod = ClrType.GetRuntimeMethod("CreateBuilder", ReflectionUtil.EmptyTypes); +#else MethodInfo createBuilderMethod = ClrType.GetMethod("CreateBuilder", ReflectionUtil.EmptyTypes); +#endif if (createBuilderMethod == null) { throw new ArgumentException("No public static CreateBuilder method declared in " + ClrType.Name); @@ -66,7 +70,11 @@ private object CoerceType(object value) { ThrowHelper.ThrowIfNull(value, "value"); // If it's already of the right type, we're done +#if WINDOWS_RUNTIME + if (ClrType.GetTypeInfo().IsSubclassOf(value.GetType())) +#else if (ClrType.IsInstanceOfType(value)) +#endif { return value; } diff --git a/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs b/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs index e5a0754..58cbd62 100644 --- a/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs +++ b/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs @@ -58,19 +58,25 @@ protected Type ClrType internal SinglePrimitiveAccessor(string name) { - PropertyInfo messageProperty = typeof(TMessage).GetProperty(name, null, ReflectionUtil.EmptyTypes); - PropertyInfo builderProperty = typeof(TBuilder).GetProperty(name, null, ReflectionUtil.EmptyTypes); - PropertyInfo hasProperty = typeof(TMessage).GetProperty("Has" + name); - MethodInfo clearMethod = typeof(TBuilder).GetMethod("Clear" + name); + PropertyInfo messageProperty = ReflectionUtil.GetProperty(name); + PropertyInfo builderProperty = ReflectionUtil.GetProperty(name); + PropertyInfo hasProperty = ReflectionUtil.GetProperty("Has" + name); + MethodInfo clearMethod = ReflectionUtil.GetMethod("Clear" + name, ReflectionUtil.EmptyTypes); if (messageProperty == null || builderProperty == null || hasProperty == null || clearMethod == null) { throw new ArgumentException("Not all required properties/methods available"); } clrType = messageProperty.PropertyType; - hasDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetGetMethod()); clearDelegate = ReflectionUtil.CreateDelegateFunc(clearMethod); +#if WINDOWS_RUNTIME + hasDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetMethod); + getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetMethod); + setValueDelegate = ReflectionUtil.CreateDowncastDelegate(builderProperty.SetMethod); +#else + hasDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetGetMethod()); getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetGetMethod()); setValueDelegate = ReflectionUtil.CreateDowncastDelegate(builderProperty.GetSetMethod()); +#endif } public bool Has(TMessage message) @@ -101,7 +107,7 @@ public virtual void SetValue(TBuilder builder, object value) setValueDelegate(builder, value); } - #region Methods only related to repeated values +#region Methods only related to repeated values public int GetRepeatedCount(TMessage message) { @@ -128,6 +134,6 @@ public object GetRepeatedWrapper(TBuilder builder) throw new InvalidOperationException(); } - #endregion +#endregion } } \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedExtensionBase.cs b/src/ProtocolBuffers/GeneratedExtensionBase.cs index 424b981..879bd02 100644 --- a/src/ProtocolBuffers/GeneratedExtensionBase.cs +++ b/src/ProtocolBuffers/GeneratedExtensionBase.cs @@ -80,8 +80,12 @@ protected GeneratedExtensionBase(FieldDescriptor descriptor, Type singularExtens this.descriptor = descriptor; if (descriptor.MappedType == MappedType.Message) { +#if WINDOWS_RUNTIME + PropertyInfo defaultInstanceProperty = singularExtensionType.GetRuntimeProperty("DefaultInstance"); +#else PropertyInfo defaultInstanceProperty = singularExtensionType .GetProperty("DefaultInstance", BindingFlags.Static | BindingFlags.Public); +#endif if (defaultInstanceProperty == null) { throw new ArgumentException("No public static DefaultInstance property for type " + diff --git a/src/ProtocolBuffers/GeneratedMessageLite.cs b/src/ProtocolBuffers/GeneratedMessageLite.cs index 0dfc976..9c4d09b 100644 --- a/src/ProtocolBuffers/GeneratedMessageLite.cs +++ b/src/ProtocolBuffers/GeneratedMessageLite.cs @@ -111,7 +111,7 @@ protected static void PrintField(string name, bool hasValue, object value, TextW } else { - writer.WriteLine("{0}: {1}", name, ((IConvertible)value).ToString(FrameworkPortability.InvariantCulture)); + writer.WriteLine("{0}: {1}", name, ((IFormattable)value).ToString(null, FrameworkPortability.InvariantCulture)); } } diff --git a/src/ProtocolBuffers/MessageStreamIterator.cs b/src/ProtocolBuffers/MessageStreamIterator.cs index 32d697c..a3f034d 100644 --- a/src/ProtocolBuffers/MessageStreamIterator.cs +++ b/src/ProtocolBuffers/MessageStreamIterator.cs @@ -38,6 +38,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; +using System.Reflection; +using Google.ProtocolBuffers.FieldAccess; namespace Google.ProtocolBuffers { @@ -76,9 +78,7 @@ private static TMessage CreateDefaultInstance() { try { - return (TMessage)typeof(TMessage) - .GetProperty("DefaultInstance", typeof(TMessage), new Type[0]) - .GetValue(null, null); + return (TMessage) ReflectionUtil.GetProperty("DefaultInstance").GetValue(null, null); } catch (Exception e) { diff --git a/src/ProtocolBuffers/MessageUtil.cs b/src/ProtocolBuffers/MessageUtil.cs index d120d20..6cc8533 100644 --- a/src/ProtocolBuffers/MessageUtil.cs +++ b/src/ProtocolBuffers/MessageUtil.cs @@ -53,25 +53,41 @@ public static class MessageUtil /// The type parameter is null. /// The type doesn't implement IMessage, or doesn't /// have a static DefaultMessage property of the same type, or is generic or abstract. - /// public static IMessage GetDefaultMessage(Type type) { if (type == null) { throw new ArgumentNullException("type", "No type specified."); } + +#if WINDOWS_RUNTIME + var typeInfo = type.GetTypeInfo(); + + if (typeInfo.IsAbstract || typeInfo.IsGenericTypeDefinition) + { + throw new ArgumentException("Unable to get a default message for an abstract or generic type (" + type.FullName + ")"); + } + if (!typeof(IMessage).GetTypeInfo().IsAssignableFrom(typeInfo)) + { + throw new ArgumentException("Unable to get a default message for non-message type (" + type.FullName + ")"); + } +#else if (type.IsAbstract || type.IsGenericTypeDefinition) { - throw new ArgumentException("Unable to get a default message for an abstract or generic type (" + - type.FullName + ")"); + throw new ArgumentException("Unable to get a default message for an abstract or generic type (" + type.FullName + ")"); } if (!typeof(IMessage).IsAssignableFrom(type)) { - throw new ArgumentException("Unable to get a default message for non-message type (" + type.FullName + - ")"); + throw new ArgumentException("Unable to get a default message for non-message type (" + type.FullName + ")"); } +#endif + +#if WINDOWS_RUNTIME + PropertyInfo property = type.GetRuntimeProperty("DefaultInstance"); +#else PropertyInfo property = type.GetProperty("DefaultInstance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); +#endif if (property == null) { throw new ArgumentException(type.FullName + " doesn't have a static DefaultInstance property"); diff --git a/src/ProtocolBuffers/TextFormat.cs b/src/ProtocolBuffers/TextFormat.cs index 747dce4..fbc0529 100644 --- a/src/ProtocolBuffers/TextFormat.cs +++ b/src/ProtocolBuffers/TextFormat.cs @@ -214,7 +214,7 @@ private static void PrintFieldValue(FieldDescriptor field, object value, TextGen case FieldType.Fixed64: // The simple Object.ToString converts using the current culture. // We want to always use the invariant culture so it's predictable. - generator.Print(((IConvertible)value).ToString(FrameworkPortability.InvariantCulture)); + generator.Print(((IFormattable)value).ToString(null, FrameworkPortability.InvariantCulture)); break; case FieldType.Bool: // Explicitly use the Java true/false From 8245e8af90753b298acd5d6ba92badd294a035d6 Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Mon, 21 Sep 2015 03:06:17 +0200 Subject: [PATCH 3/9] Created WinRT project for PB Serialization --- ...ocolBuffers.Serialization.WinRT.PCL.csproj | 79 +++++++++++++++++++ src/ProtocolBuffers.Universal.sln | 36 +++++++++ 2 files changed, 115 insertions(+) create mode 100644 src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj new file mode 100644 index 0000000..7989a8c --- /dev/null +++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj @@ -0,0 +1,79 @@ + + + + + 12.0 + Debug + AnyCPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA} + Library + Properties + Google.ProtocolBuffers.Serialization + Google.ProtocolBuffers.Serialization + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile32 + v4.6 + + + true + full + false + bin\Debug\ + TRACE;DEBUG;WINDOWS_RUNTIME + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE;WINDOWS_RUNTIME + prompt + 4 + + + + + {5636c607-a1d0-4890-a810-041320618795} + ProtocolBuffers.WinRT.PCL + + + + + + + + + FrameworkPortability.cs + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers.Universal.sln b/src/ProtocolBuffers.Universal.sln index 23ce6f0..269bb04 100644 --- a/src/ProtocolBuffers.Universal.sln +++ b/src/ProtocolBuffers.Universal.sln @@ -5,16 +5,52 @@ VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.WinRT.PCL", "ProtocolBuffers\ProtocolBuffers.WinRT.PCL.csproj", "{5636C607-A1D0-4890-A810-041320618795}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization.WinRT.PCL", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.WinRT.PCL.csproj", "{B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5636C607-A1D0-4890-A810-041320618795}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5636C607-A1D0-4890-A810-041320618795}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|ARM.ActiveCfg = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|ARM.Build.0 = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|x64.ActiveCfg = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|x64.Build.0 = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|x86.ActiveCfg = Debug|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Debug|x86.Build.0 = Debug|Any CPU {5636C607-A1D0-4890-A810-041320618795}.Release|Any CPU.ActiveCfg = Release|Any CPU {5636C607-A1D0-4890-A810-041320618795}.Release|Any CPU.Build.0 = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|ARM.ActiveCfg = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|ARM.Build.0 = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|x64.ActiveCfg = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|x64.Build.0 = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|x86.ActiveCfg = Release|Any CPU + {5636C607-A1D0-4890-A810-041320618795}.Release|x86.Build.0 = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|ARM.ActiveCfg = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|ARM.Build.0 = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|x64.ActiveCfg = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|x64.Build.0 = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|x86.ActiveCfg = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Debug|x86.Build.0 = Debug|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|Any CPU.Build.0 = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|ARM.ActiveCfg = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|ARM.Build.0 = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x64.ActiveCfg = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x64.Build.0 = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x86.ActiveCfg = Release|Any CPU + {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From ce3e89bb3880f5a70e71b2d0f99d11c31499378a Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Mon, 21 Sep 2015 03:06:58 +0200 Subject: [PATCH 4/9] Fixed missing IConvertible API usage --- src/ProtocolBuffers.Serialization/DictionaryReader.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ProtocolBuffers.Serialization/DictionaryReader.cs b/src/ProtocolBuffers.Serialization/DictionaryReader.cs index c460523..1f2a68c 100644 --- a/src/ProtocolBuffers.Serialization/DictionaryReader.cs +++ b/src/ProtocolBuffers.Serialization/DictionaryReader.cs @@ -80,14 +80,7 @@ private bool GetValue(ref T value) { try { - if (obj is IConvertible) - { - value = (T)Convert.ChangeType(obj, typeof(T), FrameworkPortability.InvariantCulture); - } - else - { - value = (T) obj; - } + value = (T) Convert.ChangeType(obj, typeof(T), FrameworkPortability.InvariantCulture); } catch { From c8fe45845276b7395f648164b4faf044b32f3850 Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Mon, 21 Sep 2015 12:57:39 +0200 Subject: [PATCH 5/9] Fixed missing IConvertible in WinRT --- src/ProtocolBuffers.Serialization/AbstractWriter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ProtocolBuffers.Serialization/AbstractWriter.cs b/src/ProtocolBuffers.Serialization/AbstractWriter.cs index 2dc6b88..1176b38 100644 --- a/src/ProtocolBuffers.Serialization/AbstractWriter.cs +++ b/src/ProtocolBuffers.Serialization/AbstractWriter.cs @@ -155,10 +155,10 @@ protected virtual void WriteField(FieldType fieldType, string field, object valu { WriteEnum(field, ((IEnumLite) value).Number, ((IEnumLite) value).Name); } - else if (value is IConvertible) + else if (value is ValueType) { - WriteEnum(field, ((IConvertible)value).ToInt32(FrameworkPortability.InvariantCulture), - ((IConvertible)value).ToString(FrameworkPortability.InvariantCulture)); + int intValue = Convert.ToInt32(value); + WriteEnum(field, Convert.ToInt32(value), intValue.ToString(FrameworkPortability.InvariantCulture)); } else { From d377ae0d117ff8bbf5217fcf9938cdceef960cfc Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Mon, 21 Sep 2015 12:58:02 +0200 Subject: [PATCH 6/9] Fixed missing SortedList in WinRT Replaced with SortedDictionary. --- src/ProtocolBuffers/FieldSet.cs | 8 ++++---- src/ProtocolBuffers/GeneratedMessage.cs | 2 +- src/ProtocolBuffers/UnknownFieldSet.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ProtocolBuffers/FieldSet.cs b/src/ProtocolBuffers/FieldSet.cs index f3c08cf..4177400 100644 --- a/src/ProtocolBuffers/FieldSet.cs +++ b/src/ProtocolBuffers/FieldSet.cs @@ -88,7 +88,7 @@ private FieldSet(IDictionary fields) public static FieldSet CreateInstance() { // Use SortedList to keep fields in the canonical order - return new FieldSet(new SortedList()); + return new FieldSet(new SortedDictionary()); } /// @@ -111,7 +111,7 @@ internal FieldSet MakeImmutable() if (hasRepeats) { - var tmp = new SortedList(); + var tmp = new SortedDictionary(); foreach (KeyValuePair entry in fields) { IList list = entry.Value as IList; @@ -151,8 +151,8 @@ internal IDictionary AllFieldDescriptors { get { - SortedList copy = - new SortedList(); + SortedDictionary copy = + new SortedDictionary(); foreach (KeyValuePair fd in fields) { copy.Add((FieldDescriptor) fd.Key, fd.Value); diff --git a/src/ProtocolBuffers/GeneratedMessage.cs b/src/ProtocolBuffers/GeneratedMessage.cs index 6f4b665..a758440 100644 --- a/src/ProtocolBuffers/GeneratedMessage.cs +++ b/src/ProtocolBuffers/GeneratedMessage.cs @@ -76,7 +76,7 @@ public override MessageDescriptor DescriptorForType internal IDictionary GetMutableFieldMap() { // Use a SortedList so we'll end up serializing fields in order - var ret = new SortedList(); + var ret = new SortedDictionary(); MessageDescriptor descriptor = DescriptorForType; foreach (FieldDescriptor field in descriptor.Fields) { diff --git a/src/ProtocolBuffers/UnknownFieldSet.cs b/src/ProtocolBuffers/UnknownFieldSet.cs index 09ed680..982fa41 100644 --- a/src/ProtocolBuffers/UnknownFieldSet.cs +++ b/src/ProtocolBuffers/UnknownFieldSet.cs @@ -330,12 +330,12 @@ public sealed partial class Builder : IBuilderLite internal Builder() { - fields = new SortedList(); + fields = new SortedDictionary(); } internal Builder(IDictionary dictionary) { - fields = new SortedList(dictionary); + fields = new SortedDictionary(dictionary); } /// From 48b0783d0274114788502625044c125341b3e61a Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Tue, 22 Sep 2015 01:20:32 +0200 Subject: [PATCH 7/9] Revert "Fixed missing SortedList in WinRT" This reverts commit d377ae0d117ff8bbf5217fcf9938cdceef960cfc. There is a SortedList implementation already inside the project. --- src/ProtocolBuffers/FieldSet.cs | 8 ++++---- src/ProtocolBuffers/GeneratedMessage.cs | 2 +- src/ProtocolBuffers/UnknownFieldSet.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ProtocolBuffers/FieldSet.cs b/src/ProtocolBuffers/FieldSet.cs index 4177400..f3c08cf 100644 --- a/src/ProtocolBuffers/FieldSet.cs +++ b/src/ProtocolBuffers/FieldSet.cs @@ -88,7 +88,7 @@ private FieldSet(IDictionary fields) public static FieldSet CreateInstance() { // Use SortedList to keep fields in the canonical order - return new FieldSet(new SortedDictionary()); + return new FieldSet(new SortedList()); } /// @@ -111,7 +111,7 @@ internal FieldSet MakeImmutable() if (hasRepeats) { - var tmp = new SortedDictionary(); + var tmp = new SortedList(); foreach (KeyValuePair entry in fields) { IList list = entry.Value as IList; @@ -151,8 +151,8 @@ internal IDictionary AllFieldDescriptors { get { - SortedDictionary copy = - new SortedDictionary(); + SortedList copy = + new SortedList(); foreach (KeyValuePair fd in fields) { copy.Add((FieldDescriptor) fd.Key, fd.Value); diff --git a/src/ProtocolBuffers/GeneratedMessage.cs b/src/ProtocolBuffers/GeneratedMessage.cs index a758440..6f4b665 100644 --- a/src/ProtocolBuffers/GeneratedMessage.cs +++ b/src/ProtocolBuffers/GeneratedMessage.cs @@ -76,7 +76,7 @@ public override MessageDescriptor DescriptorForType internal IDictionary GetMutableFieldMap() { // Use a SortedList so we'll end up serializing fields in order - var ret = new SortedDictionary(); + var ret = new SortedList(); MessageDescriptor descriptor = DescriptorForType; foreach (FieldDescriptor field in descriptor.Fields) { diff --git a/src/ProtocolBuffers/UnknownFieldSet.cs b/src/ProtocolBuffers/UnknownFieldSet.cs index 982fa41..09ed680 100644 --- a/src/ProtocolBuffers/UnknownFieldSet.cs +++ b/src/ProtocolBuffers/UnknownFieldSet.cs @@ -330,12 +330,12 @@ public sealed partial class Builder : IBuilderLite internal Builder() { - fields = new SortedDictionary(); + fields = new SortedList(); } internal Builder(IDictionary dictionary) { - fields = new SortedDictionary(dictionary); + fields = new SortedList(dictionary); } /// From 54e6e20dcb6853e6a8bc52b7cacee2555d45f5fd Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Tue, 22 Sep 2015 01:46:21 +0200 Subject: [PATCH 8/9] Updated outputs to match NuGet target platforms --- .../ProtocolBuffers.Serialization.WinRT.PCL.csproj | 5 +++-- src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj index 7989a8c..26090e0 100644 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj +++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.WinRT.PCL.csproj @@ -20,7 +20,7 @@ true full false - bin\Debug\ + bin\portable-win81+wpa81\Debug\ TRACE;DEBUG;WINDOWS_RUNTIME prompt 4 @@ -28,10 +28,11 @@ pdbonly true - bin\Release\ + bin\portable-win81+wpa81\Release\ TRACE;WINDOWS_RUNTIME prompt 4 + bin\portable-win81+wpa81\Release\Google.ProtocolBuffers.Serialization.xml diff --git a/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj b/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj index 5951385..2d7f339 100644 --- a/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj +++ b/src/ProtocolBuffers/ProtocolBuffers.WinRT.PCL.csproj @@ -20,18 +20,19 @@ true full false - bin\Debug\ - TRACE;DEBUG;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE + bin\portable-win81+wpa81\Debug\ + TRACE;DEBUG;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE;NOSORTEDLIST prompt 4 pdbonly true - bin\Release\ - TRACE;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE + bin\portable-win81+wpa81\Release\ + TRACE;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE;NOSORTEDLIST prompt 4 + bin\portable-win81+wpa81\Release\Google.ProtocolBuffers.xml From 9c8629271008f6103ce4a30d1f1fc60098f3e2a2 Mon Sep 17 00:00:00 2001 From: Pawel Hofman Date: Tue, 22 Sep 2015 01:57:54 +0200 Subject: [PATCH 9/9] Added 'Lite' versions of the ProtoBuf libraries --- ...BuffersLite.Serialization.WinRT.PCL.csproj | 80 ++++++++++++++++ src/ProtocolBuffers.Universal.sln | 36 ++++++++ .../ProtocolBuffersLite.WinRT.PCL.csproj | 92 +++++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.WinRT.PCL.csproj create mode 100644 src/ProtocolBuffers/ProtocolBuffersLite.WinRT.PCL.csproj diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.WinRT.PCL.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.WinRT.PCL.csproj new file mode 100644 index 0000000..bffa4a7 --- /dev/null +++ b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.WinRT.PCL.csproj @@ -0,0 +1,80 @@ + + + + + 12.0 + Debug + AnyCPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9} + Library + Properties + Google.ProtocolBuffersLite.Serialization + Google.ProtocolBuffersLite.Serialization + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile32 + v4.6 + + + true + full + false + bin\portable-win81+wpa81\Debug\ + TRACE;DEBUG;WINDOWS_RUNTIME;LITE + prompt + 4 + + + pdbonly + true + bin\portable-win81+wpa81\Release\ + TRACE;WINDOWS_RUNTIME;LITE + prompt + 4 + bin\portable-win81+wpa81\Release\Google.ProtocolBuffersLite.Serialization.xml + + + + + {82181c67-7b33-4286-a575-42b9a2815979} + ProtocolBuffersLite.WinRT.PCL + + + + + + + + + FrameworkPortability.cs + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers.Universal.sln b/src/ProtocolBuffers.Universal.sln index 269bb04..1638ec1 100644 --- a/src/ProtocolBuffers.Universal.sln +++ b/src/ProtocolBuffers.Universal.sln @@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.WinRT.PCL", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization.WinRT.PCL", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.WinRT.PCL.csproj", "{B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.WinRT.PCL", "ProtocolBuffers\ProtocolBuffersLite.WinRT.PCL.csproj", "{82181C67-7B33-4286-A575-42B9A2815979}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization.WinRT.PCL", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.WinRT.PCL.csproj", "{B492F9CC-F247-4F55-B91E-0359D07D21D9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,6 +55,38 @@ Global {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x64.Build.0 = Release|Any CPU {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x86.ActiveCfg = Release|Any CPU {B7924AAF-514E-40C0-A5A6-521E1D4A8ACA}.Release|x86.Build.0 = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|Any CPU.Build.0 = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|ARM.ActiveCfg = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|ARM.Build.0 = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|x64.ActiveCfg = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|x64.Build.0 = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|x86.ActiveCfg = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Debug|x86.Build.0 = Debug|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|Any CPU.ActiveCfg = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|Any CPU.Build.0 = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|ARM.ActiveCfg = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|ARM.Build.0 = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|x64.ActiveCfg = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|x64.Build.0 = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|x86.ActiveCfg = Release|Any CPU + {82181C67-7B33-4286-A575-42B9A2815979}.Release|x86.Build.0 = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|ARM.ActiveCfg = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|ARM.Build.0 = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|x64.ActiveCfg = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|x64.Build.0 = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|x86.ActiveCfg = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Debug|x86.Build.0 = Debug|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|Any CPU.Build.0 = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|ARM.ActiveCfg = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|ARM.Build.0 = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|x64.ActiveCfg = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|x64.Build.0 = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|x86.ActiveCfg = Release|Any CPU + {B492F9CC-F247-4F55-B91E-0359D07D21D9}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.WinRT.PCL.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.WinRT.PCL.csproj new file mode 100644 index 0000000..eddda4a --- /dev/null +++ b/src/ProtocolBuffers/ProtocolBuffersLite.WinRT.PCL.csproj @@ -0,0 +1,92 @@ + + + + + 12.0 + Debug + AnyCPU + {82181C67-7B33-4286-A575-42B9A2815979} + Library + Properties + Google.ProtocolBuffersLite + Google.ProtocolBuffersLite + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile32 + v4.6 + + + true + full + false + bin\portable-win81+wpa81\Debug\ + TRACE;DEBUG;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE;NOSORTEDLIST;LITE + prompt + 4 + + + pdbonly + true + bin\portable-win81+wpa81\Release\ + TRACE;PORTABLE_LIBRARY;WINDOWS_RUNTIME;NOSERIALIZABLE;NOSORTEDLIST;LITE + prompt + 4 + false + bin\portable-win81+wpa81\Release\Google.ProtocolBuffersLite.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file