Skip to content

Commit

Permalink
Build aspnet50/aspnetcore50 nuget packages
Browse files Browse the repository at this point in the history
  • Loading branch information
lewischeng-ms committed Mar 14, 2015
1 parent c2f996e commit 77c7020
Show file tree
Hide file tree
Showing 22 changed files with 1,801 additions and 11 deletions.
82 changes: 82 additions & 0 deletions sln/Microsoft.OData.Portable45.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OData.Core.Portable45", "..\src\Microsoft.OData.Core\Microsoft.OData.Core.Portable45.csproj", "{3C7A9785-4048-440B-902F-0487C6A89FA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OData.Edm.Portable45", "..\src\Microsoft.OData.Edm\Microsoft.OData.Edm.Portable45.csproj", "{7D921888-FE03-4C3F-80FE-2F624505461C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Spatial.Portable45", "..\src\Microsoft.Spatial\Microsoft.Spatial.Portable45.csproj", "{5D921888-FE03-4C3F-40FE-2F624505461D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Cover|Any CPU = Cover|Any CPU
Cover|x64 = Cover|x64
Cover|x86 = Cover|x86
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Cover|Any CPU.ActiveCfg = Cover|Any CPU
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Cover|Any CPU.Build.0 = Cover|Any CPU
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Cover|x64.ActiveCfg = Cover|x64
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Cover|x64.Build.0 = Cover|x64
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Cover|x86.ActiveCfg = Cover|x86
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Cover|x86.Build.0 = Cover|x86
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Debug|x64.ActiveCfg = Debug|x64
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Debug|x64.Build.0 = Debug|x64
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Debug|x86.ActiveCfg = Debug|x86
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Debug|x86.Build.0 = Debug|x86
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Release|Any CPU.Build.0 = Release|Any CPU
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Release|x64.ActiveCfg = Release|x64
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Release|x64.Build.0 = Release|x64
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Release|x86.ActiveCfg = Release|x86
{3C7A9785-4048-440B-902F-0487C6A89FA0}.Release|x86.Build.0 = Release|x86
{7D921888-FE03-4C3F-80FE-2F624505461C}.Cover|Any CPU.ActiveCfg = Cover|Any CPU
{7D921888-FE03-4C3F-80FE-2F624505461C}.Cover|Any CPU.Build.0 = Cover|Any CPU
{7D921888-FE03-4C3F-80FE-2F624505461C}.Cover|x64.ActiveCfg = Cover|x64
{7D921888-FE03-4C3F-80FE-2F624505461C}.Cover|x64.Build.0 = Cover|x64
{7D921888-FE03-4C3F-80FE-2F624505461C}.Cover|x86.ActiveCfg = Cover|x86
{7D921888-FE03-4C3F-80FE-2F624505461C}.Cover|x86.Build.0 = Cover|x86
{7D921888-FE03-4C3F-80FE-2F624505461C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D921888-FE03-4C3F-80FE-2F624505461C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D921888-FE03-4C3F-80FE-2F624505461C}.Debug|x64.ActiveCfg = Debug|x64
{7D921888-FE03-4C3F-80FE-2F624505461C}.Debug|x64.Build.0 = Debug|x64
{7D921888-FE03-4C3F-80FE-2F624505461C}.Debug|x86.ActiveCfg = Debug|x86
{7D921888-FE03-4C3F-80FE-2F624505461C}.Debug|x86.Build.0 = Debug|x86
{7D921888-FE03-4C3F-80FE-2F624505461C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D921888-FE03-4C3F-80FE-2F624505461C}.Release|Any CPU.Build.0 = Release|Any CPU
{7D921888-FE03-4C3F-80FE-2F624505461C}.Release|x64.ActiveCfg = Release|x64
{7D921888-FE03-4C3F-80FE-2F624505461C}.Release|x64.Build.0 = Release|x64
{7D921888-FE03-4C3F-80FE-2F624505461C}.Release|x86.ActiveCfg = Release|x86
{7D921888-FE03-4C3F-80FE-2F624505461C}.Release|x86.Build.0 = Release|x86
{5D921888-FE03-4C3F-40FE-2F624505461D}.Cover|Any CPU.ActiveCfg = Cover|Any CPU
{5D921888-FE03-4C3F-40FE-2F624505461D}.Cover|Any CPU.Build.0 = Cover|Any CPU
{5D921888-FE03-4C3F-40FE-2F624505461D}.Cover|x64.ActiveCfg = Cover|x64
{5D921888-FE03-4C3F-40FE-2F624505461D}.Cover|x64.Build.0 = Cover|x64
{5D921888-FE03-4C3F-40FE-2F624505461D}.Cover|x86.ActiveCfg = Cover|x86
{5D921888-FE03-4C3F-40FE-2F624505461D}.Cover|x86.Build.0 = Cover|x86
{5D921888-FE03-4C3F-40FE-2F624505461D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D921888-FE03-4C3F-40FE-2F624505461D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D921888-FE03-4C3F-40FE-2F624505461D}.Debug|x64.ActiveCfg = Debug|x64
{5D921888-FE03-4C3F-40FE-2F624505461D}.Debug|x64.Build.0 = Debug|x64
{5D921888-FE03-4C3F-40FE-2F624505461D}.Debug|x86.ActiveCfg = Debug|x86
{5D921888-FE03-4C3F-40FE-2F624505461D}.Debug|x86.Build.0 = Debug|x86
{5D921888-FE03-4C3F-40FE-2F624505461D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D921888-FE03-4C3F-40FE-2F624505461D}.Release|Any CPU.Build.0 = Release|Any CPU
{5D921888-FE03-4C3F-40FE-2F624505461D}.Release|x64.ActiveCfg = Release|x64
{5D921888-FE03-4C3F-40FE-2F624505461D}.Release|x64.Build.0 = Release|x64
{5D921888-FE03-4C3F-40FE-2F624505461D}.Release|x86.ActiveCfg = Release|x86
{5D921888-FE03-4C3F-40FE-2F624505461D}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions src/Microsoft.OData.Core/AsyncBufferedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ internal void FlushSync()
/// Asynchronous flush operation. This will flush all buffered bytes to the underlying stream through asynchronous writes.
/// </summary>
/// <returns>The task representing the asynchronous flush operation.</returns>
#if WINRT
internal new Task FlushAsync()
#else
internal Task FlushAsync()
#endif
{
return this.FlushAsyncInternal();
}
Expand Down Expand Up @@ -370,10 +374,14 @@ public void WriteToStream(Stream stream)
public Task WriteToStreamAsync(Stream stream)
{
Debug.Assert(stream != null, "stream != null");
#if WINRT
return stream.WriteAsync(this.buffer, 0, this.storedCount);
#else
return Task.Factory.FromAsync(
(callback, state) => stream.BeginWrite(this.buffer, 0, this.storedCount, callback, state),
stream.EndWrite,
null);
#endif
}
#endif
}
Expand Down
30 changes: 30 additions & 0 deletions src/Microsoft.OData.Core/BufferedReadStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,35 @@ private IEnumerable<Task> BufferInputStream()
currentBuffer = this.AddNewBuffer();
}

#if WINRT
yield return inputStream.ReadAsync(currentBuffer.Buffer, currentBuffer.OffsetToWriteTo, currentBuffer.FreeBytes)
.ContinueWith(t =>
{
try
{
int bytesRead = t.Result;
if (bytesRead == 0)
{
this.inputStream = null;
}
else
{
currentBuffer.MarkBytesAsWritten(bytesRead);
}
}
catch (Exception exception)
{
if (!ExceptionUtils.IsCatchableExceptionType(exception))
{
throw;
}

this.inputStream = null;
throw;
}
});

#else
yield return Task.Factory.FromAsync(
(asyncCallback, asyncState) => this.inputStream.BeginRead(
currentBuffer.Buffer,
Expand Down Expand Up @@ -294,6 +323,7 @@ private IEnumerable<Task> BufferInputStream()
}
},
null);
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,30 @@
<description>Classes to serialize, deserialize and validate OData JSON payloads. Supports OData v4 only. Enables construction of OData producers and consumers. Targets .NET Portable Lib with support for .NET 4.0, SL 5.0, Win Phone 8, Win Phone 8.1, and Win 8. Localized for CHS, CHT, DEU, ESN, FRA, ITA, JPN, KOR and RUS.
OData .NET library is open source at http://odata.codeplex.com</description>
<dependencies>
<dependency id="Microsoft.Spatial" version="[$VersionNuGetSemantic$]" />
<dependency id="Microsoft.OData.Edm" version="[$VersionNuGetSemantic$]" />
<group targetFramework="Asp.NetCore5.0">
<dependency id="System.Runtime" version="4.0.20-beta-22523" />
<dependency id="Microsoft.Spatial" version="[$VersionNuGetSemantic$]" />
<dependency id="Microsoft.OData.Edm" version="[$VersionNuGetSemantic$]" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="mscorlib" targetFramework="Asp.Net5.0" />
<frameworkAssembly assemblyName="System" targetFramework="Asp.Net5.0" />
<frameworkAssembly assemblyName="System.Core" targetFramework="Asp.Net5.0" />
<frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework="Asp.Net5.0" />
</frameworkAssemblies>
</metadata>
<files>
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.dll" target="lib\portable-net40+sl5+wp8+win8+wpa" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.pdb" target="lib\portable-net40+sl5+wp8+win8+wpa" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.xml" target="lib\portable-net40+sl5+wp8+win8+wpa" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\1041\Microsoft.OData.Core.resources.dll" target="lib\portable-net40+sl5+wp8+win8+wpa\ja" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.dll" target="lib\aspnet50" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.pdb" target="lib\aspnet50" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.xml" target="lib\aspnet50" />
<file src=".NETPortable\v4.5\Microsoft.OData.Core.Portable45\Microsoft.OData.Core.dll" target="lib\aspnetcore50" />
<file src=".NETPortable\v4.5\Microsoft.OData.Core.Portable45\Microsoft.OData.Core.pdb" target="lib\aspnetcore50" />
<file src=".NETPortable\v4.5\Microsoft.OData.Core.Portable45\Microsoft.OData.Core.xml" target="lib\aspnetcore50" />
<file src="$SourcesRoot$\src\Microsoft.OData.Core\**\*.cs" target="src\Microsoft.OData.Core" />
<file src="$SourcesRoot$\src\Microsoft.OData.Edm\Csdl\EdmValueParser.cs" target="src\Microsoft.OData.Edm\Csdl\EdmValueParser.cs" />
<file src="$SourcesRoot$\src\Microsoft.OData.Edm\Csdl\EdmValueWriter.cs" target="src\Microsoft.OData.Edm\Csdl\EdmValueWriter.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@
<description>Classes to serialize, deserialize and validate OData JSON payloads. Supports OData v4 only. Enables construction of OData producers and consumers. Targets .NET Portable Lib with support for .NET 4.0, SL 5.0, Win Phone 8, Win Phone 8.1, and Win 8. Localized for CHS, CHT, DEU, ESN, FRA, ITA, JPN, KOR and RUS.
OData .NET library is open source at http://odata.codeplex.com</description>
<dependencies>
<dependency id="Microsoft.Spatial" version="[$VersionNuGetSemantic$]" />
<dependency id="Microsoft.OData.Edm" version="[$VersionNuGetSemantic$]" />
<group targetFramework="Asp.NetCore5.0">
<dependency id="Microsoft.Spatial" version="[$VersionNuGetSemantic$]" />
<dependency id="Microsoft.OData.Edm" version="[$VersionNuGetSemantic$]" />
<dependency id="System.Runtime" version="4.0.20-beta-22523" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="mscorlib" targetFramework="Asp.Net5.0" />
<frameworkAssembly assemblyName="System" targetFramework="Asp.Net5.0" />
<frameworkAssembly assemblyName="System.Core" targetFramework="Asp.Net5.0" />
<frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework="Asp.Net5.0" />
</frameworkAssemblies>
</metadata>
<files>
<!-- 1262638 TODO: Add sat resource dlls and intellisense files for portable lib -->
Expand All @@ -33,6 +42,12 @@ OData .NET library is open source at http://odata.codeplex.com</description>
<file src=".NETPortable\v4.0\Microsoft.OData.Core\1041\Microsoft.OData.Core.resources.dll" target="lib\portable-net40+sl5+wp8+win8+wpa\ja" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\1042\Microsoft.OData.Core.resources.dll" target="lib\portable-net40+sl5+wp8+win8+wpa\ko" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\1049\Microsoft.OData.Core.resources.dll" target="lib\portable-net40+sl5+wp8+win8+wpa\ru" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.dll" target="lib\aspnet50" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.pdb" target="lib\aspnet50" />
<file src=".NETPortable\v4.0\Microsoft.OData.Core\Microsoft.OData.Core.xml" target="lib\aspnet50" />
<file src=".NETPortable\v4.5\Microsoft.OData.Core.Portable45\Microsoft.OData.Core.dll" target="lib\aspnetcore50" />
<file src=".NETPortable\v4.5\Microsoft.OData.Core.Portable45\Microsoft.OData.Core.pdb" target="lib\aspnetcore50" />
<file src=".NETPortable\v4.5\Microsoft.OData.Core.Portable45\Microsoft.OData.Core.xml" target="lib\aspnetcore50" />
<file src="$SourcesRoot$\src\Microsoft.OData.Core\**\*.cs" target="src\Microsoft.OData.Core" />
<file src="$SourcesRoot$\src\Microsoft.OData.Edm\Csdl\EdmValueParser.cs" target="src\Microsoft.OData.Edm\Csdl\EdmValueParser.cs" />
<file src="$SourcesRoot$\src\Microsoft.OData.Edm\Csdl\EdmValueWriter.cs" target="src\Microsoft.OData.Edm\Csdl\EdmValueWriter.cs" />
Expand Down
27 changes: 27 additions & 0 deletions src/Microsoft.OData.Core/MessageStreamWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ namespace Microsoft.OData.Core
using System;
using System.Diagnostics;
using System.IO;

#if WINRT
using System.Threading;
using System.Threading.Tasks;
#endif
#endregion Namespaces

/// <summary>
Expand Down Expand Up @@ -176,6 +181,19 @@ public override int Read(byte[] buffer, int offset, int count)
return bytesRead;
}

#if WINRT
/// <inheritdoc />
public async override Task<int> ReadAsync(
byte[] buffer,
int offset,
int count,
CancellationToken cancellationToken)
{
int bytesRead = await this.innerStream.ReadAsync(buffer, offset, count, cancellationToken);
this.IncreaseTotalBytesRead(bytesRead);
return bytesRead;
}
#else
/// <summary>
/// Begins a read operation from the stream.
/// </summary>
Expand All @@ -201,6 +219,7 @@ public override int EndRead(IAsyncResult asyncResult)
this.IncreaseTotalBytesRead(bytesRead);
return bytesRead;
}
#endif

/// <summary>
/// Seeks the stream.
Expand Down Expand Up @@ -233,6 +252,13 @@ public override void Write(byte[] buffer, int offset, int count)
this.innerStream.Write(buffer, offset, count);
}

#if WINRT
/// <inheritdoc />
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return this.innerStream.WriteAsync(buffer, offset, count, cancellationToken);
}
#else
/// <summary>
/// Begins an asynchronous write operation to the stream.
/// </summary>
Expand All @@ -255,6 +281,7 @@ public override void EndWrite(IAsyncResult asyncResult)
{
this.innerStream.EndWrite(asyncResult);
}
#endif

/// <summary>
/// Dispose this wrapping stream and the underlying stream.
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.OData.Core/Metadata/EdmLibraryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ internal static bool IsPrimitiveType(Type clrType)
Debug.Assert(clrType != null, "clrType != null");

// PERF
switch (Type.GetTypeCode(clrType))
switch (PlatformHelper.GetTypeCode(clrType))
{
case TypeCode.Boolean:
case TypeCode.Byte:
Expand Down Expand Up @@ -1799,7 +1799,7 @@ internal static IEdmPrimitiveTypeReference GetPrimitiveTypeReference(Type clrTyp
{
Debug.Assert(clrType != null, "clrType != null");

TypeCode typeCode = Type.GetTypeCode(clrType);
TypeCode typeCode = PlatformHelper.GetTypeCode(clrType);
switch (typeCode)
{
case TypeCode.Boolean:
Expand Down
Loading

0 comments on commit 77c7020

Please sign in to comment.